diff options
| author | Rapptz <[email protected]> | 2020-08-22 17:18:13 -0400 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2020-08-22 17:18:48 -0400 |
| commit | 11f29890dcb41b064b8fca925e319919628efc1b (patch) | |
| tree | 550d813257cc8f692faa795173e4bfe6b39b1aa0 | |
| parent | Document merging behaviour of AllowedMentions in Messageable.send (diff) | |
| download | discord.py-11f29890dcb41b064b8fca925e319919628efc1b.tar.xz discord.py-11f29890dcb41b064b8fca925e319919628efc1b.zip | |
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.
| -rw-r--r-- | discord/guild.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/discord/guild.py b/discord/guild.py index ce32bfc9..0c6585d0 100644 --- a/discord/guild.py +++ b/discord/guild.py @@ -104,10 +104,10 @@ class Guild(Hashable): max_presences: Optional[:class:`int`] The maximum amount of presences for the guild. max_members: Optional[:class:`int`] - The maximum amount of members for the guild. + The maximum amount of members for the guild. .. note:: - + This attribute is only available via :meth:`.Client.fetch_guild`. max_video_channel_users: Optional[:class:`int`] The maximum amount of users in a video channel. @@ -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: @@ -909,7 +909,7 @@ class Guild(Hashable): The channel's preferred audio bitrate in bits per second. user_limit: :class:`int` The channel's limit for number of members that can be in a voice channel. - + Raises ------ Forbidden @@ -940,7 +940,7 @@ class Guild(Hashable): The ``category`` parameter is not supported in this function since categories cannot have categories. - + Raises ------ Forbidden @@ -1746,7 +1746,7 @@ class Guild(Hashable): async def edit_role_positions(self, positions, *, reason=None): """|coro| - + Bulk edits a list of :class:`Role` in the guild. You must have the :attr:`~Permissions.manage_roles` permission to |