update code

This commit is contained in:
hibiki
2021-09-09 10:47:26 +08:00
parent 754a0c111c
commit 8d0b0e5505
10 changed files with 104 additions and 54 deletions
+1 -9
View File
@@ -116,15 +116,10 @@ async def _(matcher: Matcher, bot: Bot, event: GroupMessageEvent, state: T_State
return
if matcher.type == "message" and matcher.priority not in [1, 9]:
if state["_prefix"]["raw_command"]:
# print(state["_prefix"]["raw_command"])
if _blmt.check(f'{event.user_id}{state["_prefix"]["raw_command"]}'):
if await BanUser.ban(event.user_id, 9, MALICIOUS_BAN_TIME * 60):
logger.info(f"USER {event.user_id} 触发了恶意触发检测")
# await update_img.finish('检测到恶意触发命令,您将被封禁 30 分钟', at_sender=True)
if event.message_type == "group":
if not static_flmt.check(event.user_id):
return
static_flmt.start_cd(event.user_id)
if isinstance(event, GroupMessageEvent):
try:
await bot.send_group_msg(
group_id=event.group_id,
@@ -133,9 +128,6 @@ async def _(matcher: Matcher, bot: Bot, event: GroupMessageEvent, state: T_State
except ActionFailed:
pass
else:
if not static_flmt.check(event.user_id):
return
static_flmt.start_cd(event.user_id)
try:
await bot.send_private_msg(
user_id=event.user_id,