Telegram anti-spam bot

Read each new group message and decide: keep it, delete it, or delete it and ban.

The new message

Hi everyone 👋 I made $4,800 this week with a simple USDT arbitrage method, no experience needed. DM me for the free guide, only 10 spots left!

Verdict

spam

Category

crypto

Reason

Crypto arbitrage offer, DM request, limited spots

Action

delete_and_ban

Elapsed–

Cost$0.0001

Recorded run, replayed faster than it ran.

$0.0001this recorded run's cost

  • 1 message≈ $0.0001

Forking copies the step into your dashboard. You change the input, press Run, and each call is billed to your balance.

Build it yourself

Each step is one request to the Hyperouter API with your key. A later step reads an earlier one's output through {{steps.<id>…}}, and your inputs through {{vars.<name>}}. Models: deepseek/deepseek-v4.1-flash.

The request
  1. Judge the message

    POST /v1/chat/completionsdeepseek/deepseek-v4.1-flashText · ≤ 300 tokens

    {
      "model": "deepseek/deepseek-v4.1-flash",
      "messages": [
        {
          "role": "system",
          "content": "You moderate a Telegram group. Read the group's rules and one new message, and decide whether the message is spam. Spam is advertising, selling, referral or affiliate links, crypto and investment offers, fake giveaways, adult content, and anyone asking members to DM them for money. A question, a complaint or an off-topic chat is not spam. Answer with one JSON object whose values are all strings: verdict (spam or ok), category (advertising, scam, crypto, adult, recruiting or none), reason (at most 12 words), action (delete_and_ban for clear spam, delete when unsure, keep for ok)."
        },
        {
          "role": "user",
          "content": "Group rules:\n{{vars.rules}}\n\nNew message:\n{{vars.message}}"
        }
      ],
      "response_format": {
        "type": "json_object"
      },
      "reasoning_effort": "none",
      "max_tokens": 300
    }
Run the whole pipeline from code
SYSTEM="You moderate a Telegram group. Read the group's rules and one new message, and decide whether the message is spam. Spam is advertising, selling, referral or affiliate links, crypto and investment offers, fake giveaways, adult content, and anyone asking members to DM them for money. A question, a complaint or an off-topic chat is not spam. Answer with one JSON object whose values are all strings: verdict (spam or ok), category (advertising, scam, crypto, adult, recruiting or none), reason (at most 12 words), action (delete_and_ban for clear spam, delete when unsure, keep for ok)."
RULES='A group for developers who use the Hyperouter API. On topic: questions, bugs, code and model results. Not allowed: advertising, selling, referral links, crypto or investment offers.'
MESSAGE='Hi everyone 👋 I made $4,800 this week with a simple USDT arbitrage method, no experience needed. DM me for the free guide, only 10 spots left!'

jq -n --arg s "$SYSTEM" --arg u "Group rules:
$RULES

New message:
$MESSAGE" \
  '{model:"deepseek/deepseek-v4.1-flash", max_tokens:300, reasoning_effort:"none", response_format:{type:"json_object"}, messages:[{role:"system",content:$s},{role:"user",content:$u}]}' |
curl -s https://api.hyperouter.app/v1/chat/completions -H "Authorization: Bearer $HYPEROUTER_API_KEY" -H 'Content-Type: application/json' -d @- |
jq -r '.choices[0].message.content'

Run Telegram anti-spam bot on your account

Read each new group message and decide: keep it, delete it, or delete it and ban. Fork it, change the input, and run it from the dashboard: ≈ $0.0001 per run at the default settings.