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.bans() raises a TypeError #2512

Closed
2 of 3 tasks
mikeshardmind opened this issue Jan 17, 2020 · 6 comments
Closed
2 of 3 tasks

Guild.bans() raises a TypeError #2512

mikeshardmind opened this issue Jan 17, 2020 · 6 comments
Labels
discord bug This is a Discord bug, not one with the library. no repro Cannot be reproduced.

Comments

@mikeshardmind
Copy link
Contributor

Summary

Calling await guild.bans() results in a TypeError

Reproduction Steps

g_bans = {x.user for x in await guild.bans()}

Expected Results

I expected it to gracefully handle this, but this seems to be a case of discord changing things without telling anyone.

Actual Results

    g_bans = {x.user for x in await guild.bans()}
  File "/root/rachael/lib/python3.8/site-packages/discord/guild.py", line 1246, in bans
    return [BanEntry(user=User(state=self._state, data=e['user']),
  File "/root/rachael/lib/python3.8/site-packages/discord/guild.py", line 1246, in <listcomp>
    return [BanEntry(user=User(state=self._state, data=e['user']),
  File "/root/rachael/lib/python3.8/site-packages/discord/user.py", line 81, in __init__
    self._update(data)
  File "/root/rachael/lib/python3.8/site-packages/discord/user.py", line 96, in _update
    self.name = data['username']
TypeError: 'NoneType' object is not subscriptable

Checklist

  • I have searched the open issues for duplicates.
  • I have shown the entire traceback, if possible.
  • I have removed my token from display, if visible.

System Information

@Rapptz Rapptz added discord bug This is a Discord bug, not one with the library. no repro Cannot be reproduced. labels Jan 17, 2020
@Rapptz
Copy link
Owner

Rapptz commented Jan 17, 2020

I can't reproduce this one. It's not in my bot's logs anywhere and I checked around 120 random guilds + 5 servers I moderate and couldn't get a single failing request.

@mikeshardmind
Copy link
Contributor Author

I can offer an invite with ban perms for a bot to the server this happened in if you'd like.

@jhgg
Copy link
Contributor

jhgg commented Jan 17, 2020

This bug is on our end (discord's) - we're looking into it.

@jhgg
Copy link
Contributor

jhgg commented Jan 17, 2020

Issue is resolved on our end. Error should no longer occur.

@Rapptz Rapptz closed this as completed Jan 17, 2020
@mikeshardmind
Copy link
Contributor Author

Thanks!

@mikeshardmind
Copy link
Contributor Author

@jhgg I know you said the error should no longer occur, but I've now seen this a few more times via various other users of the same code base running into an identical issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discord bug This is a Discord bug, not one with the library. no repro Cannot be reproduced.
Projects
None yet
Development

No branches or pull requests

3 participants