mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-04-19 15:36:02 +00:00
Fix Guild.by_category not showing empty categories.
This commit is contained in:
parent
de7c96333c
commit
c01bf7cd56
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user