Skip to content

Commit

Permalink
feat(bot): ✨ update command edit button
Browse files Browse the repository at this point in the history
  • Loading branch information
AnzhiZhang committed Jul 1, 2024
1 parent 8daedd6 commit 9e4d06d
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/bot/bot/command_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ def __command_info(self, src: CommandSource, ctx: CommandContext):
def get_config_button(
bot_name: str,
config: str,
default_value: str
default_value: str = None
) -> RText:
"""
Get a RText config button.
Expand All @@ -545,6 +545,9 @@ def get_config_button(
:param default_value: Default value of the config.
:return: RText.
"""
if default_value is None:
default_value = ''

return (
RText('[✐]', color=RColor.gray)
.h(
Expand Down Expand Up @@ -742,29 +745,29 @@ def get_config_button(
bot.comment
), '\n',
get_config_button(
bot.name, 'actions', ''
bot.name, 'actions'
), ' ',
actions_info, '\n',
get_config_button(
bot.name, 'tags', ''
bot.name, 'tags'
), ' ',
tags_info, '\n',
get_config_button(
bot.name, 'autoLogin', bot.auto_login
bot.name, 'autoLogin'
), ' ',
RTextMCDRTranslation(
'bot.command.info.autoLogin',
bot.auto_login
), '\n',
get_config_button(
bot.name, 'autoRunActions', bot.auto_run_actions
bot.name, 'autoRunActions'
), ' ',
RTextMCDRTranslation(
'bot.command.info.autoRunActions',
bot.auto_run_actions
), '\n',
get_config_button(
bot.name, 'autoUpdate', bot.auto_update
bot.name, 'autoUpdate'
), ' ',
RTextMCDRTranslation(
'bot.command.info.autoUpdate',
Expand Down

0 comments on commit 9e4d06d

Please sign in to comment.