Skip to content

The moment it happens

Answer Telegram bot messages and escalate urgent ones to Slack

Every message to your Telegram bot gets an instant reply, and complaints or urgent requests are posted to your Slack support channel.

Runs
The moment it happens
Apps
Slack, Telegram
AI
Yes, uses the built-in AI allowance
Access
Telegram bot token; Slack chat:write

Send this to your assistant

Create a ClickRuntime automation: when someone messages my Telegram bot, classify the request with AI, reply with an acknowledgment, and post complaints or urgent ones to #support in Slack.

Paste it into your assistant. It tells you what it will send or change before it runs live.

First time? Adding ClickRuntime to your assistant takes about two minutes.

Why use it

Why teams use this automation

A delivery business lets customers contact it through a Telegram bot, but the bot only collects messages. Staff check them a few times a day, so a customer whose order went to the wrong address waits hours for any sign that someone saw it, and routine questions take up the same attention as real problems.

Replying to everyone right away and pushing only the urgent messages into Slack lets the team spend its time where it matters, while every customer knows their message arrived.

What you get out of it

  • Every customer gets a reply

    Each message gets an acknowledgment within seconds, matched to what they asked. Customers stop sending the same question three times.

  • Urgent problems reach staff fast

    Complaints and urgent requests are posted in #support as they arrive. The team handles them first instead of finding them in a long queue.

  • Routine questions stay out of Slack

    Simple questions are acknowledged without pulling anyone in. The support channel only shows what needs a person.

  • Context travels with the alert

    The Slack post includes the customer's message and the category. Whoever picks it up knows what they are dealing with before replying.

How it works

What happens, step by step

  1. When someone messages your Telegram bot, Telegram passes the message to ClickRuntime straight away.

  2. AI reads the message and decides its category, whether it is urgent, and a short reply.

  3. The customer gets that reply in Telegram within seconds.

  4. Complaints and urgent messages are posted to your #support Slack channel, once per conversation.

Before it runs live

  • Connect Slack, then invite the app to the channel (type /invite @ClickRuntime there)
  • Connect Telegram
  • Paste your automation's link into the other app's webhook settings

What you get

RunsThe moment it happens
Answer Telegram bot messages and escalate urgent ones to Slackjust nowSucceeded
Slack · #supportWrong delivery from Priya (chat 5521): "My Northwind order was left at the wrong building and I need it today."

Build your own

Need it to work differently?

This template is a starting point. Copy the prompt and change it, or describe a different automation from scratch, with your own conditions, more apps or an AI step. Your assistant writes it, tests it and runs it on ClickRuntime.
  • Your own rules

    Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.

  • Any number of apps

    One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.

  • AI where it helps

    Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.

  • On a schedule or on each event

    Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.

Changes you can ask for

  • Act only on the items that match your own rules, and skip the rest
  • Change what the AI looks for, or how it writes the result
  • Add another app, for example also send it to Google Sheets
  • Combine it with other Slack and Telegram steps into one automation

Under the hood

The code that runs this automation

This is the Python script that runs each time the automation starts. Your AI assistant writes it for you when you send the prompt, and you allow each step in your assistant. To change how the automation works, describe the change to your assistant and it updates the script for you. For every function it can use, see the script reference.
telegram_bot_intake_with_slack_escalation.pyexample
from slack_sdk import WebClient
from clickruntime import on_event, credentials, http, state, ai

SCHEMA = {"type": "object", "properties": {"category": {"type": "string"}, "urgent": {"type": "boolean"}, "reply": {"type": "string"}}}

@on_event
def handle(event):
    msg = (event.json or {}).get("message") or {}
    text, chat = msg.get("text"), (msg.get("chat") or {}).get("id")
    if not text or not chat:
        return {"skipped": "no text"}
    try:
        out = ai.generate(f"Customer message to a delivery company:\n{text[:2000]}\nGive category, urgent (complaint or time-critical), and a short polite reply.",
                          max_output_tokens=200, json_schema=SCHEMA).json
    except ai.AIError:
        out = {"category": "unknown", "urgent": True, "reply": "Thanks, we got your message and a person will reply shortly."}
    http.post(f"https://api.telegram.org/bot{credentials.secret('TELEGRAM_BOT_TOKEN')}/sendMessage", json={"chat_id": chat, "text": out["reply"]})
    key = f"escalated:{chat}"
    if out["urgent"] and not state.get(key):
        who = (msg.get("from") or {}).get("first_name", "Customer")
        WebClient(token=credentials.connection("slack", "work")).chat_postMessage(
            channel="#support", text=f":rotating_light: {out['category']} from {who} (chat {chat}):\n> {text[:1000]}")
        state.set(key, msg.get("date"))
    return {"category": out["category"], "urgent": out["urgent"]}

FAQ

Common questions

How does the team reply to the customer?
Staff reply from the Telegram bot's chat or a tool connected to it, using the chat details included in the Slack message. The automation handles the first acknowledgment only.
What counts as urgent?
Complaints, safety issues, failed or wrong deliveries, and anything the customer marks as urgent. You can describe your own rules in plain words when setting it up.
Does it remember earlier messages from the same customer?
It keeps a short note of each chat's recent messages. That helps it avoid escalating the same issue twice when a customer writes several messages in a row.
What permissions does it need?
Telegram bot token; Slack chat:write. Nothing else in your accounts is used.
Does it need AI?
Yes. It uses ClickRuntime's built-in AI, so you don't need an OpenAI or Anthropic key. Every plan includes a monthly AI allowance.
How many runs does it use?
One run for each event the app sends.
Can I change how it works?
Yes. Describe the change to your AI assistant, for example a different schedule, channel or filter. It updates the automation, tests it and tells you what changed.

Set up “Answer Telegram bot messages and escalate urgent ones to Slack” from your assistant

Copy the prompt above, or connect your assistant first. Free plan, no credit card.