From 9bbfe498cc8f29873b8ad9203bb93005df65c6b5 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Fri, 3 Nov 2023 15:02:27 +0100 Subject: [PATCH] Fixed channel sort --- bot/src/bot_graphql/queries/discord/guild_query.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bot/src/bot_graphql/queries/discord/guild_query.py b/bot/src/bot_graphql/queries/discord/guild_query.py index cf32e8d7..7b64eeab 100644 --- a/bot/src/bot_graphql/queries/discord/guild_query.py +++ b/bot/src/bot_graphql/queries/discord/guild_query.py @@ -25,7 +25,7 @@ class GuildQuery(QueryABC): ) def _resolve_channels(self, g: Guild, *_, filter=None): - channels = List(any).extend(g.channels) + channels = List(any).extend(g.channels).order_by(lambda x: x.position) if filter is None: return channels @@ -39,4 +39,4 @@ class GuildQuery(QueryABC): if "type" in filter: channels = channels.where(lambda c: type(c).__name__ == filter["type"]) - return channels.order_by(lambda x: x.position) + return channels