Update willing_manager.py
1
This commit is contained in:
@@ -11,7 +11,6 @@ class WillingManager:
|
|||||||
while True:
|
while True:
|
||||||
await asyncio.sleep(3)
|
await asyncio.sleep(3)
|
||||||
for group_id in self.group_reply_willing:
|
for group_id in self.group_reply_willing:
|
||||||
# 每分钟衰减10%的回复意愿
|
|
||||||
self.group_reply_willing[group_id] = max(0, self.group_reply_willing[group_id] * 0.6)
|
self.group_reply_willing[group_id] = max(0, self.group_reply_willing[group_id] * 0.6)
|
||||||
|
|
||||||
def get_willing(self, group_id: int) -> float:
|
def get_willing(self, group_id: int) -> float:
|
||||||
@@ -26,13 +25,7 @@ class WillingManager:
|
|||||||
"""改变指定群组的回复意愿并返回回复概率"""
|
"""改变指定群组的回复意愿并返回回复概率"""
|
||||||
current_willing = self.group_reply_willing.get(group_id, 0)
|
current_willing = self.group_reply_willing.get(group_id, 0)
|
||||||
|
|
||||||
print(f"初始意愿: {current_willing}")
|
# print(f"初始意愿: {current_willing}")
|
||||||
|
|
||||||
# if topic and current_willing < 1:
|
|
||||||
# current_willing += 0.2
|
|
||||||
# elif topic:
|
|
||||||
# current_willing += 0.05
|
|
||||||
|
|
||||||
if is_mentioned_bot and current_willing < 1.0:
|
if is_mentioned_bot and current_willing < 1.0:
|
||||||
current_willing += 0.9
|
current_willing += 0.9
|
||||||
print(f"被提及, 当前意愿: {current_willing}")
|
print(f"被提及, 当前意愿: {current_willing}")
|
||||||
@@ -57,11 +50,10 @@ class WillingManager:
|
|||||||
|
|
||||||
if group_id in config.talk_frequency_down_groups:
|
if group_id in config.talk_frequency_down_groups:
|
||||||
reply_probability = reply_probability / 3.5
|
reply_probability = reply_probability / 3.5
|
||||||
|
|
||||||
# if is_mentioned_bot and user_id == int(1026294844):
|
|
||||||
# reply_probability = 1
|
|
||||||
|
|
||||||
reply_probability = min(reply_probability, 1)
|
reply_probability = min(reply_probability, 1)
|
||||||
|
if reply_probability < 0.1:
|
||||||
|
reply_probability = 0.1
|
||||||
return reply_probability
|
return reply_probability
|
||||||
|
|
||||||
def change_reply_willing_sent(self, group_id: int):
|
def change_reply_willing_sent(self, group_id: int):
|
||||||
|
|||||||
Reference in New Issue
Block a user