Sort help_dict

This commit is contained in:
blank X 2020-11-14 18:43:07 +07:00
parent dbe09f3b19
commit 751dd0d49e
2 changed files with 3 additions and 3 deletions

View File

@ -30,7 +30,7 @@ async def help(client, message):
await message.reply_text({'message': result.send_message.message, 'entities': result.send_message.entities}, parse_mode='through')
else:
text = 'Avaliable plugins:\n'
for i in help_dict:
for i in sorted(help_dict):
text += f'- {html.escape(help_dict[i][0])}\n'
await message.reply_text(text)

View File

@ -24,7 +24,7 @@ async def main_help(client, inline_query):
results = []
parser = pyrogram_html.HTML(client)
me = None
for internal_name in help_dict:
for internal_name in sorted(help_dict):
external_name, help_text = help_dict[internal_name]
if '{bot}' in help_text:
if not me:
@ -68,7 +68,7 @@ async def help_back(client, callback_query):
if message_info.get(message_identifier, True):
buttons = []
to_append = []
for internal_name in help_dict:
for internal_name in sorted(help_dict):
external_name, _ = help_dict[internal_name]
to_append.append(InlineKeyboardButton(external_name, f'help_m{internal_name}'))
if len(to_append) > 2: