Telegram Bubble
Telegram Bot API integration for messaging and bot management
Quick Start
import { TelegramBubble } from '@bubblelab/bubble-core';
import { CredentialType } from '@bubblelab/shared-schemas';
const result = await new TelegramBubble({
operation: 'send_message',
credentials: {
[CredentialType.TELEGRAM_BOT_TOKEN]: process.env.TELEGRAM_BOT_TOKEN as string,
},
}).action();
Operation Details
send_message
- Input Schema
- Output Schema
operation'send_message' required- Send a text message to a Telegram chat
chat_idunknown required- Unique identifier for the target chat or username (e.g., @channelusername)
textstring required- Text of the message to be sent
parse_mode'HTML' | 'Markdown' | 'MarkdownV2'- Text formatting mode (HTML, Markdown, or MarkdownV2)
entitiesunknown[]- List of special entities in the message text
disable_web_page_previewboolean- Disable link previews for links in this message
disable_notificationboolean- Sends the message silently
protect_contentboolean- Protects the content from forwarding and saving
reply_to_message_idnumber- If the message is a reply, ID of the original message
allow_sending_without_replyboolean- Allow sending message even if the replied message is not found
reply_markupunknown- Inline keyboard or reply keyboard markup
credentialsRecord<CredentialType,string>- Object mapping credential types to values (injected at runtime)
operation'send_message' required- Send a text message to a Telegram chat
okboolean required- Whether the Telegram API call was successful
messageobject- Sent message object
errorstring required- Error message if operation failed
successboolean required- Whether the operation was successful
send_photo
- Input Schema
- Output Schema
operation'send_photo' required- Send a photo to a Telegram chat
chat_idunknown required- Unique identifier for the target chat or username
photounknown required- Photo to send (file_id, HTTP URL, or file path)
captionstring- Photo caption
parse_mode'HTML' | 'Markdown' | 'MarkdownV2'- Text formatting mode (HTML, Markdown, or MarkdownV2)
caption_entitiesunknown[]- List of special entities in the caption
has_spoilerboolean- Mark photo as spoiler
disable_notificationboolean- Sends the message silently
protect_contentboolean- Protects the content from forwarding and saving
reply_to_message_idnumber- If the message is a reply, ID of the original message
allow_sending_without_replyboolean- Allow sending message even if the replied message is not found
reply_markupunknown- Inline keyboard or reply keyboard markup
credentialsRecord<CredentialType,string>- Object mapping credential types to values (injected at runtime)
operation'send_photo' required- Send a photo to a Telegram chat
okboolean required- Whether the Telegram API call was successful
messageobject- Sent message object
errorstring required- Error message if operation failed
successboolean required- Whether the operation was successful
send_document
- Input Schema
- Output Schema
operation'send_document' required- Send a document to a Telegram chat
chat_idunknown required- Unique identifier for the target chat or username
documentunknown required- File to send (file_id, HTTP URL, or file path)
thumbnailunknown- Thumbnail of the file
captionstring- Document caption
parse_mode'HTML' | 'Markdown' | 'MarkdownV2'- Text formatting mode (HTML, Markdown, or MarkdownV2)
caption_entitiesunknown[]- List of special entities in the caption
disable_content_type_detectionboolean- Disable automatic file type detection
disable_notificationboolean- Sends the message silently
protect_contentboolean- Protects the content from forwarding and saving
reply_to_message_idnumber- If the message is a reply, ID of the original message
allow_sending_without_replyboolean- Allow sending message even if the replied message is not found
reply_markupunknown- Inline keyboard or reply keyboard markup
credentialsRecord<CredentialType,string>- Object mapping credential types to values (injected at runtime)
operation'send_document' required- Send a document to a Telegram chat
okboolean required- Whether the Telegram API call was successful
messageobject- Sent message object
errorstring required- Error message if operation failed
successboolean required- Whether the operation was successful
edit_message
- Input Schema
- Output Schema
operation'edit_message' required- Edit a previously sent message
chat_idunknown- Unique identifier for the target chat or username
message_idnumber- Identifier of the message to edit
inline_message_idstring- Identifier of the inline message to edit
textstring required- New text of the message
parse_mode'HTML' | 'Markdown' | 'MarkdownV2'- Text formatting mode (HTML, Markdown, or MarkdownV2)
entitiesunknown[]- List of special entities in the message text
disable_web_page_previewboolean- Disable link previews for links in this message
reply_markupobjectcredentialsRecord<CredentialType,string>- Object mapping credential types to values (injected at runtime)
operation'edit_message' required- Edit a previously sent message
okboolean required- Whether the Telegram API call was successful
messageobject- Edited message object
errorstring required- Error message if operation failed
successboolean required- Whether the operation was successful
delete_message
- Input Schema
- Output Schema
operation'delete_message' required- Delete a message
chat_idunknown required- Unique identifier for the target chat or username
message_idnumber required- Identifier of the message to delete
credentialsRecord<CredentialType,string>- Object mapping credential types to values (injected at runtime)
operation'delete_message' required- Delete a message
okboolean required- Whether the Telegram API call was successful
errorstring required- Error message if operation failed
successboolean required- Whether the operation was successful
get_me
- Input Schema
- Output Schema
operation'get_me' required- Get bot information
credentialsRecord<CredentialType,string>- Object mapping credential types to values (injected at runtime)
operation'get_me' required- Get bot information
okboolean required- Whether the Telegram API call was successful
userobject- Bot user object
errorstring required- Error message if operation failed
successboolean required- Whether the operation was successful
get_chat
- Input Schema
- Output Schema
operation'get_chat' required- Get information about a chat
chat_idunknown required- Unique identifier for the target chat or username
credentialsRecord<CredentialType,string>- Object mapping credential types to values (injected at runtime)
operation'get_chat' required- Get information about a chat
okboolean required- Whether the Telegram API call was successful
chatobject- Chat object
errorstring required- Error message if operation failed
successboolean required- Whether the operation was successful
get_updates
- Input Schema
- Output Schema
operation'get_updates' required- Receive incoming updates using long polling
offsetnumber- Identifier of the first update to be returned
limitnumber- Limits the number of updates to be retrieved (1-100)
timeoutnumber- Timeout in seconds for long polling
allowed_updatesstring[]- List of update types to receive
credentialsRecord<CredentialType,string>- Object mapping credential types to values (injected at runtime)
operation'get_updates' required- Receive incoming updates using long polling
okboolean required- Whether the Telegram API call was successful
updatesobject[]- Array of Update objects
errorstring required- Error message if operation failed
successboolean required- Whether the operation was successful
send_chat_action
- Input Schema
- Output Schema
operation'send_chat_action' required- Tell the user that something is happening on the bot's side (typing, uploading photo, etc.)
chat_idunknown required- Unique identifier for the target chat or username
action'typing' | 'upload_photo' | 'record_video' | 'upload_video' | 'record_voice' | 'upload_voice' | 'upload_document' | 'find_location' | 'record_video_note' | 'upload_video_note' | 'choose_sticker' required- Type of action to broadcast
message_thread_idnumber- Unique identifier for the target message thread (for forum topics)
credentialsRecord<CredentialType,string>- Object mapping credential types to values (injected at runtime)
operation'send_chat_action' required- Tell the user that something is happening on the bot's side
okboolean required- Whether the Telegram API call was successful
errorstring required- Error message if operation failed
successboolean required- Whether the operation was successful
set_message_reaction
- Input Schema
- Output Schema
operation'set_message_reaction' required- Add a reaction to a message
chat_idunknown required- Unique identifier for the target chat or username
message_idnumber required- Identifier of the message to react to
reactionunknown[]- Array of reactions to set (empty array to remove reactions)
is_bigboolean- Pass True to set the reaction with a bigger animation
credentialsRecord<CredentialType,string>- Object mapping credential types to values (injected at runtime)
operation'set_message_reaction' required- Add a reaction to a message
okboolean required- Whether the Telegram API call was successful
errorstring required- Error message if operation failed
successboolean required- Whether the operation was successful
set_webhook
- Input Schema
- Output Schema
operation'set_webhook' required- Specify a URL to receive incoming updates via webhook
urlunknown required- HTTPS URL to send updates to. Use an empty string to remove webhook integration
ip_addressstring- The fixed IP address which will be used to send webhook requests instead of the IP address resolved through DNS
max_connectionsnumber- Maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery (1-100). Defaults to 40
allowed_updatesstring[]- A list of update types you want your bot to receive (e.g., ["message", "callback_query"])
drop_pending_updatesboolean- Pass True to drop all pending updates
secret_tokenstring- A secret token to be sent in the X-Telegram-Bot-Api-Secret-Token header (1-256 characters, A-Z, a-z, 0-9, _, -)
credentialsRecord<CredentialType,string>- Object mapping credential types to values (injected at runtime)
operation'set_webhook' required- Specify a URL to receive incoming updates via webhook
okboolean required- Whether the Telegram API call was successful
errorstring required- Error message if operation failed
successboolean required- Whether the operation was successful
delete_webhook
- Input Schema
- Output Schema
operation'delete_webhook' required- Remove webhook integration to switch back to getUpdates
drop_pending_updatesboolean- Pass True to drop all pending updates
credentialsRecord<CredentialType,string>- Object mapping credential types to values (injected at runtime)
operation'delete_webhook' required- Remove webhook integration to switch back to getUpdates
okboolean required- Whether the Telegram API call was successful
errorstring required- Error message if operation failed
successboolean required- Whether the operation was successful
get_webhook_info
- Input Schema
- Output Schema
operation'get_webhook_info' required- Get current webhook status and information
credentialsRecord<CredentialType,string>- Object mapping credential types to values (injected at runtime)
operation'get_webhook_info' required- Get current webhook status and information
okboolean required- Whether the Telegram API call was successful
webhook_infoobject- Webhook information object
errorstring required- Error message if operation failed
successboolean required- Whether the operation was successful