Skip to content
This repository was archived by the owner on Aug 27, 2022. It is now read-only.
This repository was archived by the owner on Aug 27, 2022. It is now read-only.

JSONDecode Error #14

Description

@OhNo2

I have the code
python @bot.command(pass_context=True,brief='Checks if a user has a valid Minecraft Username just input the username') @commands.has_role("SuperAdmin") async def verify(ctx, *, username): """validates a users MC account actually exists""" url = f'https://api.mojang.com/users/profiles/minecraft/{username}?' javacheck = requests.get(url) status = javacheck.status_code if status != 204: uuid = javacheck.json()['id'] await ctx.send(f'{username} checks out as a *Java* player') if status == 204: try: gt = xbox.GamerProfile.from_gamertag(username) await ctx.send(f'{username} checks out as a *Bedrock* player') except xbox.exceptions.GamertagNotFound: await ctx.send(f'{username} is not a valid minecraft account on any platform')
and I get the error: Command raised an exception: JSONDecodeError: Expecting value: line 1 column 1 (char 0)
randomly when i am using my code, but restarting the application fixes the error. The code works most of the time, but after a while if it needs to call the Xbox Live API it just doesn't work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions