weibeu / Flask-Discord

Discord OAuth2 extension for Flask. An Easier implementation of "Log In With Discord".
https://flask-discord.readthedocs.io/en/latest/
MIT License
182 stars 47 forks source link

Error on request with parameter #39

Closed m0ssa99 closed 3 years ago

m0ssa99 commented 3 years ago

i try to get a guild member, without limit parameter i get only 1 member discord.bot_request("/guilds/{GUILDID}/members",data=dict(limit=100)) i get error simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

weibeu commented 3 years ago

API v9 docs states that limit and other arguments should be passed as query parameter. I tried this which worked for me.

discord.bot_request("/guilds/{GUILDID}/members", params=dict(limit=100))

Anyways about getting JSONDecodeError, as I can see its coming from simplejson.errors.JSONDecodeError and Flask-Discord is set to use and handle exceptions of the json from the Python standard library. So I would advise to uninstall simplejson so that it uses the default json library.

If issue still persists then let me know I would fix this in upcoming updates.

weibeu commented 3 years ago

I will close this issue for now. Feel free to re-open if you get any further troubles implementing the same.