summaryrefslogtreecommitdiff
path: root/ATRI/plugins
diff options
context:
space:
mode:
authorKyomotoi <[email protected]>2021-05-05 04:53:03 -0500
committerGitHub <[email protected]>2021-05-05 04:53:03 -0500
commit87f812b9ff6a2dc69ef793587358cd95926861f1 (patch)
tree1ed66b7d900429f59384c938b22a66a1487222b3 /ATRI/plugins
parent0e7d6db7b30a049dcc92954c0925af5038f426c7 (diff)
parentf5dd7e8cb67104cc4cf3e5624a3a34f72ee79c78 (diff)
downloadATRI-87f812b9ff6a2dc69ef793587358cd95926861f1.tar.gz
ATRI-87f812b9ff6a2dc69ef793587358cd95926861f1.tar.bz2
ATRI-87f812b9ff6a2dc69ef793587358cd95926861f1.zip
🐛 正则修复 @shudorcl
Diffstat (limited to 'ATRI/plugins')
-rw-r--r--ATRI/plugins/funny.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/ATRI/plugins/funny.py b/ATRI/plugins/funny.py
index 11e6f39..a2092e3 100644
--- a/ATRI/plugins/funny.py
+++ b/ATRI/plugins/funny.py
@@ -94,11 +94,12 @@ eat_wat = sv.on_regex(r"[今|明|后|大后]天(.*?)吃什么", rule=is_in_servi
@eat_wat.handle()
async def _eat(bot: Bot, event: MessageEvent) -> None:
- msg = str(event.message).strip()
+ msg = str(event.raw_message).strip()
+ msg = re.search(r"大?[今|明|后]天(.*?)吃什么", msg).group()
user = event.user_id
user_n = event.sender.nickname
- arg = re.findall(r"(今|明|后|大后)天(.*?)吃什么", msg)[0]
- nd = re.match(r"(今|明|后|大后)天", msg)[0]
+ arg = re.findall(r"大?[今|明|后]天(.*?)吃什么", msg)[0]
+ nd = re.match(r"大?[今|明|后]天", msg)[0]
if arg == "中午":
a = f"LdS4K6/{randint(0, 999999)}"