Update message.py
This commit is contained in:
parent
54d8c11119
commit
187322301d
1 changed files with 4 additions and 2 deletions
|
@ -119,10 +119,12 @@ async def parser(msg: MessageSession, require_enable_modules: bool = True, prefi
|
||||||
if command.startswith(moduleName):
|
if command.startswith(moduleName):
|
||||||
no_alias = True
|
no_alias = True
|
||||||
if not no_alias:
|
if not no_alias:
|
||||||
|
alias_list = []
|
||||||
for alias in modulesAliases:
|
for alias in modulesAliases:
|
||||||
if command.startswith(alias) and not command.startswith(modulesAliases[alias]):
|
if command.startswith(alias) and not command.startswith(modulesAliases[alias]):
|
||||||
command = command.replace(alias, modulesAliases[alias], 1)
|
alias_list.append(alias)
|
||||||
break
|
max_ = max(alias_list, key=len)
|
||||||
|
command = command.replace(max_, modulesAliases[max_], 1)
|
||||||
command_spilt = command.split(' ') # 切割消息
|
command_spilt = command.split(' ') # 切割消息
|
||||||
msg.trigger_msg = command # 触发该命令的消息,去除消息前缀
|
msg.trigger_msg = command # 触发该命令的消息,去除消息前缀
|
||||||
command_first_word = command_spilt[0].lower()
|
command_first_word = command_spilt[0].lower()
|
||||||
|
|
Reference in a new issue