Telegram Bot
Send messages, photos, and documents via a Telegram bot.
On this page
Connect
Auth type: API key (secret_text). Paste the API key (or token) from the provider's settings into the connect dialog. It is encrypted at rest and only decrypted on the server when an action runs.
- In the editor: Backend panel, Integrations tab, then Connect. This connects it for the project.
- For every project in a workspace: Workspace settings, Integrations.
- Owners and admins choose which integrations members may connect in the admin panel (Integrations tab), and can attach their own OAuth app there.
Call it from a workflow
Pass the action name and its input. The call resolves with { success, output, error? }; a missing connection resolves with success false and the reason. See ctx.integrations.invoke and ctx.integrations.call.
// .workflow.js (native ctx)
export async function run(ctx) {
const res = await ctx.integrations.invoke("telegram_bot", "get_chat_member", {
"chat_id": "<chat id>",
"user_id": "<user id>"
});
if (!res.success) throw new Error(res.error);
ctx.log.info("Telegram Bot answered", { output: res.output });
}// defineWorkflow module (@app/sdk ctx)
import { defineWorkflow } from "@app/sdk";
export default defineWorkflow({
id: "telegram-bot-get-chat-member",
name: "Telegram Bot: Get Chat Member",
description: "Calls Telegram Bot when a row is created.",
trigger: { type: "entity_event", entity: "tickets", event: "created" },
async run(ctx, event) {
const res = await ctx.integrations.call("telegram_bot", {
"action": "get_chat_member",
"chat_id": "<chat id>",
"user_id": "<user id>"
}) as { success: boolean; error?: string };
if (!res.success) throw new Error(res.error);
},
});curl -X POST "$APP_ORIGIN/__appbricx/connector-proxy/telegram_bot/get_chat_member" \
-H "Authorization: Bearer $APP_KEY" \
-H "content-type: application/json" \
-d '{"props":{"chat_id":"<chat id>","user_id":"<user id>"}}'Actions
get_chat_memberin catalog
Get Chat Member. Get member info (or null) for provided chat id and user id
| Input | Type | Description |
|---|---|---|
chat_idrequired | text | Chat Id |
user_idrequired | text | Unique identifier for the user |
send_mediain catalog
Send Media. Send a media message through a Telegram bot
| Input | Type | Description |
|---|---|---|
chat_idrequired | text | Chat Id |
message_thread_idoptional | text | Unique identifier for the target message thread of the forums; for forums supergroups only |
media_typeoptional | one of "photo" | "video" | "sticker" | "animation" | Media Type |
mediaoptional | object (depends on other props) | Media Properties |
formatoptional | one of "MarkdownV2" | "HTML" | Choose format you want |
messagerequired | long text | The message to be sent |
reply_markupoptional | JSON | Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. Use special actions such… |
send_text_messagein catalog
Send Text Message. Send a message through a Telegram bot
| Input | Type | Description |
|---|---|---|
chat_idrequired | text | Chat Id |
message_thread_idoptional | text | Unique identifier for the target message thread of the forums; for forums supergroups only |
formatoptional | one of "MarkdownV2" | "HTML" | Choose format you want |
web_page_previewoptional | boolean | Disable link previews for links in this message |
messagerequired | long text | The message to be sent |
reply_markupoptional | JSON | Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. Use special actions such… |
create_invite_link
Create Invite Link. Create an invite link for a chat
| Input | Type | Description |
|---|---|---|
chat_idrequired | text | Chat Id |
nameoptional | text | Name of the invite link (max 32 chars) |
expire_dateoptional | date-time (ISO) | Point in time when the link will expire |
member_limitoptional | number | Maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999 |
custom_api_call
Custom API Call. Make a custom API call to a specific endpoint
| Input | Type | Description |
|---|---|---|
urlrequired | object (depends on other props) | url |
methodrequired | one of "GET" | "POST" | "PATCH" | "PUT" | "DELETE" | "HEAD" | Method |
headersrequired | object | Authorization headers are injected automatically from your connection. |
queryParamsrequired | object | Query Parameters |
body_typeoptional | one of "none" | "json" | "form_data" | "raw" | Body Type |
bodyoptional | object (depends on other props) | Body |
response_is_binaryoptional | boolean | Enable for files like PDFs, images, etc. |
failsafeoptional | boolean | No Error on Failure |
timeoutoptional | number | Timeout (in seconds) |
followRedirectsoptional | boolean | Follow redirects |
get_file
Get File. Get file information and download a file from Telegram
| Input | Type | Description |
|---|---|---|
file_idrequired | text | File identifier to get information about |
downloadoptional | boolean | If enabled, the file will be downloaded and returned as base64 |
request_approval_message
Request Approval Message. Send an approval message to a chat and wait until the message is approved or disapproved
| Input | Type | Description |
|---|---|---|
chat_idrequired | text | Chat Id |
messagerequired | long text | The approval message to be sent |
parse_modeoptional | one of "MarkdownV2" | "HTML" | "None" | Choose format for the message |
approve_button_textoptional | text | Text for the approve button |
disapprove_button_textoptional | text | Text for the disapprove button |
Details
- Id
telegram_bot- Category
- Communication
- Tags
- chat, messaging, bot, telegram
- Package
@activepieces/piece-telegram-bot@0.5.6- Tier
- Built in