From 16838e0d83c8dd3f1be1e6ec5fb1cecd9b319d8a Mon Sep 17 00:00:00 2001 From: Kyomotoi Date: Sun, 24 Oct 2021 16:47:29 +0800 Subject: =?UTF-8?q?=F0=9F=94=96=20=E6=9B=B4=E6=96=B0=E7=89=88=E6=9C=AC?= =?UTF-8?q?=EF=BC=9AYHN-001-A04?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 新增: - nsfw检测(主动/被动) 又名 涩图嗅探 - 可选代理 修复: - plugin/chat 在 nb2-a14+ 版本 finish 内为空时会报错 其他: - 对定时任务进行中文命名 --- ATRI/plugins/chat/__init__.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'ATRI/plugins/chat') diff --git a/ATRI/plugins/chat/__init__.py b/ATRI/plugins/chat/__init__.py index 9f7f26c..ab22db9 100644 --- a/ATRI/plugins/chat/__init__.py +++ b/ATRI/plugins/chat/__init__.py @@ -26,7 +26,10 @@ async def _chat(bot: Bot, event: MessageEvent): msg = str(event.message) repo = await Chat().deal(msg, user_id) _chat_flmt.start_cd(user_id) - await chat.finish(repo) + try: + await chat.finish(repo) + except Exception: + return my_name_is = Chat().on_command("叫我", "更改闲聊(划掉 文爱)时的称呼", aliases={"我是"}, priority=1) @@ -111,7 +114,7 @@ async def _deal_say(bot: Bot, event: MessageEvent, state: T_State): await say.finish(msg) -@scheduler.scheduled_job("interval", hours=3, misfire_grace_time=60) +@scheduler.scheduled_job("interval", name="闲聊词库检查更新", hours=3, misfire_grace_time=60) async def _check_kimo(): try: await Chat().update_data() -- cgit v1.2.3