summaryrefslogtreecommitdiff
path: root/ATRI/plugins/chat/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'ATRI/plugins/chat/__init__.py')
-rw-r--r--ATRI/plugins/chat/__init__.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/ATRI/plugins/chat/__init__.py b/ATRI/plugins/chat/__init__.py
index ab22db9..7436645 100644
--- a/ATRI/plugins/chat/__init__.py
+++ b/ATRI/plugins/chat/__init__.py
@@ -7,7 +7,7 @@ from ATRI.utils import CoolqCodeChecker
from ATRI.utils.limit import FreqLimiter
from ATRI.utils.apscheduler import scheduler
from .data_source import Chat
-
+from ATRI.plugins.atri_chat_bot import ATRIChatBot
_chat_flmt = FreqLimiter(3)
_chat_flmt_notice = choice(["慢...慢一..点❤", "冷静1下", "歇会歇会~~", "我开始为你以后的伴侣担心了..."])
@@ -27,7 +27,10 @@ async def _chat(bot: Bot, event: MessageEvent):
repo = await Chat().deal(msg, user_id)
_chat_flmt.start_cd(user_id)
try:
- await chat.finish(repo)
+ if repo:
+ await chat.finish(repo)
+ else: # 实在没话说就尝试 chatterbot
+ await chat.finish(await ATRIChatBot.get_response(msg))
except Exception:
return