You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You could implement simple OAuth and use this endpoint to pull user roles. No need to create & handle a bot. But not denying that :)
Example py implementation to fetch user roles:
# oauth session creation flags.# configurable `prompt` would be great as well (this allows to skip Discord prompt if user autorized once.discord.create_session(prompt=config["prompt"], scope=['identify', 'guilds', 'guilds.members.read'])
# Fetch user rolesdefuser_roles(access_token):
headers= {'Authorization': f'Bearer {access_token}'}
req=requests.get(f'https://discord.com/api/users/@me/guilds/{guild_id}/member', headers=headers)
roles=req.json()
output= []
forrole_idinroles.get("roles", []):
output.append(role_id)
returnroles
The text was updated successfully, but these errors were encountered:
For both server & client I guess.
You could implement simple OAuth and use this endpoint to pull user roles. No need to create & handle a bot. But not denying that :)
Example
py
implementation to fetch user roles:The text was updated successfully, but these errors were encountered: