feat(bot): /tag и /типы — счётчики типов и топ по типу, доступны в read-only режиме; тест (20 passed)
Some checks failed
ci / test (3.10) (push) Has been cancelled
ci / test (3.11) (push) Has been cancelled
ci / test (3.12) (push) Has been cancelled

This commit is contained in:
Vlad Gothbreach
2026-10-26 21:13:18 +03:00
parent eaedd37bcd
commit 74d968ab2d
2 changed files with 36 additions and 3 deletions

View File

@@ -170,3 +170,15 @@ def test_abuse_boost():
a.title, b.title = "leak dump credentials 40M accounts", "weekly product update notes for teams"
a.text = b.text = "x" * 600
assert rank.score(a).score > rank.score(b).score
# ---------- 11. бот: /tag читается без владельца ----------
def test_tag_command_readonly(monkeypatch):
from omni import bot
sent = []
monkeypatch.setattr(bot, "OWNERS", set())
monkeypatch.setattr(bot, "_send", lambda cid, text, **kw: sent.append(text))
bot.handle({"message": {"chat": {"id": 1}, "from": {"id": 1}, "text": "/tag"}})
assert sent and "типы записей" in sent[0], sent[:1]
assert "/tag" in bot.CMDS