diff options
| author | Rapptz <[email protected]> | 2018-03-31 23:16:53 -0400 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2018-03-31 23:16:53 -0400 |
| commit | 95de4d1df164f1549dfea90ea9c0b647bae383a7 (patch) | |
| tree | b1bc4c45222b5414105b94299350cea4006fdd93 | |
| parent | Flip comparison in Guild.by_category. (diff) | |
| download | discord.py-95de4d1df164f1549dfea90ea9c0b647bae383a7.tar.xz discord.py-95de4d1df164f1549dfea90ea9c0b647bae383a7.zip | |
Actually fix the order in Guild.by_category.
| -rw-r--r-- | discord/guild.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/discord/guild.py b/discord/guild.py index b54eecb5..247523cc 100644 --- a/discord/guild.py +++ b/discord/guild.py @@ -340,13 +340,13 @@ class Guild(Hashable): def key(t): k, v = t - return ((not isinstance(k, TextChannel), k.position, k.id) if k else (-1, -1, -1), v) + return ((k.position, k.id) if k else (-1, -1), v) _get = self._channels.get as_list = [(_get(k), v) for k, v in grouped.items()] as_list.sort(key=key) for _, channels in as_list: - channels.sort(key=lambda c: (c.position, c.id)) + channels.sort(key=lambda c: (not isinstance(c, TextChannel), c.position, c.id)) return as_list def get_channel(self, channel_id): |