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

guild.get_member_named() returns None for some users #29

Closed
al-matty opened this issue Dec 14, 2022 · 0 comments · Fixed by #30
Closed

guild.get_member_named() returns None for some users #29

al-matty opened this issue Dec 14, 2022 · 0 comments · Fixed by #30
Labels
bug Something isn't working

Comments

@al-matty
Copy link
Collaborator

al-matty commented Dec 14, 2022

async def get_user_roles(self, discord_username, guild_id) -> list:
guild = await self.get_guild(guild_id)
user = guild.get_member_named(discord_username)
roles = [role.name for role in user.roles]

telegram_bot.py", line 202, in discord_roles
roles_available = await self.discord_bot.get_user_roles(discord_handle, guild_id)
discord_bot.py", line 139, in get_user_roles
roles = [role.name for role in user.roles]
AttributeError: 'NoneType' object has no attribute 'roles'

TODO's:
-Remove conversion to lowercase for Discord handles in Telegram menu. This leads to matching errors.

@al-matty al-matty added the bug Something isn't working label Dec 14, 2022
@al-matty al-matty linked a pull request Dec 18, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant