Telegram Integration

Telegram integration lets your Narakim bots receive messages and commands from Telegram users, and take actions like sending messages, photos, and documents. Telegram setup is simpler than Discord or Slack — you only need a single token from @BotFather.

Prerequisites

  1. Open Telegram and search for @BotFather.
  2. Send /newbot and follow the prompts to name your bot and choose a username.
  3. BotFather will give you an API Token in the format 123456789:ABCdef.... Copy it.

That's it — no app registration, no portal, no OAuth scopes.


Connecting Telegram

  1. Go to Bot Dossier → Configurations → Connect Platform.
  2. Select Telegram from the platform list.
  3. Select integration level Bot Level.
  4. Enter your Bot Token from @BotFather.
  5. Click Connect.

Narakim will register a webhook with Telegram and verify the connection. Once connected, all Telegram extensions appear in your bot's Node Palette.

info

Integration Level: Telegram connections use Bot Level — the automation operates as your Telegram bot's identity, a completely separate account from you. Account Level integration (operating as your personal Telegram account) is coming soon.


Trigger Extensions

Studio nameExtension keyFires whenKey outputs
Messagetelegram_messageUser sends a messagetext, from, chat, message_id, date
Commandtelegram_command/command with optional argscommand, args, from, chat, message_id
Callback Querytelegram_callback_queryInline keyboard button presseddata, from, message, callback_query_id
Inline Querytelegram_inline_queryUser queries bot in inline modequery, from, inline_query_id
Chat Member Updatedtelegram_chat_member_updatedMember join/leave/promotemember update payload
Message Reactiontelegram_message_reactionReaction on a messagereaction payload
Chat Join Requesttelegram_chat_join_requestUser requests to joinjoin request payload

Action Extensions

Studio nameExtension keyDescription
Send Messagetelegram_send_messageText to chatId (use chat.id from trigger)
Send Phototelegram_send_photoPhoto + optional caption
Send Documenttelegram_send_documentFile/document upload
Edit Messagetelegram_edit_messageEdit by chatId + messageId
Delete Messagetelegram_delete_messageDelete by chatId + messageId
Answer Callback Querytelegram_answer_callback_queryRequired after callback — dismisses loading spinner
Send Inline Keyboardtelegram_send_inline_keyboardMessage with inline keyboard buttons
Ban Usertelegram_ban_userBan from chat
Unban Usertelegram_unban_userRemove ban
Restrict Membertelegram_restrict_memberLimit member permissions
Pin Messagetelegram_pin_messagePin in chat
Unpin Messagetelegram_unpin_messageUnpin
Get Chat Member Counttelegram_get_chat_member_countMember count for chat

Full catalog for AI agents: platform-extensions-reference.md (Telegram section).


Required Secrets

Secret KeyDescription
TELEGRAM_BOT_TOKENYour bot token from @BotFather (123456789:ABCdef...)

Configure this in Bot Dossier → Configurations → Extension Secrets.


Common Patterns

Command → AI → Reply

[Command Trigger (/ask)] → [OpenRouter AI] → [Send Message]

Map args from the Command trigger to the AI's message input. Map the AI's response to Send Message's text. Use chat.id from the trigger for the chatId.

Message → If Condition → Different Responses

[Message] → [If Condition: text contains "hello"] → [Send Message: "Hi there!"]
                                                   → [Send Message: "I didn't understand that."]

Inline Button → Acknowledge → Action

[Callback Query] → [Answer Callback Query] → [Send Message]

Always call Answer Callback Query immediately to dismiss the loading spinner on the button. Then send your follow-up message.


Tips

  • Commands vs. Messages: Use the Command trigger for /slash commands and the Message trigger for free-form text.
  • chat.id vs. from.id: Use chat.id to reply in the same conversation. Use from.id to send a private message to the user.
  • Inline keyboards: Set up inline keyboard buttons in the Send Message action's reply_markup config to enable Callback Query triggers.
  • Webhook vs. Polling: Narakim uses webhooks (not polling) for Telegram. Ensure your server is accessible at the public webhook URL shown in the platform connection settings.
Was this helpful?
historyLast updated: May 10, 2026