Merge pull request #372 from ebilesh/branch-2

Adding sorting for server and channel names in the text menu of config
This commit is contained in:
trigg 2025-12-30 20:37:17 +00:00 committed by GitHub
commit ce4f3320d5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -325,11 +325,13 @@ class MainSettingsWindow():
self.channel_ids = []
g.remove_all()
c.remove_all()
for guild in data['guild'].values():
guilds = sorted(data['guild'].values(), key=lambda x: x['name'].lower())
for guild in guilds:
g.append_text(guild['name'])
self.guild_ids.append(guild['id'])
if guild['id'] == self.current_guild and 'channels' in guild:
for channel in guild['channels']:
channels = sorted(guild['channels'], key=lambda x: x['name'].lower())
for channel in channels:
c.append_text(channel['name'])
self.channel_ids.append(channel['id'])
except FileNotFoundError: