update code

This commit is contained in:
HibiKier
2021-09-05 02:21:38 +08:00
parent 21a5feda43
commit 7afb099c12
84 changed files with 3377 additions and 1404 deletions
+15
View File
@@ -0,0 +1,15 @@
from nonebot import on_command
from nonebot.adapters.cqhttp import Bot, GroupMessageEvent
from nonebot.typing import T_State
import re
withdraw_msg = on_command('撤回', priority=5, block=True)
@withdraw_msg.handle()
async def _(bot: Bot, event: GroupMessageEvent, state: T_State):
r = re.search(r'\[CQ:reply,id=(\d*)]', event.raw_message)
if r:
await bot.delete_msg(message_id=int(r.group(1)), self_id=int(bot.self_id))