创建新分支feature
This commit is contained in:
2
.env
2
.env
@@ -1,5 +1,5 @@
|
||||
# 您不应该修改默认值,这个文件被仓库索引,请修改.env.prod
|
||||
ENVIRONMENT=dev
|
||||
ENVIRONMENT=prod
|
||||
# HOST=127.0.0.1
|
||||
# PORT=8080
|
||||
|
||||
|
||||
@@ -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 = []
|
||||
|
||||
@@ -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}")
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@ class TopicIdentifier:
|
||||
'按', '按照', '把', '被', '比', '比如', '除', '除了', '当', '对', '对于',
|
||||
'根据', '关于', '跟', '和', '将', '经', '经过', '靠', '连', '论', '通过',
|
||||
'同', '往', '为', '为了', '围绕', '于', '由', '由于', '与', '在', '沿', '沿着',
|
||||
'依', '依照', '以', '因', '因为', '用', '由', '与', '自', '自从','[]'
|
||||
'依', '依照', '以', '因', '因为', '用', '由', '与', '自', '自从'
|
||||
}
|
||||
|
||||
# 过滤掉停用词和标点符号,只保留名词和动词
|
||||
|
||||
@@ -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):
|
||||
"""确保衰减任务已启动"""
|
||||
|
||||
@@ -142,6 +142,7 @@ 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:
|
||||
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"])
|
||||
|
||||
Reference in New Issue
Block a user