@@ -602,20 +602,29 @@ async def help_commands_handler(event: events.NewMessage.Event):
602602
603603 categories : Dict [str , List [str ]] = {}
604604 core_commands : List [Tuple [str , str , str ]] = [
605- ("Управление" , ".listaccs" , "help_listaccs" ), ("Управление" , ".addacc <name>" , "help_addacc" ),
606- ("Управление" , ".delacc <name>" , "help_delacc" ), ("Управление" , ".toggleacc <name>" , "help_toggleacc" ),
607- ("Управление" , ".setlang <code|url>" , "help_setlang" ),
608- ("Модули" , ".addmod <url>" , "help_addmod" ), ("Модули" , ".delmod <name>" , "help_delmod" ),
609- ("Модули" , ".trustmod <name>" , "help_trustmod" ),("Модули" , ".configmod <...>" , "help_configmod" ),
610- ("Модули" , ".updatemodule <name>" , "help_updatemodule" ), ("Модули" , ".updatemodules" , "help_updatemodules" ),
611- ("Утилиты" , ".ping" , "help_ping" ), ("Утилиты" , ".restart" , "help_restart" ),
612- ("Утилиты" , ".logs" , "help_logs" ),("Утилиты" , ".about" , "help_about" ),
605+ ("help_category_management" , ".listaccs" , "help_listaccs" ),
606+ ("help_category_management" , ".addacc <name>" , "help_addacc" ),
607+ ("help_category_management" , ".delacc <name>" , "help_delacc" ),
608+ ("help_category_management" , ".toggleacc <name>" , "help_toggleacc" ),
609+ ("help_category_management" , ".setlang <code|url>" , "help_setlang" ),
610+ ("help_category_modules" , ".addmod <url>" , "help_addmod" ),
611+ ("help_category_modules" , ".delmod <name>" , "help_delmod" ),
612+ ("help_category_modules" , ".trustmod <name>" , "help_trustmod" ),
613+ ("help_category_modules" , ".configmod <...>" , "help_configmod" ),
614+ ("help_category_modules" , ".updatemodule <name>" , "help_updatemodule" ),
615+ ("help_category_modules" , ".updatemodules" , "help_updatemodules" ),
616+ ("help_category_utilities" , ".ping" , "help_ping" ),
617+ ("help_category_utilities" , ".restart" , "help_restart" ),
618+ ("help_category_utilities" , ".logs" , "help_logs" ),
619+ ("help_category_utilities" , ".about" , "help_about" ),
613620 ]
614- for category , pattern , key in core_commands :
615- if category not in categories :
616- categories [category ] = []
617- desc : str = await client .get_string (key )
618- categories [category ].append (f"`{ pattern } ` - { desc } " )
621+ for category_key , pattern , desc_key in core_commands :
622+ translated_category : str = await client .get_string (category_key )
623+ if translated_category not in categories :
624+ categories [translated_category ] = []
625+ desc : str = await client .get_string (desc_key )
626+ categories [translated_category ].append (f"`{ pattern } ` - { desc } " )
627+
619628 if account_id and account_id in GLOBAL_HELP_INFO :
620629 for mod_name , mod_info in GLOBAL_HELP_INFO [account_id ].items ():
621630 cat_name : str = mod_info .category .capitalize ()
@@ -624,6 +633,7 @@ async def help_commands_handler(event: events.NewMessage.Event):
624633 for i , pattern in enumerate (mod_info .patterns ):
625634 desc : str = mod_info .descriptions [i ]
626635 categories [cat_name ].append (f"`{ pattern } ` - { desc } " )
636+
627637 final_text_parts : List [str ] = [await client .get_string ("help_header" )]
628638 for i , (category , cmds ) in enumerate (categories .items ()):
629639 final_text_parts .append (f"\n ╭ **{ category } **" )
0 commit comments