Skip to content

The moment it happens

Send error alerts to Discord and Telegram

When a job or system fails, your team sees the details in Discord and you get them on Telegram, wherever you are.

Runs
The moment it happens
Apps
Discord, Telegram
AI
Not needed
Access
send messages in both

Send this to your assistant

Create a ClickRuntime automation: when my app posts an error to this link, send the details to my Discord ops channel and to me on Telegram, and count errors per day.

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 small team runs a web app with background jobs for billing, imports and email. When a job fails, the error goes to a log nobody reads in real time. The team coordinates in Discord, but the lead developer is often away from her desk and only reliably checks Telegram on her phone. Failures are found the next morning, after customers have noticed.

Sending each error to both places means the team can see it in their shared channel and the person on call gets it on their phone, with a daily count that shows whether things are getting better or worse.

What you get out of it

  • Failures are noticed in minutes

    An error message arrives the moment your app reports it. Problems are fixed before they spread to more customers.

  • The team and the on-call person both see it

    Discord gives the whole team context and a place to discuss. Telegram reaches the person who needs to act, even away from a computer.

  • The details you need to start

    Each alert includes the job name, the error message and the time. Whoever picks it up can start investigating without digging through logs first.

  • A daily error count

    Errors are counted per day, so each alert shows how many have come in today. A sudden jump is obvious at a glance.

  • Works with any error source

    Anything that can send a web request when it fails can use the link: your app, a cron job, a CI pipeline or a monitoring tool.

How it works

What happens, step by step

  1. When your app or job reports an error to your trigger link, ClickRuntime receives it straight away.

  2. It writes a short alert with the job name, the error and the time.

  3. It adds one to today's error count and includes the running total in the alert.

  4. The alert is posted to your Discord ops channel and sent to you on Telegram.

Before it runs live

  • Connect Discord
  • Connect Telegram
  • Paste your automation's link into the other app's webhook settings

What you get

RunsThe moment it happens
Send error alerts to Discord and Telegramjust nowSucceeded
Telegram · Ops bot🚨 nightly-invoice-export failed: connection to billing database timed out. Errors today: 3

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
  • Add an AI step, for example to summarize, sort or draft a reply
  • Add another app, for example also send it to Slack
  • Combine it with other Discord 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.
error_alerts_to_both_chats.pyexample
from clickruntime import on_event, credentials, http, state

DISCORD_CHANNEL_ID = "your-discord-channel-id"
TELEGRAM_CHAT_ID = "your-telegram-chat-id"

@on_event
def handle(event):
    e = event.json or {}
    state.increment_metric("errors", ttl_days=30)
    points = state.query_metric("errors")
    today = points[-1]["value"] if points else 1
    text = f"🚨 {e.get('job', 'Unknown job')} failed\n{str(e.get('error', 'No details'))[:1500]}\nErrors today: {today}"
    http.post(f"https://discord.com/api/v10/channels/{DISCORD_CHANNEL_ID}/messages",
              headers={"Authorization": f"Bot {credentials.secret('DISCORD_BOT_TOKEN')}"}, json={"content": text})
    http.post(f"https://api.telegram.org/bot{credentials.secret('TELEGRAM_BOT_TOKEN')}/sendMessage",
              json={"chat_id": TELEGRAM_CHAT_ID, "text": text})
    return {"sent": True}

FAQ

Common questions

What should my app send?
A short JSON message with at least a title or job name and the error text. Extra fields such as environment or a link to the logs are included in the alert if present.
Will a burst of errors flood my phone?
Each error is sent as it arrives. If a single failure can fire many times, you can have repeats of the same message within a few minutes combined into one alert.
Can I send alerts to a Telegram group instead of just me?
Yes. Add your bot to the group and use the group's chat ID. The whole group then receives the same alerts as Discord.
What permissions does it need?
send messages in both. Nothing else in your accounts is used.
Does it need AI?
No. It runs without AI, so it doesn't use your plan's 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 “Send error alerts to Discord and Telegram” from your assistant

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