The moment it happens
Run one support bot on WhatsApp and Telegram
Customers get the same answers whether they message your WhatsApp number or your Telegram bot, and questions the bot can't answer come to you.
- Runs
- The moment it happens
- Apps
- Telegram, WhatsApp Business
- AI
- Yes, uses the built-in AI allowance
- Access
- whatsapp_business_messaging; bot token
Send this to your assistant
Create a ClickRuntime automation: when a customer messages my WhatsApp number or my Telegram bot, answer from my FAQ text on the same app, and forward anything you can't answer to my Telegram chat.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
A business with customers in several countries finds some prefer WhatsApp and others Telegram. Keeping two sets of answers in sync, and watching two inboxes, doubles the work for the same questions.
One bot with one set of answers serves both apps, so every customer gets the same reply, and anything that needs a person is forwarded to one place for you to handle.
What you get out of it
One set of answers
Update the FAQ once and both apps use it.
Customers use the app they like
Nobody has to install something new to reach you.
One place for escalations
Questions the bot can't answer all arrive in your Telegram chat.
Replies on the same app
Customers always get their answer where they asked.
How it works
What happens, step by step
A customer messages your WhatsApp number or your Telegram bot.
The message is recognised as WhatsApp or Telegram and turned into the same simple format.
AI answers from your FAQ text, or flags that a person is needed.
The answer goes back on the same app, and anything flagged is forwarded to your Telegram chat.
Before it runs live
- Connect Telegram
- Connect WhatsApp Business
- Paste your automation's link into the other app's webhook settings
What you get
Build your own
Need it to work differently?
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 Slack
- Combine it with other Telegram and WhatsApp Business steps into one automation
Under the hood
The code that runs this automation
from clickruntime import on_event, credentials, http, ai
FAQ = "Open 9-6 CET. Shipping EU 3-5 days. Returns within 30 days."
OWNER_CHAT = 123456789
WA = "https://graph.facebook.com/v20.0/your-phone-number-id/messages"
def wa(to, text):
http.post(WA, headers={"Authorization": f"Bearer {credentials.secret('WHATSAPP_TOKEN')}"},
json={"messaging_product": "whatsapp", "to": to, "type": "text", "text": {"body": text}}).raise_for_status()
TG = "https://api.telegram.org"
def tg(chat_id, text):
http.post(f"{TG}/bot{credentials.secret('TELEGRAM_BOT_TOKEN')}/sendMessage", json={"chat_id": chat_id, "text": text})
@on_event
def handle(event):
body = event.json or {}
if "message" in body:
chats = [("tg", body["message"]["chat"]["id"], body["message"].get("text", ""))]
else:
msgs = [m for e in body.get("entry", []) for c in e["changes"] for m in c["value"].get("messages", []) if m["type"] == "text"]
chats = [("wa", m["from"], m["text"]["body"]) for m in msgs]
for app, who, text in chats:
answer = ai.generate(text[:1500], max_output_tokens=200,
system=f"Answer briefly from these facts: {FAQ}. If you can't, reply exactly ESCALATE.").text.strip()
if answer == "ESCALATE":
answer = "Thanks, a person from our team will reply here shortly."
tg(OWNER_CHAT, f"Needs a person ({app} {who}): {text[:500]}")
wa(who, answer) if app == "wa" else tg(who, answer)
return {"handled": len(chats)}FAQ
Common questions
Can I reply to escalated customers?
Where is the FAQ kept?
Do I need two trigger links?
What permissions does it need?
Does it need AI?
How many runs does it use?
Can I change how it works?
Related
You might also like
Send error alerts to WhatsApp and Telegram
When a job fails, you get an alert on both WhatsApp and Telegram, with repeats held back.
See how it worksGet new sales on Telegram and WhatsApp
Every new sale or order pings you on both Telegram and WhatsApp with the amount and what was bought.
See how it worksGet filtered job, news or market alerts on Telegram and WhatsApp
Every hour new items from your feeds are filtered for what you care about and the matches arrive on Telegram and WhatsApp.
See how it worksKeep exploring
Set up “Run one support bot on WhatsApp and Telegram” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.