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

JSONDecode Error #14

Open
OhNo2 opened this issue Oct 16, 2020 · 0 comments
Open

JSONDecode Error #14

OhNo2 opened this issue Oct 16, 2020 · 0 comments

Comments

@OhNo2
Copy link

OhNo2 commented Oct 16, 2020

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.

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

No branches or pull requests

1 participant