@@ -6,9 +6,6 @@ | |||||
""" | """ | ||||
# -*- coding=utf-8 -*- | # -*- coding=utf-8 -*- | ||||
import io | |||||
import os | |||||
import time | |||||
import uuid | import uuid | ||||
import requests | import requests | ||||
@@ -188,9 +185,12 @@ class FeishuController: | |||||
is_group = False | is_group = False | ||||
chat_type = msg.get("chat_type") | chat_type = msg.get("chat_type") | ||||
if chat_type == "group": | if chat_type == "group": | ||||
if not msg.get("mentions"): | |||||
if not msg.get("mentions") and msg.get("message_type") == "text": | |||||
# 群聊中未@不响应 | # 群聊中未@不响应 | ||||
return self.SUCCESS_MSG | return self.SUCCESS_MSG | ||||
if msg.get("mentions")[0].get("name") != conf().get("feishu_bot_name") and msg.get("message_type") == "text": | |||||
# 不是@机器人,不响应 | |||||
return self.SUCCESS_MSG | |||||
# 群聊 | # 群聊 | ||||
is_group = True | is_group = True | ||||
receive_id_type = "chat_id" | receive_id_type = "chat_id" | ||||
@@ -118,9 +118,10 @@ available_setting = { | |||||
# 飞书配置 | # 飞书配置 | ||||
"feishu_port": 80, # 飞书bot监听端口 | "feishu_port": 80, # 飞书bot监听端口 | ||||
"feishu_app_id": "", | |||||
"feishu_app_secret": "", | |||||
"feishu_token": "", | |||||
"feishu_app_id": "", # 飞书机器人应用APP Id | |||||
"feishu_app_secret": "", # 飞书机器人APP secret | |||||
"feishu_token": "", # 飞书 verification token | |||||
"feishu_bot_name": "", # 飞书机器人的名字 | |||||
# chatgpt指令自定义触发词 | # chatgpt指令自定义触发词 | ||||
"clear_memory_commands": ["#清除记忆"], # 重置会话指令,必须以#开头 | "clear_memory_commands": ["#清除记忆"], # 重置会话指令,必须以#开头 | ||||