mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-06-07 12:18:59 +00:00
Actually fix the order in Guild.by_category.
This commit is contained in:
parent
87a7efc410
commit
95de4d1df1
@ -340,13 +340,13 @@ class Guild(Hashable):
|
|||||||
|
|
||||||
def key(t):
|
def key(t):
|
||||||
k, v = 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
|
_get = self._channels.get
|
||||||
as_list = [(_get(k), v) for k, v in grouped.items()]
|
as_list = [(_get(k), v) for k, v in grouped.items()]
|
||||||
as_list.sort(key=key)
|
as_list.sort(key=key)
|
||||||
for _, channels in as_list:
|
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
|
return as_list
|
||||||
|
|
||||||
def get_channel(self, channel_id):
|
def get_channel(self, channel_id):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user