sync format
This commit is contained in:
parent
a7568dbaed
commit
8b8a5a44e4
1 changed files with 6 additions and 6 deletions
|
@ -18,22 +18,22 @@ async def set_prefix(msg: Bot.MessageSession):
|
|||
if prefix not in prefixes:
|
||||
prefixes.append(prefix)
|
||||
msg.data.edit_option('command_prefix', prefixes)
|
||||
await msg.send_message(msg.locale.t("core.message.prefix.add.success", prefix=prefix))
|
||||
await msg.finish(msg.locale.t("core.message.prefix.add.success", prefix=prefix))
|
||||
else:
|
||||
await msg.send_message(msg.locale.t("core.message.prefix.add.already"))
|
||||
await msg.finish(msg.locale.t("core.message.prefix.add.already"))
|
||||
elif 'remove' in msg.parsed_msg:
|
||||
if prefix:
|
||||
if prefix in prefixes:
|
||||
prefixes.remove(prefix)
|
||||
msg.data.edit_option('command_prefix', prefixes)
|
||||
await msg.send_message(msg.locale.t("core.message.prefix.remove.success", prefix=prefix))
|
||||
await msg.finish(msg.locale.t("core.message.prefix.remove.success", prefix=prefix))
|
||||
else:
|
||||
await msg.send_message(msg.locale.t("core.message.prefix.remove.not_found"))
|
||||
await msg.finish(msg.locale.t("core.message.prefix.remove.not_found"))
|
||||
elif 'reset' in msg.parsed_msg:
|
||||
msg.data.edit_option('command_prefix', [])
|
||||
await msg.send_message(msg.locale.t("core.message.prefix.reset"))
|
||||
await msg.finish(msg.locale.t("core.message.prefix.reset"))
|
||||
elif 'list' in msg.parsed_msg:
|
||||
if len(prefixes) == 0:
|
||||
await msg.send_message(msg.locale.t("core.message.prefix.list.none"))
|
||||
await msg.finish(msg.locale.t("core.message.prefix.list.none"))
|
||||
else:
|
||||
await msg.finish(msg.locale.t('core.message.prefix.list', prefixes=', '.join(prefixes)))
|
||||
|
|
Reference in a new issue