- hexi core: message handling, rate limiting, cooldown, plugin manager - Custom plugins: BF stats, daily check-in, quotes, persona cards, etc. - Community plugins vendored under hexi/plugins with local fixes - Web admin frontends (learning-chat, persona-admin), unified hexi/web - Tests for rate_limit/cooldown/memes/persona; poetry.lock Co-Authored-By: Claude <noreply@anthropic.com>
14 lines
443 B
Python
14 lines
443 B
Python
from nonebot.adapters.onebot.v11 import GroupMessageEvent
|
|
|
|
|
|
def get_at_id(ev: GroupMessageEvent) -> int | None:
|
|
"""提取消息中第一个被 at 的用户(排除 at all)"""
|
|
for m in ev.message:
|
|
if m.type == "at" and m.data.get("qq") != "all":
|
|
return int(m.data["qq"])
|
|
return None
|
|
|
|
|
|
def has_at_all(ev: GroupMessageEvent) -> bool:
|
|
return any(m.type == "at" and m.data.get("qq") == "all" for m in ev.message)
|