Overview & result
A grammY Telegram bot asks Jev bounded spam questions for each eligible group message, deletes only high-confidence matches, and leaves messages untouched if Jev or Telegram is unavailable. Admin and linked-channel exemptions are explicit.
From the original post
asks TypeSafe's Jev model whether each group message is spam and deletes only high-confidence matches.
How Jev fits in the loop
- Collect message text or caption plus eligible sender metadata and recent context.
- Ask Jev a batch of spam questions and compare probabilities to the configured deletion gate.
- Let the Telegram bot delete only qualifying messages and log the moderation outcome; fail open on unavailable services.
How to reproduce
- Clone the public repository, configure `TELEGRAM_BOT_TOKEN` and `TYPESAFE_API_KEY`, and disable Telegram privacy mode.
- Run `bun install` and `bun run check`; use a test group with Delete messages permission before production.
- Observe high-confidence deletion decisions and verify that Jev/Telegram failures leave messages untouched.
Why this build matters
A concrete guardrail case with explicit confidence policy, exemptions and fail-open behavior rather than an unbounded model moderation prompt.
Limitations
- A high-confidence gate is not a measured false-positive rate; live model regression tests require opt-in keys.
- Jev only receives text and captions; media without a caption is not classified.