Calling await guild.bans() results in a TypeError
g_bans = {x.user for x in await guild.bans()}
I expected it to gracefully handle this, but this seems to be a case of discord changing things without telling anyone.
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
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.
I can offer an invite with ban perms for a bot to the server this happened in if you'd like.
This bug is on our end (discord's) - we're looking into it.
Issue is resolved on our end. Error should no longer occur.
Thanks!
@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.
Most helpful comment
Issue is resolved on our end. Error should no longer occur.