← Telegram Bot

Send an Album (Media Group) with Telegram Bot API

Pipedream makes it easy to connect APIs for Telegram Bot and 1000+ other apps remarkably fast.

Trigger workflow on
HTTP requests, schedules and app events
Next, do this
Send an Album (Media Group) with the Telegram Bot API
No credit card required
Into to Pipedream
Watch us build a workflow
Watch us build a workflow
7 min
Watch now ➜

Trusted by 500,000+ developers from startups to Fortune 500 companies

Adyen logo
Brex logo
Carta logo
Checkr logo
Chameleon logo
DevRev logo
LinkedIn logo
Netflix logo
New Relic logo
OnDeck logo
Replicated logo
Scale AI logo
Teamwork logo
Warner Bros. logo
Xendit logo

Developers Pipedream

Getting Started

Create a workflow to Send an Album (Media Group) with the Telegram Bot API. When you configure and deploy the workflow, it will run on Pipedream's servers 24x7 for free.

  1. Configure the Send an Album (Media Group) action
    1. Connect your Telegram Bot account
    2. Configure Chat ID
    3. Configure Media
    4. Optional- Configure Disable Notifications
  2. Select a trigger to run your workflow on HTTP requests, schedules or app events
  3. Deploy the workflow
  4. Send a test event to validate your setup
  5. Turn on the trigger

Integrations

Send an Album (Media Group) with Telegram Bot API on New Requests (Payload Only) from HTTP / Webhook API
HTTP / Webhook + Telegram Bot
 
Try it
Send an Album (Media Group) with Telegram Bot API on New Item in Feed from RSS API
RSS + Telegram Bot
 
Try it
Send an Album (Media Group) with Telegram Bot API on New Message from Discord API
Discord + Telegram Bot
 
Try it
Send an Album (Media Group) with Telegram Bot API on New Message In Channels from Slack API
Slack + Telegram Bot
 
Try it
Send an Album (Media Group) with Telegram Bot API on New Message in Channel from Discord Bot API
Discord Bot + Telegram Bot
 
Try it

Details

This is a pre-built, source-available component from Pipedream's GitHub repo. The component is developed by Pipedream and the community, and verified and maintained by Pipedream.

To contribute an update to an existing component or create a new component, create a PR on GitHub. If you're new to Pipedream component development, you can start with quickstarts for trigger span and action development, and then review the component API reference.

Send an Album (Media Group) on Telegram Bot
Description:Sends a group of photos or videos as an album. [See the docs](https://core.telegram.org/bots/api#sendmediagroup) for more information
Version:0.0.5
Key:telegram_bot_api-send-album

Code

import telegramBotApi from "../../telegram_bot_api.app.mjs";
import { toSingleLineString } from "../../common/utils.mjs";

export default {
  key: "telegram_bot_api-send-album",
  name: "Send an Album (Media Group)",
  description: "Sends a group of photos or videos as an album. [See the docs](https://core.telegram.org/bots/api#sendmediagroup) for more information",
  version: "0.0.5",
  type: "action",
  props: {
    telegramBotApi,
    chatId: {
      propDefinition: [
        telegramBotApi,
        "chatId",
      ],
    },
    media: {
      type: "any",
      label: "Media",
      description: toSingleLineString(`
        A JSON-serialized array describing photos and videos to be sent, must include 2–10 items
        (e.g.,
        \`[{"type":"photo","media":"https://example.com/myImage.jpeg"},{"type":"video","media":"/tmp/myVideo.mp4"}]\`).
        [See the docs](https://core.telegram.org/bots/api#inputmedia) for more information about the
        input media object.
      `),
      optional: false,
    },
    disable_notification: {
      propDefinition: [
        telegramBotApi,
        "disable_notification",
      ],
    },
  },
  async run({ $ }) {
    let media = this.media;
    if (typeof media === "string") {
      try {
        media = JSON.parse(media);
      } catch (err) {
        throw new Error("media must be deserializable to JSON");
      }
    }
    const resp = await this.telegramBotApi.sendMediaGroup(this.chatId, media, {
      disable_notification: this.disable_notification,
    });
    // eslint-disable-next-line multiline-ternary
    $.export("$summary", `Successfully sent an album of ${resp.length} media file${resp.length === 1 ? "" : "s"} to chat, "${this.chatId}"`);
    return resp;
  },
};

Configuration

This component may be configured based on the props defined in the component code. Pipedream automatically prompts for input values in the UI and CLI.
LabelPropTypeDescription
Telegram BottelegramBotApiappThis component uses the Telegram Bot app.
Chat IDchatIdstring

Enter the unique identifier for the target chat (e.g. 1035597319) or username of the target public chat (in the format @channelusername or @supergroupusername). For example, if the group's public link is t.me/mygroup, the username is @mygroup.

Mediamediaany

A JSON-serialized array describing photos and videos to be sent, must include 2–10 items (e.g., [{"type":"photo","media":"https://example.com/myImage.jpeg"},{"type":"video","media":"/tmp/myVideo.mp4"}]). See the docs for more information about the input media object.

Disable Notificationsdisable_notificationboolean

Choose if to send the message silently. iOS users will not receive a notification, Android users will receive a notification with no sound.

Authentication

Telegram Bot uses API keys for authentication. When you connect your Telegram Bot account, Pipedream securely stores the keys so you can easily authenticate to Telegram Bot APIs in both code and no-code steps.

To use the Telegram Bot API, you must first create a new bot by chatting with the BotFather.


Telegram Bot how to

After you create your bot, copy the bot token and add it below.

About Telegram Bot

Telegram is a cloud-based instant messaging and voice over IP service

More Ways to Use Telegram Bot

Triggers

New Bot Command Received (Instant) from the Telegram Bot API

Emit new event each time a Telegram Bot command is received.

 
Try it
New Channel Updates (Instant) from the Telegram Bot API

Emit new event each time a channel post is created or updated.

 
Try it
New Message Updates (Instant) from the Telegram Bot API

Emit new event each time a Telegram message is created or updated.

 
Try it
New Updates (Instant) from the Telegram Bot API

Emit new event for each new Telegram event.

 
Try it

Actions

Create Chat Invite Link with the Telegram Bot API

Create an additional invite link for a chat, See the docs for more information

 
Try it
Delete a Message with the Telegram Bot API

Deletes a message. See the docs for more information

 
Try it
Edit a Media Message with the Telegram Bot API

Edits photo or video messages. See the docs for more information

 
Try it
Edit a Text Message with the Telegram Bot API

Edits text or game messages. See the docs for more information

 
Try it
Export Chat Invite Link with the Telegram Bot API

Generate a new primary invite link for a chat, See the docs for more information

 
Try it