GramJS

phone.GetGroupParticipants

Get group call participants

Example

const { Api, TelegramClient } = require("telegram");
const { StringSession } = require("telegram/sessions");

const session = new StringSession(""); // You should put your string session here
const client = new TelegramClient(session, apiId, apiHash, {});

(async function run() {
  await client.connect(); // This assumes you have already authenticated with .start()

  const result = await client.invoke(
    new Api.phone.GetGroupParticipants({
      call: new Api.InputGroupCall({
        id: BigInt("-4156887774564"),
        accessHash: BigInt("-4156887774564"),
      }),
      ids: ["username"],
      sources: [43],
      offset: "some string here",
      limit: 100,
    })
  );
  console.log(result); // prints the result
})();
import { Api, TelegramClient } from "telegram";
import { StringSession } from "telegram/sessions";

const session = new StringSession(""); // You should put your string session here
const client = new TelegramClient(session, apiId, apiHash, {});

(async function run() {
  await client.connect(); // This assumes you have already authenticated with .start()

  const result: Api.phone.GroupParticipants = await client.invoke(
    new Api.phone.GetGroupParticipants({
      call: new Api.InputGroupCall({
        id: BigInt("-4156887774564"),
        accessHash: BigInt("-4156887774564"),
      }),
      ids: ["username"],
      sources: [43],
      offset: "some string here",
      limit: 100,
    })
  );
  console.log(result); // prints the result
})();

Parameters

NameTypeDescription
callInputGroupCallGroup call
idsVector<InputPeer>If specified, will fetch group participant info about the specified peers
sourcesVector<int>If specified, will fetch group participant info about the specified WebRTC source IDs
offsetstringOffset for results, taken from the next_offset field of phone.groupParticipants, initially an empty string. Note: if no more results are available, the method call will return an empty next_offset; thus, avoid providing the next_offset returned in phone.groupParticipants if it is empty, to avoid an infinite loop.
limitintMaximum number of results to return, see pagination

Result

phone.GroupParticipants

Possible errors

CodeTypeDescription

Can bots use this method?

No

phone.groupParticipants

Info about the participants of a group call or livestream

Pagination in the API

How to fetch results from large lists of objects.