GramJS

messages.GetChatInviteImporters

Get info about the users that joined the chat using a specific chat invite

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.messages.GetChatInviteImporters({
      peer: "username",
      offsetDate: 43,
      offsetUser: "username",
      limit: 100,
      requested: true,
      link: "some string here",
      q: "some string here",
    })
  );
  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.messages.ChatInviteImporters = await client.invoke(
    new Api.messages.GetChatInviteImporters({
      peer: "username",
      offsetDate: 43,
      offsetUser: "username",
      limit: 100,
      requested: true,
      link: "some string here",
      q: "some string here",
    })
  );
  console.log(result); // prints the result
})();

Parameters

NameTypeDescription
flags#Flags, see TL conditional fields
requestedflags.0?trueIf set, only returns info about users with pending join requests »
peerInputPeerChat
linkflags.1?stringInvite link
qflags.2?stringSearch for a user in the pending join requests » list: only available when the requested flag is set, cannot be used together with a specific link.
offsetDateintOffsets for pagination, for more info click here
offsetUserInputUserUser ID for pagination
limitintMaximum number of results to return, see pagination

Result

messages.ChatInviteImporters

Possible errors

CodeTypeDescription
400CHANNEL_PRIVATEYou haven't joined this channel/supergroup.
400CHAT_ADMIN_REQUIREDYou must be an admin in this chat to do this.
400INVITE_HASH_EXPIREDThe invite link has expired.
400PEER_ID_INVALIDThe provided peer id is invalid.
400SEARCH_WITH_LINK_NOT_SUPPORTEDYou cannot provide a search query and an invite link at the same time.

Can bots use this method?

No

Invites

Chats and channels may have a public username or a private invite link: private invite links may be further enhanced with per-user join requests.

Pagination in the API

How to fetch results from large lists of objects.