style (help): Add facility for new command badges.

This commit is contained in:
2022-01-28 19:38:26 +02:00
parent a1f3e8d275
commit 40b23c0b41

View File

@@ -9,9 +9,12 @@ from .module import module
from .lib import guide_link from .lib import guide_link
new_emoji = " 🆕"
new_commands = {'achievements', 'nerd', 'invite', 'support'}
# Set the command groups to appear in the help # Set the command groups to appear in the help
group_hints = { group_hints = {
'🆕 Pomodoro': "*Stay in sync with your friends using our timers!*", 'Pomodoro': "*Stay in sync with your friends using our timers!*",
'Productivity': "*Use these to help you stay focused and productive!*", 'Productivity': "*Use these to help you stay focused and productive!*",
'Statistics': "*StudyLion leaderboards and study statistics.*", 'Statistics': "*StudyLion leaderboards and study statistics.*",
'Economy': "*Buy, sell, and trade with your hard-earned coins!*", 'Economy': "*Buy, sell, and trade with your hard-earned coins!*",
@@ -22,22 +25,22 @@ group_hints = {
} }
standard_group_order = ( standard_group_order = (
('🆕 Pomodoro', 'Productivity', 'Statistics', 'Economy', 'Personal Settings', 'Meta'), ('Pomodoro', 'Productivity', 'Statistics', 'Economy', 'Personal Settings', 'Meta'),
) )
mod_group_order = ( mod_group_order = (
('Moderation', 'Meta'), ('Moderation', 'Meta'),
('🆕 Pomodoro', 'Productivity', 'Statistics', 'Economy', 'Personal Settings') ('Pomodoro', 'Productivity', 'Statistics', 'Economy', 'Personal Settings')
) )
admin_group_order = ( admin_group_order = (
('Guild Admin', 'Guild Configuration', 'Moderation', 'Meta'), ('Guild Admin', 'Guild Configuration', 'Moderation', 'Meta'),
('🆕 Pomodoro', 'Productivity', 'Statistics', 'Economy', 'Personal Settings') ('Pomodoro', 'Productivity', 'Statistics', 'Economy', 'Personal Settings')
) )
bot_admin_group_order = ( bot_admin_group_order = (
('Bot Admin', 'Guild Admin', 'Guild Configuration', 'Moderation', 'Meta'), ('Bot Admin', 'Guild Admin', 'Guild Configuration', 'Moderation', 'Meta'),
('🆕 Pomodoro', 'Productivity', 'Statistics', 'Economy', 'Personal Settings') ('Pomodoro', 'Productivity', 'Statistics', 'Economy', 'Personal Settings')
) )
# Help embed format # Help embed format
@@ -170,7 +173,9 @@ async def cmd_help(ctx):
cmd_groups[group] = cmd_group cmd_groups[group] = cmd_group
# Add the command name and description to the group # Add the command name and description to the group
cmd_group.append((command.name, getattr(command, 'desc', ''))) cmd_group.append(
(command.name, (getattr(command, 'desc', '') + (new_emoji if command.name in new_commands else '')))
)
# Add any required aliases # Add any required aliases
for alias, desc in getattr(command, 'help_aliases', {}).items(): for alias, desc in getattr(command, 'help_aliases', {}).items():