feat: Add new handlers for /deb and /city commands, and a general activity tracker.

This commit is contained in:
2569718930@qq.com
2026-03-14 21:47:21 +08:00
parent 530080a75d
commit 1c57a6f56e
3 changed files with 59 additions and 3 deletions
+21 -1
View File
@@ -11,8 +11,28 @@ from src.bot.services.deb_command_service import DebCommandService
from src.bot.settings import DEB_QUERY_COST
def _normalized_command_head(text: str | None) -> str:
raw = str(text or "")
for marker in (
"\ufeff",
"\u200b",
"\u200c",
"\u200d",
"\u2060",
"\u2066",
"\u2067",
"\u2068",
"\u2069",
):
raw = raw.replace(marker, "")
raw = raw.strip()
if raw.startswith(""):
raw = "/" + raw[1:]
return raw.split(maxsplit=1)[0].lower() if raw else ""
def _is_deb_command_text(text: str | None) -> bool:
head = str(text or "").strip().split(maxsplit=1)[0].lower()
head = _normalized_command_head(text)
return head == "/deb" or head.startswith("/deb@")