← Telegram Bot

Get the Number of Members in a Chat with Telegram Bot API

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

Trigger workflow on
HTTP requests, schedules and app events
Next, do this
Get the Number of Members in a Chat 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 250,000+ developers from startups to Fortune 500 companies:
Trusted by 250,000+ developers from startups to Fortune 500 companies

Developers Pipedream

Getting Started

Create a workflow to Get the Number of Members in a Chat 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 Get the Number of Members in a Chat action
    1. Connect your Telegram Bot account
    2. Configure Chat ID
  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

Details

This is a pre-built, open source 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.

Get the Number of Members in a Chat on Telegram Bot
Description:Use this module to get the number of members in a chat. [See the docs](https://core.telegram.org/bots/api#getchatmembercount) for more information
Version:0.0.1
Key:telegram_bot_api-get-num-members-in-chat

Code

import telegramBotApi from "../../telegram_bot_api.app.mjs";

export default {
  key: "telegram_bot_api-get-num-members-in-chat",
  name: "Get the Number of Members in a Chat",
  description: "Use this module to get the number of members in a chat. [See the docs](https://core.telegram.org/bots/api#getchatmembercount) for more information",
  version: "0.0.1",
  type: "action",
  props: {
    telegramBotApi,
    chatId: {
      propDefinition: [
        telegramBotApi,
        "chatId",
      ],
    },
  },
  async run({ $ }) {
    const resp = await this.telegramBotApi.getChatMemberCount(this.chatId);
    $.export("$summary", `Successfully fetched the number of members in 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.

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