MessagingTelegram Integration
Messaging

Telegram Bot Integration

Telegram Bot API client for sending messages, managing chats, handling media, and bot interactions. Provides comprehensive access to Telegram's Bot API for automation and messaging.

Telegram Bot

Category: Messaging
Provider Key: Telegram

Telegram Bot API client for sending messages, managing chats, handling media, and bot interactions. Provides comprehensive access to Telegram's Bot API for automation and messaging.


Configuration

To use Telegram Bot in your project, add it to your project integrations and provide the following configuration:

ParameterTypeRequiredDescription
botTokenstringYesTelegram Bot API token from @BotFather
baseUrlstringNoBase URL for API (default: https://api.telegram.org)
timeoutnumberNoRequest timeout in milliseconds (default: 30000)

Example Configuration

{
  "provider": "Telegram",
  "configuration": [
    { "name": "botToken", "value": "your-botToken" },
    { "name": "baseUrl", "value": "your-baseUrl" },
    { "name": "timeout", "value": 0 }
  ]
}

Available Methods

Quick reference:

  • Messages: sendMessage, deleteMessage, editMessageText, forwardMessage
  • Media: sendPhoto, sendDocument
  • Updates: getUpdates
  • Chats: getChat, getChatAdministrators
  • Webhooks: setWebhook, deleteWebhook, getWebhookInfo

Messages

sendMessage

Send Message

Send a text message to a chat

Parameters:

ParameterTypeRequiredDescription
chatId`stringnumber`Yes
textstringYesText of the message to be sent
parseModestring ("Markdown", "MarkdownV2", "HTML")NoParse mode for formatting (Markdown, MarkdownV2, HTML)
disableWebPagePreviewbooleanNoDisables link previews
disableNotificationbooleanNoSends message silently
replyToMessageIdnumberNoIf the message is a reply, ID of the original message

IntegrationAction example:

{
  "extendClassName": "IntegrationAction",
  "name": "sendMessageAction",
  "provider": "Telegram",
  "action": "sendMessage",
  "parameters": [
    { "parameterName": "chatId", "parameterValue": "'your-chatId'" },
    { "parameterName": "text", "parameterValue": "'your-text'" },
    { "parameterName": "parseMode", "parameterValue": "'your-parseMode'" },
    { "parameterName": "disableWebPagePreview", "parameterValue": "true" },
    { "parameterName": "disableNotification", "parameterValue": "true" },
    { "parameterName": "replyToMessageId", "parameterValue": "0" }
  ],
  "contextPropertyName": "sendMessageResult"
}

MScript example:

await _Telegram.sendMessage({
  chatId: /* string|number */,
  text: /* string */,
  parseMode: /* string */,
  disableWebPagePreview: /* boolean */,
  disableNotification: /* boolean */,
  replyToMessageId: /* number */,
})

Service library example:

const { getIntegrationClient } = require("integrations");
const client = await getIntegrationClient("Telegram");
const result = await client.sendMessage({
  chatId: /* string|number */,
  text: /* string */,
  parseMode: /* string */,
  disableWebPagePreview: /* boolean */,
  disableNotification: /* boolean */,
  replyToMessageId: /* number */,
});

deleteMessage

Delete Message

Delete a message from a chat

Parameters:

ParameterTypeRequiredDescription
chatId`stringnumber`Yes
messageIdnumberYesIdentifier of the message to delete

IntegrationAction example:

{
  "extendClassName": "IntegrationAction",
  "name": "deleteMessageAction",
  "provider": "Telegram",
  "action": "deleteMessage",
  "parameters": [
    { "parameterName": "chatId", "parameterValue": "'your-chatId'" },
    { "parameterName": "messageId", "parameterValue": "0" }
  ],
  "contextPropertyName": "deleteMessageResult"
}

MScript example:

await _Telegram.deleteMessage({
  chatId: /* string|number */,
  messageId: /* number */,
})

Service library example:

const { getIntegrationClient } = require("integrations");
const client = await getIntegrationClient("Telegram");
const result = await client.deleteMessage({
  chatId: /* string|number */,
  messageId: /* number */,
});

editMessageText

Edit Message Text

Edit text of a message

Parameters:

ParameterTypeRequiredDescription
chatId`stringnumber`Yes
messageIdnumberYesIdentifier of the message to edit
textstringYesNew text of the message
parseModestring ("Markdown", "MarkdownV2", "HTML")NoParse mode for formatting
disableWebPagePreviewbooleanNoDisables link previews

IntegrationAction example:

{
  "extendClassName": "IntegrationAction",
  "name": "editMessageTextAction",
  "provider": "Telegram",
  "action": "editMessageText",
  "parameters": [
    { "parameterName": "chatId", "parameterValue": "'your-chatId'" },
    { "parameterName": "messageId", "parameterValue": "0" },
    { "parameterName": "text", "parameterValue": "'your-text'" },
    { "parameterName": "parseMode", "parameterValue": "'your-parseMode'" },
    { "parameterName": "disableWebPagePreview", "parameterValue": "true" }
  ],
  "contextPropertyName": "editMessageTextResult"
}

MScript example:

await _Telegram.editMessageText({
  chatId: /* string|number */,
  messageId: /* number */,
  text: /* string */,
  parseMode: /* string */,
  disableWebPagePreview: /* boolean */,
})

Service library example:

const { getIntegrationClient } = require("integrations");
const client = await getIntegrationClient("Telegram");
const result = await client.editMessageText({
  chatId: /* string|number */,
  messageId: /* number */,
  text: /* string */,
  parseMode: /* string */,
  disableWebPagePreview: /* boolean */,
});

forwardMessage

Forward Message

Forward a message from one chat to another

Parameters:

ParameterTypeRequiredDescription
chatId`stringnumber`Yes
fromChatId`stringnumber`Yes
messageIdnumberYesMessage identifier in the chat specified in fromChatId
disableNotificationbooleanNoSends message silently

IntegrationAction example:

{
  "extendClassName": "IntegrationAction",
  "name": "forwardMessageAction",
  "provider": "Telegram",
  "action": "forwardMessage",
  "parameters": [
    { "parameterName": "chatId", "parameterValue": "'your-chatId'" },
    { "parameterName": "fromChatId", "parameterValue": "'your-fromChatId'" },
    { "parameterName": "messageId", "parameterValue": "0" },
    { "parameterName": "disableNotification", "parameterValue": "true" }
  ],
  "contextPropertyName": "forwardMessageResult"
}

MScript example:

await _Telegram.forwardMessage({
  chatId: /* string|number */,
  fromChatId: /* string|number */,
  messageId: /* number */,
  disableNotification: /* boolean */,
})

Service library example:

const { getIntegrationClient } = require("integrations");
const client = await getIntegrationClient("Telegram");
const result = await client.forwardMessage({
  chatId: /* string|number */,
  fromChatId: /* string|number */,
  messageId: /* number */,
  disableNotification: /* boolean */,
});

Media

sendPhoto

Send Photo

Send a photo to a chat

Parameters:

ParameterTypeRequiredDescription
chatId`stringnumber`Yes
photostringYesPhoto URL or file_id
captionstringNoPhoto caption
parseModestring ("Markdown", "MarkdownV2", "HTML")NoParse mode for caption formatting
disableNotificationbooleanNoSends message silently

IntegrationAction example:

{
  "extendClassName": "IntegrationAction",
  "name": "sendPhotoAction",
  "provider": "Telegram",
  "action": "sendPhoto",
  "parameters": [
    { "parameterName": "chatId", "parameterValue": "'your-chatId'" },
    { "parameterName": "photo", "parameterValue": "'your-photo'" },
    { "parameterName": "caption", "parameterValue": "'your-caption'" },
    { "parameterName": "parseMode", "parameterValue": "'your-parseMode'" },
    { "parameterName": "disableNotification", "parameterValue": "true" }
  ],
  "contextPropertyName": "sendPhotoResult"
}

MScript example:

await _Telegram.sendPhoto({
  chatId: /* string|number */,
  photo: /* string */,
  caption: /* string */,
  parseMode: /* string */,
  disableNotification: /* boolean */,
})

Service library example:

const { getIntegrationClient } = require("integrations");
const client = await getIntegrationClient("Telegram");
const result = await client.sendPhoto({
  chatId: /* string|number */,
  photo: /* string */,
  caption: /* string */,
  parseMode: /* string */,
  disableNotification: /* boolean */,
});

sendDocument

Send Document

Send a document to a chat

Parameters:

ParameterTypeRequiredDescription
chatId`stringnumber`Yes
documentstringYesDocument URL or file_id
captionstringNoDocument caption
parseModestring ("Markdown", "MarkdownV2", "HTML")NoParse mode for caption formatting
disableNotificationbooleanNoSends message silently

IntegrationAction example:

{
  "extendClassName": "IntegrationAction",
  "name": "sendDocumentAction",
  "provider": "Telegram",
  "action": "sendDocument",
  "parameters": [
    { "parameterName": "chatId", "parameterValue": "'your-chatId'" },
    { "parameterName": "document", "parameterValue": "'your-document'" },
    { "parameterName": "caption", "parameterValue": "'your-caption'" },
    { "parameterName": "parseMode", "parameterValue": "'your-parseMode'" },
    { "parameterName": "disableNotification", "parameterValue": "true" }
  ],
  "contextPropertyName": "sendDocumentResult"
}

MScript example:

await _Telegram.sendDocument({
  chatId: /* string|number */,
  document: /* string */,
  caption: /* string */,
  parseMode: /* string */,
  disableNotification: /* boolean */,
})

Service library example:

const { getIntegrationClient } = require("integrations");
const client = await getIntegrationClient("Telegram");
const result = await client.sendDocument({
  chatId: /* string|number */,
  document: /* string */,
  caption: /* string */,
  parseMode: /* string */,
  disableNotification: /* boolean */,
});

Updates

getUpdates

Get Updates

Get updates (messages, callbacks, etc.) from the bot

Parameters:

ParameterTypeRequiredDescription
offsetnumberNoIdentifier of the first update to be returned
limitnumberNoLimits the number of updates to be retrieved (1-100)
timeoutnumberNoTimeout in seconds for long polling (0-50)

IntegrationAction example:

{
  "extendClassName": "IntegrationAction",
  "name": "getUpdatesAction",
  "provider": "Telegram",
  "action": "getUpdates",
  "parameters": [
    { "parameterName": "offset", "parameterValue": "0" },
    { "parameterName": "limit", "parameterValue": "0" },
    { "parameterName": "timeout", "parameterValue": "0" }
  ],
  "contextPropertyName": "getUpdatesResult"
}

MScript example:

await _Telegram.getUpdates({
  offset: /* number */,
  limit: /* number */,
  timeout: /* number */,
})

Service library example:

const { getIntegrationClient } = require("integrations");
const client = await getIntegrationClient("Telegram");
const result = await client.getUpdates({
  offset: /* number */,
  limit: /* number */,
  timeout: /* number */,
});

Chats

getChat

Get Chat Info

Get information about a chat

Parameters:

ParameterTypeRequiredDescription
chatId`stringnumber`Yes

IntegrationAction example:

{
  "extendClassName": "IntegrationAction",
  "name": "getChatAction",
  "provider": "Telegram",
  "action": "getChat",
  "parameters": [
    { "parameterName": "chatId", "parameterValue": "'your-chatId'" }
  ],
  "contextPropertyName": "getChatResult"
}

MScript example:

await _Telegram.getChat({
  chatId: /* string|number */,
})

Service library example:

const { getIntegrationClient } = require("integrations");
const client = await getIntegrationClient("Telegram");
const result = await client.getChat({
  chatId: /* string|number */,
});

getChatAdministrators

Get Chat Admins

Get a list of administrators in a chat

Parameters:

ParameterTypeRequiredDescription
chatId`stringnumber`Yes

IntegrationAction example:

{
  "extendClassName": "IntegrationAction",
  "name": "getChatAdministratorsAction",
  "provider": "Telegram",
  "action": "getChatAdministrators",
  "parameters": [
    { "parameterName": "chatId", "parameterValue": "'your-chatId'" }
  ],
  "contextPropertyName": "getChatAdministratorsResult"
}

MScript example:

await _Telegram.getChatAdministrators({
  chatId: /* string|number */,
})

Service library example:

const { getIntegrationClient } = require("integrations");
const client = await getIntegrationClient("Telegram");
const result = await client.getChatAdministrators({
  chatId: /* string|number */,
});

Webhooks

setWebhook

Set Webhook

Set a webhook URL for receiving updates

Parameters:

ParameterTypeRequiredDescription
urlstringYesHTTPS URL to send updates to
maxConnectionsnumberNoMaximum allowed number of simultaneous connections (1-100)
allowedUpdatesArray<string>NoList of update types to receive

IntegrationAction example:

{
  "extendClassName": "IntegrationAction",
  "name": "setWebhookAction",
  "provider": "Telegram",
  "action": "setWebhook",
  "parameters": [
    { "parameterName": "url", "parameterValue": "'your-url'" },
    { "parameterName": "maxConnections", "parameterValue": "0" },
    { "parameterName": "allowedUpdates", "parameterValue": "'your-allowedUpdates'" }
  ],
  "contextPropertyName": "setWebhookResult"
}

MScript example:

await _Telegram.setWebhook({
  url: /* string */,
  maxConnections: /* number */,
  allowedUpdates: /* Array<string> */,
})

Service library example:

const { getIntegrationClient } = require("integrations");
const client = await getIntegrationClient("Telegram");
const result = await client.setWebhook({
  url: /* string */,
  maxConnections: /* number */,
  allowedUpdates: /* Array<string> */,
});

deleteWebhook

Delete Webhook

Delete the webhook

Parameters:

ParameterTypeRequiredDescription
dropPendingUpdatesbooleanNoPass True to drop all pending updates

IntegrationAction example:

{
  "extendClassName": "IntegrationAction",
  "name": "deleteWebhookAction",
  "provider": "Telegram",
  "action": "deleteWebhook",
  "parameters": [
    { "parameterName": "dropPendingUpdates", "parameterValue": "true" }
  ],
  "contextPropertyName": "deleteWebhookResult"
}

MScript example:

await _Telegram.deleteWebhook({
  dropPendingUpdates: /* boolean */,
})

Service library example:

const { getIntegrationClient } = require("integrations");
const client = await getIntegrationClient("Telegram");
const result = await client.deleteWebhook({
  dropPendingUpdates: /* boolean */,
});

getWebhookInfo

Get Webhook Info

Get current webhook status

Parameters:

This method takes no parameters.

MScript example:

await _Telegram.getWebhookInfo()

Service library example:

const { getIntegrationClient } = require("integrations");
const client = await getIntegrationClient("Telegram");
const result = await client.getWebhookInfo();