Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

brawlstats.errors.NotFoundError: An incorrect tag has been passed.Invalid characters: O, O #91

Open
HumanBot000 opened this issue Aug 3, 2024 · 1 comment

Comments

@HumanBot000
Copy link

Describe the bug
I am getting this error, but I am providing a valid tag. Even the tests on the documentation website of bs API work, but not via the python Package

Full Code

    async def user(self, interaction, tag: str = nextcord.SlashOption(
        name="tag",
        name_localizations={Locale.de: "kürzel"},
        description="Your Brawlstars-Tag found under your profile picture in your player profile (starting with a # )",
        description_localizations={
            Locale.de: "Dein Spielerkürzel (befindet sich unter deinem Profilbild in deinem Spielerprofil (beginnt mit einem # ))", Locale.en_US: "Your Brawlstars Tag found under your profile picture in your player profile (starting with a # )"},
        required=True
    )):
        await interaction.response.defer()
        if not tag.startswith("#"):
            tag = f"#{tag}"
        load_dotenv()
        client = brawlstats.Client(token=os.environ.get("BRAWLSTARSAPIKEY"), is_async=True)
        player: brawlstats.Player = await client.get_player(tag)
        if interaction.locale == Locale.de:
            pass
        else:
            embed = nextcord.Embed(title=f"{player.name} ({player.name_color})", description=tag,
                                   color=nextcord.Color.yellow())
                                   
           ...

Expected behavior
Embed with player stats

Actual behavior

player: brawlstats.Player = await client.get_player(tag) -> brawlstats.errors.NotFoundError: An incorrect tag has been passed.Invalid characters: O, O
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x0000025F20805DB0>
Unclosed connector
connections: ['[(<aiohttp.client_proto.ResponseHandler object at 0x0000025F207A2740>, 83705.031)]']
connector: <aiohttp.connector.TCPConnector object at 0x0000025F20807820>

Additional context
Python Version: 3.10
brawlstats Version: 4.1.1
OS (and version): Windows 11

@SharpBit
Copy link
Owner

Use a zero (0), not a capital o (O). O is not a valid character for tags, but 0 is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants