Compare commits

..

4 Commits

Author SHA1 Message Date
afda0680ec 调整衰减函数
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2025-10-24 01:59:41 +08:00
021133954e 调整 man 默认范围
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2025-10-24 01:33:59 +08:00
7baa04dbc2 添加罗文提示 2025-10-24 01:33:01 +08:00
e55bdbdf4a 怪话不可为空!!!
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2025-10-24 01:27:40 +08:00
4 changed files with 13 additions and 3 deletions

View File

@ -0,0 +1,2 @@
关于罗文和洛温:
AdoreLowen 希望和洛温阿特金森区分,所以最好就不要叫他洛温了!此方 BOT 会在一些群提醒叫错了的人。

View File

@ -31,7 +31,7 @@ evt_collector = on_message(rule=is_collect_target)
@evt_collector.handle()
async def _(msg: UniMsg):
txt = msg.extract_plain_text()
if len(txt) > 50:
if len(txt) > 50 or not txt.strip():
return
if txt.startswith("说点怪话") or txt.startswith("说些怪话") or txt.startswith("怪话过滤"):
return

View File

@ -1,10 +1,17 @@
import base64
import math
import random
import time
from pathlib import Path
def dec_func(t: float) -> float:
if t < 86400:
return 0.5 * (1 + math.tanh(t / 43200 - 1))
return math.exp(-0.00000043 * (t - 86400))
class RandomTextManager:
_cache: list[tuple[float, str]]
@ -55,7 +62,8 @@ class RandomTextManager:
for ts, cn in self._cache:
contents.append(cn)
weights.append((abs(now - ts) + 0.01) ** (-1))
# weights.append((abs(now - ts) + 0.01) ** (-1))
weights.append(dec_func(now - ts))
return random.choices(contents, weights)[0]

View File

@ -53,7 +53,7 @@ async def _(
if doc is None:
# 检索模式
if section is None:
section_set = {1}
section_set = {1, 7}
else:
section_set = {section}
if 1 in section_set and is_admin(event):