Build a Messaging Chatbot
Build an AI chatbot that receives messages on Telegram, Slack, or Discord, processes them with an AI agent, and replies — all in under 5 minutes.
Use the Telegram Chatbot template for a one-click setup: Deploy Template
A workflow that: receives a message → AI Agent processes it with conversation memory → sends a reply back on the same platform.
- A Tensorify account
- A bot token for your platform (Telegram, Slack, or Discord)
- An LLM API key (OpenAI, Anthropic, etc.)
- Open @BotFather on Telegram
- Send
/newbot, follow prompts - Copy the bot token
- Go to api.slack.com/apps → Create New App
- Add Bot Token Scopes:
chat:write,app_mentions:read - Install to workspace, copy Bot Token (xoxb-...)
- Enable Event Subscriptions
- Go to discord.com/developers/applications → New Application
- Go to Bot tab, click "Add Bot"
- Copy the Bot Token
- Create a Webhook URL in your channel
Add the Trigger
Drop a Telegram Trigger (or Slack/Discord Trigger) onto the canvas. Configure your bot token in workspace Env Vars.
Add AI Agent
Connect an AI Agent node. Set:
- Provider: OpenAI (or your preference)
- Model: gpt-4o-mini (fast and cheap for chat)
- System prompt: "You are a helpful assistant on [platform]. Keep responses concise."
- Streaming: off (messaging platforms don't support SSE)
Add Conversation Memory
Drop a Window Memory node and connect it to the Agent's Memory handle. Set:
- Window size: 20 (remembers last 20 messages)
- Persistent: true
- Session key:
{{ telegram.chat_id }}(unique per chat)
Add the Reply Action
Drop a Telegram Send Message (or Slack/Discord Send) node. Configure:
- Chat ID:
{{ telegram.chat_id }} - Text:
{{ ai_agent.choices[0].message.content }} - Parse mode: Markdown
Deploy
Click Deploy → select execution mode. Set the webhook URL in your platform's bot settings.
After deploying, your workflow gets a URL like: https://triggers.tensorify.io/{teamId}/your-path
curl "https://api.telegram.org/bot{YOUR_TOKEN}/setWebhook?url=https://triggers.tensorify.io/{teamId}/{path}"
In your Slack app settings → Event Subscriptions → Request URL, paste the deployment URL.
In your Discord application → General Information → Interactions Endpoint URL.
- Personality: Customize the system prompt for tone (professional, casual, funny)
- Multi-language: Add "Respond in the user's language" to the system prompt
- Error handling: Connect the error branch to a fallback "Sorry, something went wrong" message
- Rate limiting: Keep window size reasonable (10-30) to control costs
- Add tools to the agent (Web Search, HTTP Request) for smarter responses
- Use the Playground to test before going live
- Connect multiple platforms to the same agent workflow
