Fix bug with Guild.by_category not showing some channels

If categories come after a child channel in the dictionary mapping for
whatever reason, then the previous code would remove it from the
mapping and set it to []. This commit aims to fix this.
This commit is contained in:
Rapptz 2020-08-22 17:18:13 -04:00
parent 45752ab354
commit 11f29890dc

View File

@ -415,7 +415,7 @@ class Guild(Hashable):
grouped = {}
for channel in self._channels.values():
if isinstance(channel, CategoryChannel):
grouped[channel.id] = []
grouped.setdefault(channel.id, [])
continue
try: