From 6535240bbefaa8dfeafd30f412f010724d1277c5 Mon Sep 17 00:00:00 2001 From: Jeremy Zhang Date: Sun, 9 Apr 2017 02:16:20 +0000 Subject: [PATCH] Sort channels listing --- titanembeds/blueprints/api/api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/titanembeds/blueprints/api/api.py b/titanembeds/blueprints/api/api.py index be7f203..4d7d8ef 100644 --- a/titanembeds/blueprints/api/api.py +++ b/titanembeds/blueprints/api/api.py @@ -180,7 +180,7 @@ def get_guild_channels(guild_id): if result["read"]: result_channels.append(result) - return result_channels + return sorted(result_channels, key=lambda k: k['channel']['position']) def filter_guild_channel(guild_id, channel_id): channels = get_guild_channels(guild_id)