aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRapptz <[email protected]>2020-06-27 04:06:49 -0400
committerRapptz <[email protected]>2020-06-27 04:06:49 -0400
commitc01bf7cd564314903c89eb2add4e3271fbef5e69 (patch)
tree4a1ca6e542dc8abcb3df316c0e5eeffdfed245c0
parentUpdate Message.system_content join strings to be up to date. (diff)
downloaddiscord.py-c01bf7cd564314903c89eb2add4e3271fbef5e69.tar.xz
discord.py-c01bf7cd564314903c89eb2add4e3271fbef5e69.zip
Fix Guild.by_category not showing empty categories.
-rw-r--r--discord/guild.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/discord/guild.py b/discord/guild.py
index 19cb1cc0..b675150f 100644
--- a/discord/guild.py
+++ b/discord/guild.py
@@ -25,7 +25,7 @@ DEALINGS IN THE SOFTWARE.
"""
import copy
-from collections import namedtuple, defaultdict
+from collections import namedtuple
from . import utils
from .role import Role
@@ -406,9 +406,10 @@ class Guild(Hashable):
List[Tuple[Optional[:class:`CategoryChannel`], List[:class:`abc.GuildChannel`]]]:
The categories and their associated channels.
"""
- grouped = defaultdict(list)
+ grouped = {}
for channel in self._channels.values():
if isinstance(channel, CategoryChannel):
+ grouped[channel.id] = []
continue
grouped[channel.category_id].append(channel)