🐛 修复同时设置了空和非空的命令前缀时Wiki使用不正常的问题

This commit is contained in:
CMHopeSunshine 2022-12-19 21:06:01 +08:00
parent 9d4d236769
commit 0f0ca49f64

View File

@ -10,7 +10,13 @@ except ImportError:
from . import DRIVER
command_start = list(DRIVER.config.command_start)
COMMAND_START_RE = '^' + '|'.join(command_start) if command_start else '^'
if len(command_start) == 1 and command_start[0] == '':
COMMAND_START_RE = '^'
elif '' in command_start:
command_start.remove('')
COMMAND_START_RE = '^(' + '|'.join(command_start) + ')?'
else:
COMMAND_START_RE = '^(' + '|'.join(command_start) + ')'
ElementType = Literal['', '', '', '', '', '', '', '物理']