From 5fc58123bb90f3f504ffd33051861d8b4246cc27 Mon Sep 17 00:00:00 2001 From: Soulter <37870767+Soulter@users.noreply.github.com> Date: Mon, 22 May 2023 19:31:24 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E9=A2=91=E7=8E=87?= =?UTF-8?q?=E9=99=90=E5=88=B6=E6=B6=88=E6=81=AF=E8=AF=86=E5=88=AB=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 --- cores/qqbot/core.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/cores/qqbot/core.py b/cores/qqbot/core.py index 4764ae8db..e93fe7135 100644 --- a/cores/qqbot/core.py +++ b/cores/qqbot/core.py @@ -477,11 +477,6 @@ def oper_msg(message, nick_qq = (nick_qq,) if isinstance(nick_qq, list): nick_qq = tuple(nick_qq) - - # 检查发言频率 - if not check_frequency(user_id): - send_message(platform, message, f'你的发言超过频率限制(╯▔皿▔)╯。\n管理员设置{frequency_time}秒内只能提问{frequency_count}次。', msg_ref=msg_ref, gocq_loop=gocq_loop, qqchannel_bot=qqchannel_bot, gocq_bot=gocq_bot) - return if platform == PLATFORM_QQCHAN: gu.log(f"收到消息:{message.content}", gu.LEVEL_INFO, tag="QQ频道") @@ -548,6 +543,12 @@ def oper_msg(message, if qq_msg == "": send_message(platform, message, f"Hi~", msg_ref=msg_ref, gocq_loop=gocq_loop, qqchannel_bot=qqchannel_bot, gocq_bot=gocq_bot) return + + if with_tag: + # 检查发言频率 + if not check_frequency(user_id): + send_message(platform, message, f'你的发言超过频率限制(╯▔皿▔)╯。\n管理员设置{frequency_time}秒内只能提问{frequency_count}次。', msg_ref=msg_ref, gocq_loop=gocq_loop, qqchannel_bot=qqchannel_bot, gocq_bot=gocq_bot) + return # logf.write("[GOCQBOT] "+ qq_msg+'\n') # logf.flush() @@ -802,7 +803,7 @@ class gocqClient(): @gocq_app.receiver("GuildMessage") async def _(app: CQHTTP, source: GuildMessage): - gu.log(str(source), gu.LEVEL_INFO, max_len=9999) + # gu.log(str(source), gu.LEVEL_INFO, max_len=9999) if isinstance(source.message[0], Plain): # if source.message[0].text.startswith(nick_qq):