From 2ca9b559fe5f4639827deba9a1e01e8852fd98c7 Mon Sep 17 00:00:00 2001 From: xtaodada Date: Mon, 21 Aug 2023 21:38:12 +0800 Subject: [PATCH] :bug: Fix incorrect matching with commands containing `@` Resolved the issue where commands with an '@' symbol, such as "/challenge@HonkaiStarRail_ZH_Bot", were not being matched correctly due to the regular expression pattern. The pattern has been updated to handle such cases. Co-authored-by: luoshuijs --- plugins/starrail/challenge.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/starrail/challenge.py b/plugins/starrail/challenge.py index feb397e..3ca626e 100644 --- a/plugins/starrail/challenge.py +++ b/plugins/starrail/challenge.py @@ -31,7 +31,7 @@ if TYPE_CHECKING: TZ = timezone("Asia/Shanghai") -cmd_pattern = r"(?i)^/challenge\s*((?:\d+)|(?:all))?\s*(pre)?" +cmd_pattern = r"(?i)^/challenge(?:@[\w]+)?\s*((?:\d+)|(?:all))?\s*(pre)?" msg_pattern = r"^混沌回忆数据((?:查询)|(?:总览))(上期)?\D?(\d*)?.*?$"