From 0f0ca49f64fe6b68b1dfd19bada481fa4b557a49 Mon Sep 17 00:00:00 2001 From: CMHopeSunshine <277073121@qq.com> Date: Mon, 19 Dec 2022 21:06:01 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20=E4=BF=AE=E5=A4=8D=E5=90=8C?= =?UTF-8?q?=E6=97=B6=E8=AE=BE=E7=BD=AE=E4=BA=86=E7=A9=BA=E5=92=8C=E9=9D=9E?= =?UTF-8?q?=E7=A9=BA=E7=9A=84=E5=91=BD=E4=BB=A4=E5=89=8D=E7=BC=80=E6=97=B6?= =?UTF-8?q?`Wiki`=E4=BD=BF=E7=94=A8=E4=B8=8D=E6=AD=A3=E5=B8=B8=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LittlePaimon/utils/typing.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/LittlePaimon/utils/typing.py b/LittlePaimon/utils/typing.py index 15f1966..9dcd82c 100644 --- a/LittlePaimon/utils/typing.py +++ b/LittlePaimon/utils/typing.py @@ -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['火', '水', '冰', '雷', '风', '岩', '草', '物理']