diff --git a/.env b/.env index 8e50bc5d..06c26cdf 100644 --- a/.env +++ b/.env @@ -1,5 +1,5 @@ # 您不应该修改默认值,这个文件被仓库索引,请修改.env.prod -ENVIRONMENT=dev +ENVIRONMENT=prod # HOST=127.0.0.1 # PORT=8080 diff --git a/config/bot_config.toml b/config/bot_config.toml index 83e0769a..83526945 100644 --- a/config/bot_config.toml +++ b/config/bot_config.toml @@ -1,11 +1,11 @@ [bot] -qq = 3488737411 -nickname = "小千" +qq = 123 +nickname = "麦麦" [message] min_text_length = 2 max_context_size = 15 -emoji_chance = 0.0 +emoji_chance = 0.2 [emoji] check_interval = 120 @@ -29,7 +29,8 @@ enable_advance_output = true [groups] talk_allowed = [ - 583449463 + 123, + 123, ] talk_frequency_down = [] ban_user_id = [] diff --git a/src/plugins/chat/config.py b/src/plugins/chat/config.py index 4ab8e3c1..b90eac42 100644 --- a/src/plugins/chat/config.py +++ b/src/plugins/chat/config.py @@ -28,7 +28,7 @@ class BotConfig: talk_frequency_down_groups = set() ban_user_id = set() - build_memory_interval: int = 600 # 记忆构建间隔(秒) + build_memory_interval: int = 60 # 记忆构建间隔(秒) EMOJI_CHECK_INTERVAL: int = 120 # 表情包检查间隔(分钟) EMOJI_REGISTER_INTERVAL: int = 10 # 表情包注册间隔(分钟) @@ -139,13 +139,6 @@ class BotConfig: others_config = toml_dict["others"] config.enable_advance_output = others_config.get("enable_advance_output", config.enable_advance_output) - # 自定义人设覆盖 - config.PROMPT_PERSONALITY=[ - "是一个计算机系大三女大学生,平时比较文静,喜欢打舞萌dx,你会刷贴吧,偶尔也会像贴吧老哥一样阴阳怪气,你正在浏览qq群", - "是一个计算机系大三女大学生,平时比较文静,喜欢打舞萌dx,你有黑色头发,你会刷小红书, 你正在浏览qq群" - ] - config.PROMPT_SCHEDULE_GEN="一个计算机系大三女大学生,喜欢刷qq,贴吧,知乎和小红书,还喜欢打舞萌dx,经常下午或者晚上去江二打舞萌,睡得比较晚,有时会熬夜" - logger.success(f"成功加载配置文件: {config_path}") diff --git a/src/plugins/chat/topic_identifier.py b/src/plugins/chat/topic_identifier.py index 467c45ea..b0500c43 100644 --- a/src/plugins/chat/topic_identifier.py +++ b/src/plugins/chat/topic_identifier.py @@ -73,7 +73,7 @@ class TopicIdentifier: '按', '按照', '把', '被', '比', '比如', '除', '除了', '当', '对', '对于', '根据', '关于', '跟', '和', '将', '经', '经过', '靠', '连', '论', '通过', '同', '往', '为', '为了', '围绕', '于', '由', '由于', '与', '在', '沿', '沿着', - '依', '依照', '以', '因', '因为', '用', '由', '与', '自', '自从','[]' + '依', '依照', '以', '因', '因为', '用', '由', '与', '自', '自从' } # 过滤掉停用词和标点符号,只保留名词和动词 diff --git a/src/plugins/chat/willing_manager.py b/src/plugins/chat/willing_manager.py index 950d127c..e3574357 100644 --- a/src/plugins/chat/willing_manager.py +++ b/src/plugins/chat/willing_manager.py @@ -58,8 +58,8 @@ class WillingManager: if group_id in config.talk_frequency_down_groups: reply_probability = reply_probability / 3.5 - if is_mentioned_bot and user_id == int(964959351): - reply_probability = 1 + # if is_mentioned_bot and user_id == int(1026294844): + # reply_probability = 1 return reply_probability @@ -72,7 +72,7 @@ class WillingManager: """发送消息后提高群组的回复意愿""" current_willing = self.group_reply_willing.get(group_id, 0) if current_willing < 1: - self.group_reply_willing[group_id] = min(2, current_willing + 0.8) + self.group_reply_willing[group_id] = min(1, current_willing + 0.3) async def ensure_started(self): """确保衰减任务已启动""" diff --git a/src/plugins/memory_system/memory_make.py b/src/plugins/memory_system/memory_make.py index 02c61945..d1757b24 100644 --- a/src/plugins/memory_system/memory_make.py +++ b/src/plugins/memory_system/memory_make.py @@ -142,12 +142,13 @@ class Memory_graph: # 获取该时间戳之后的length条消息,且groupid相同 chat_record = list(self.db.db.messages.find({"time": {"$gt": closest_time}, "group_id": group_id}).sort('time', 1).limit(length)) for record in chat_record: - time_str = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(int(record['time']))) - try: - displayname="[(%s)%s]%s" % (record["user_id"],record["user_nickname"],record["user_cardname"]) - except: - displayname=record["user_nickname"] or "用户" + str(record["user_id"]) - chat_text += f'[{time_str}] {displayname}: {record["processed_plain_text"]}\n' # 添加发送者和时间信息 + if record: + time_str = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(int(record['time']))) + try: + displayname="[(%s)%s]%s" % (record["user_id"],record["user_nickname"],record["user_cardname"]) + except: + displayname=record["user_nickname"] or "用户" + str(record["user_id"]) + chat_text += f'[{time_str}] {displayname}: {record["processed_plain_text"]}\n' # 添加发送者和时间信息 return chat_text return [] # 如果没有找到记录,返回空列表