Files
sansenhoshiandClaude b61d09f09f Add HeXi bot codebase: custom plugins, web frontends, tests
- 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>
2026-09-01 13:13:40 +08:00

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)