Class ChatFullInfo

Hierarchy (view full)

Constructors

Properties

Accessors

Methods

Constructors

Properties

accentColorId?: number

The accent color ID of the chat.

activeUsernames?: string[]

The active usernames of the chat.

aggressiveAntiSpamEnabled?: boolean

Whether the chat has aggressive anti-spam enabled.

availableReactions?: ReactionType[]

The available reactions in the chat.

backgroundCustomEmojiId?: string

The custom emoji ID for the chat background.

bio?: string

The bio of the chat.

birthdate?: {
    day: number;
    month: number;
    year?: number;
}

The birthdate of the chat.

businessIntro?: {
    message?: string;
    sticker?: Sticker;
    title?: string;
}

The business introduction of the chat.

businessLocation?: {
    address: string;
    location?: Location;
}

The business location of the chat.

businessOpeningHours?: {
    hours: {
        closing: number;
        opening: number;
    }[];
    timeZone: string;
}

The business opening hours of the chat.

customEmojiStickerSetName?: string

The name of the custom emoji sticker set in the chat.

description?: string

The description of the chat.

emojiStatusCustomEmojiId?: string

The custom emoji ID for the emoji status.

emojiStatusExpirationDate?: number

The expiration date for the emoji status.

firstName?: string

First name of the other party in a private chat

forum?: boolean

True, if the supergroup chat is a forum (has topics enabled)

hiddenMembers?: boolean

Whether the chat has hidden members.

id: string

Unique identifier for this chat

inviteLink?: string

The invite link for the chat.

joinByRequest?: boolean

Whether users need to request to join the chat.

joinToSendMessages?: boolean

Whether users need to join to send messages in the chat.

lastName?: string

Last name of the other party in a private chat

linkedId?: string

The linked chat ID.

location?: {
    address: string;
    location: Location;
}

The location of the chat.

maxReactionCount?: number

The maximum number of reactions allowed in the chat.

messageAutoDeleteTime?: number

The message auto delete time in the chat.

permissions?: ChatPermissions

The permissions in the chat.

personalChat?: Chat

The personal chat associated with this chat.

photo: {
    big: Photo;
    smail: Photo;
}

The photo of the chat.

pinnedMessage?: Message

The pinned message in the chat.

privateForwards?: boolean

Whether the chat has private forwards.

profileAccentColorId?: number

The profile accent color ID of the chat.

profileBackgroundCustomEmojiId?: string

The custom emoji ID for the profile background.

protectedContent?: boolean

Whether the chat has protected content.

restrictedMediaMessages?: boolean

Whether the chat has restricted voice and video messages.

setStickeredSet?: boolean

Whether the chat can set a sticker set.

slowModeDelay?: number

The slow mode delay in the chat.

stickerSetName?: string

The name of the sticker set in the chat.

threadId?: string

Unique identifier of the forum topic

title?: string

Title, for supergroups, channels and group chats

unrestrictBoostCount?: number

The unrestrict boost count of the chat.

username?: string

Username, for private chats, supergroups and channels if available

visibleHistory?: boolean

Whether the chat has visible history.

Accessors

Methods

  • Parameters

    • data: ChatFullInfo

      Data about the full information of a chat

    Returns ChatFullInfo

  • Protected

    Updates the current instance with new data and returns a clone of the updated instance

    Parameters

    • data: Record<string, any>

      The data to update the instance with

    Returns Base

    A clone of the updated instance

  • Use this method to ban a user in a group, a supergroup or a channel. In the case of supergroups and channels, the user will not be able to return to the chat on their own using invite links, etc., unless unbanned first. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights.

    Parameters

    • userId: string | number

      Unique identifier of the target user

    • Optionaloptions: Omit<{
          chatId: string | number;
          revokeMessages?: boolean;
          untilDate?: number;
          userId: string | number;
      }, "userId" | "chatId">

      out parameters

    Returns Promise<true>

    Returns True on success.

  • Use this method to ban a channel chat in a supergroup or a channel. Until the chat is unbanned, the owner of the banned chat won't be able to send messages on behalf of any of their channels. The bot must be an administrator in the supergroup or channel for this to work and must have the appropriate administrator rights.

    Parameters

    • senderChatId: string | number

      Unique identifier of the target sender chat

    Returns Promise<true>

    Returns True on success.

  • Use this method to close an open 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights.

    Returns Promise<true>

    Returns True on success.

  • Use this method to copy messages of any kind. If some of the specified messages can't be found or copied, they are skipped. Service messages, paid media messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz poll can be copied only if the value of the field correctOptionId is known to the bot. The method is analogous to the method forwardMessages, but the copied messages don't have a link to the original message. Album grouping is kept for copied messages.

    Parameters

    • messageIds: (string | number)[]

      A list of 1-100 identifiers of messages in the chat fromChatId to copy. The identifiers must be specified in a strictly increasing order

    • chatId: string | number

      Unique identifier for the target chat or username of the target channel (in the format @channelusername)

    • Optionaloptions: Omit<{
          chatId: string | number;
          disableNotification?: boolean;
          fromChatId: string | number;
          messageIds: (string | number)[];
          messageThreadId?: string | number;
          protectContent?: boolean;
          removeCaption?: boolean;
      }, "chatId" | "fromChatId" | "messageIds">

      out parameters

    Returns Promise<number[]>

    On success, an array of MessageId of the sent messages is returned.

  • Use this method to create a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights.

    Parameters

    • name: string

      Topic name, 1-128 characters

    • Optionaloptions: Omit<{
          chatId: string | number;
          iconColor?:
              | 7322096
              | 16766590
              | 13338331
              | 9367192
              | 16749490
              | 16478047;
          iconCustomEmojiId?: string;
          name: string;
      }, "name" | "chatId">

      out parameters

    Returns Promise<ForumTopic>

    Returns information about the created topic as a ForumTopic object.

  • Use this method to create an additional invite link for a chat. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. The link can be revoked using the method revokeChatInviteLink.

    Parameters

    • Optionaloptions: Omit<{
          chatId: string | number;
          createsJoinRequest?: boolean;
          expireDate?: number;
          memberLimit?: number;
          name?: string;
      }, "chatId">

      out parameters

    Returns Promise<ChatInviteLink>

    Returns the new invite link as ChatInviteLink object.

  • Use this method to create a subscription invite link for a channel chat. The bot must have the can_invite_users administrator rights. The link can be edited using the method editChatSubscriptionInviteLink or revoked using the method revokeChatInviteLink.

    Parameters

    • subscriptionPeriod: number

      The number of seconds the subscription will be active for before the next payment. Currently, it must always be 2592000 (30 days)

    • subscriptionPrice: number

      The amount of Telegram Stars a user must pay initially and after each subsequent subscription period to be a member of the chat; 1-2500

    • Optionalname: string

      Invite link name; 0-32 characters

    Returns Promise<ChatInviteLink>

    Returns the new invite link as a ChatInviteLink object.

  • Use this method to delete a message, including service messages, with the following limitations:

    • A message can only be deleted if it was sent less than 48 hours ago.
    • Service messages about a supergroup, channel, or forum topic creation can't be deleted.
    • A dice message in a private chat can only be deleted if it was sent more than 24 hours ago.
    • Bots can delete outgoing messages in private chats, groups, and supergroups.
    • Bots can delete incoming messages in private chats.
    • Bots granted can_post_messages permissions can delete outgoing messages in channels.
    • If the bot is an administrator of a group, it can delete any message there.
    • If the bot has can_delete_messages permission in a supergroup or a channel, it can delete any message there.

    Parameters

    • id: string | number

      Identifier of the message to delete

    Returns Promise<true>

    Returns True on success.

  • Use this method to delete multiple messages simultaneously.

    Parameters

    • ids: (string | number)[]

      A list of 1-100 identifiers of messages to delete. See deleteMessage for limitations on which messages can be deleted

    Returns Promise<true>

    Returns True on success.

  • Use this method to delete a chat photo. Photos can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights.

    Returns Promise<true>

    Returns True on success.

  • Use this method to delete a group sticker set from a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Use the field can_set_sticker_set ly returned in getChat requests to check if the bot can use this method.

    Returns Promise<true>

    Returns True on success.

  • Use this method to edit the name of the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have can_manage_topics administrator rights.

    Parameters

    • name: string

      New topic name, 1-128 characters

    Returns Promise<true>

    Returns True on success.

  • Use this method to edit a non-primary invite link created by the bot. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights.

    Parameters

    • inviteLink: string

      The invite link to edit

    • Optionaloptions: Omit<{
          chatId: string | number;
          createsJoinRequest?: boolean;
          expireDate?: number;
          inviteLink: string;
          memberLimit?: number;
          name?: string;
      }, "chatId" | "inviteLink">

      out parameters

    Returns Promise<ChatInviteLink>

    Returns the edited invite link as a ChatInviteLink object.

  • Use this method to edit a subscription invite link created by the bot. The bot must have the can_invite_users administrator rights.

    Parameters

    • inviteLink: string

      The invite link to edit

    • Optionalname: string

      Invite link name; 0-32 characters

    Returns Promise<ChatInviteLink>

    Returns the edited invite link as a ChatInviteLink object.

  • Fetches this chat

    Parameters

    • Optionalforce: boolean

      Whether to skip the cache check and request the API

    Returns Promise<Chat>

  • Use this method to forward multiple messages of any kind. If some of the specified messages can't be found or forwarded, they are skipped. Service messages and messages with protected content can't be forwarded. Album grouping is kept for forwarded messages.

    Parameters

    • messageIds: (string | number)[]

      A list of 1-100 identifiers of messages in the chat fromChatId to forward. The identifiers must be specified in a strictly increasing order

    • chatId: string | number

      Unique identifier for the target chat or username of the target channel (in the format @channelusername)

    • Optionaloptions: Omit<{
          chatId: string | number;
          disableNotification?: boolean;
          fromChatId: string | number;
          messageIds: (string | number)[];
          messageThreadId?: string | number;
          protectContent?: boolean;
      }, "chatId" | "fromChatId" | "messageIds">

      out parameters

    Returns Promise<number[]>

    On success, an array of MessageId of the sent messages is returned.

  • Use this method to hide the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. The topic will be automatically closed if it was open.

    Returns Promise<true>

    Returns True on success.

  • Returns this is ChatFullInfo & {
        firstName?: undefined;
        forum?: undefined;
        lastName?: undefined;
        threadId?: undefined;
        title: string;
        username?: string;
    }

  • Returns this is ChatFullInfo & {
        firstName?: undefined;
        forum?: undefined;
        lastName?: undefined;
        threadId?: undefined;
        title: string;
        username?: undefined;
    }

  • Returns this is ChatFullInfo & {
        firstName: string;
        forum?: undefined;
        lastName?: string;
        threadId?: undefined;
        title?: undefined;
        username?: string;
    }

  • Returns this is ChatFullInfo & {
        firstName?: undefined;
        forum?: true;
        lastName?: undefined;
        threadId?: number;
        title: string;
        username?: string;
    }

  • Use this method to kick a user in a group, a supergroup or a channel. In the case of supergroups and channels, the user will not be able to return to the chat on their own using invite links, etc., unless unbanned first. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights.

    Parameters

    • userId: string | number

      Unique identifier of the target user

    • Optionaloptions: Omit<{
          chatId: string | number;
          revokeMessages?: boolean;
          untilDate?: number;
          userId: string | number;
      }, "userId" | "chatId">

      out parameters

    Returns Promise<true>

    Returns True on success.

  • Use this method for your bot to leave this group, supergroup or channel.

    Returns Promise<true>

    Returns True on success.

  • Retrieves the permissions of a specific member in the chat.

    Parameters

    • member: string | ChatMember

      The member object to check permissions for.

    • OptionalcheckAdmin: boolean

      A flag to check if the member is an admin or creator.

    Returns Promise<null | UserPermissions>

    The permissions object of the member or null if not available.

  • Use this method to get the number of members in a chat.

    Returns Promise<number>

    Returns Int on success.

  • Use this method to add a message to the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' admin right in a supergroup or 'can_edit_messages' admin right in a channel.

    Parameters

    • messageId: string | number

      Identifier of a message to pin

    • OptionaldisableNotification: boolean

      Pass True if it is not necessary to send a notification to all chat members about the new pinned message. Notifications are always disabled in channels and private chats

    • OptionalbusinessConnectionId: string

      Unique identifier of the business connection on behalf of which the message will be pinned

    Returns Promise<true>

    Returns True on success.

  • Use this method to reopen a closed 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. The topic will be automatically unhidden if it was hidden.

    Returns Promise<true>

    Returns True on success.

  • Use this method to revoke an invite link created by the bot. If the primary link is revoked, a new link is automatically generated. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights.

    Parameters

    • inviteLink: string

      The invite link to revoke

    Returns Promise<ChatInviteLink>

    Returns the revoked invite link as ChatInviteLink object.

  • Use this method to send text messages.

    Parameters

    • text: string

      Text of the message to be sent, 1-4096 characters after entities parsing

    • Optionaloptions: Omit<{
          businessConnectionId?: string;
          chatId: string | number;
          disableNotification?: boolean;
          entities?: MessageEntity[];
          linkPreviewOptions?: LinkPreviewOptions;
          messageEffectId?: string;
          messageThreadId?: string | number;
          parseMode?: ParseMode;
          protectContent?: boolean;
          replyMarkup?:
              | InlineKeyboardMarkup
              | ForceReply
              | ReplyKeyboardMarkup
              | ReplyKeyboardRemove;
          replyParameters?: ReplyParameters;
          text: string;
      }, "text" | "chatId">

      out parameters

    Returns Promise<Message & {
        content: string;
    }>

    On success, the sent Message is returned.

  • Use this method when you need to tell the user that something is happening on the bot's side. The status is set for 5 seconds or less (when a message arrives from your bot, Telegram clients clear its typing status).

    Parameters

    • Optionalaction:
          | "typing"
          | "upload_photo"
          | "record_video"
          | "upload_video"
          | "record_voice"
          | "upload_voice"
          | "upload_document"
          | "choose_sticker"
          | "find_location"
          | "record_video_note"
          | "upload_video_note"

      Type of action to broadcast. Choose one, depending on what the user is about to receive: typing for text messages, upload_photo for photos, record_video or upload_video for videos, record_voice or upload_voice for voice notes, upload_document for general files, choose_sticker for stickers, find_location for location data, record_video_note or upload_video_note for video notes

    Returns Promise<true>

    Returns True on success.

  • Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound).

    Parameters

    • animation:
          | string
          | ArrayBuffer
          | DataView
          | Uint8Array
          | Buffer
          | ReadStream
          | Blob
          | FormData

      Animation to send. Pass a file_id as String to send an animation that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an animation from the Internet, or upload a new animation using multipart/form-data

    • Optionaloptions: Omit<{
          animation:
              | string
              | ArrayBuffer
              | DataView
              | Uint8Array
              | Buffer
              | ReadStream
              | Blob
              | FormData;
          businessConnectionId?: string;
          caption?: string;
          captionEntities?: MessageEntity[];
          chatId: string | number;
          disableNotification?: boolean;
          duration?: number;
          hasSpoiler?: boolean;
          height?: number;
          messageEffectId?: string;
          messageThreadId?: string | number;
          parseMode?: ParseMode;
          protectContent?: boolean;
          replyMarkup?:
              | InlineKeyboardMarkup
              | ForceReply
              | ReplyKeyboardMarkup
              | ReplyKeyboardRemove;
          replyParameters?: ReplyParameters;
          showCaptionAboveMedia?: boolean;
          thumbnail?:
              | string
              | ArrayBuffer
              | DataView
              | Uint8Array
              | Buffer
              | ReadStream
              | Blob
              | FormData;
          width?: number;
      }, "animation" | "chatId" | "messageThreadId">

      out parameters

    Returns Promise<Message & {
        animation: Animation;
    }>

    On success, the sent Message is returned. Bots can currently send animation files of up to 50 MB in size, this limit may be changed in the future.

  • Use this method to send audio files, if you want Telegram clients to display them in the music player. Your audio must be in the .MP3 or .M4A format. On success, the sent Message is returned. Bots can currently send audio files of up to 50 MB in size, this limit may be changed in the future.

    Parameters

    • audio:
          | string
          | ArrayBuffer
          | DataView
          | Uint8Array
          | Buffer
          | ReadStream
          | Blob
          | FormData

      Audio file to send. Pass a file_id as String to send an audio file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an audio file from the Internet, or upload a new one using multipart/form-data

    • Optionaloptions: Omit<{
          audio:
              | string
              | ArrayBuffer
              | DataView
              | Uint8Array
              | Buffer
              | ReadStream
              | Blob
              | FormData;
          businessConnectionId?: string;
          caption?: string;
          captionEntities?: MessageEntity[];
          chatId: string | number;
          disableNotification?: boolean;
          duration?: number;
          messageEffectId?: string;
          messageThreadId?: string | number;
          parseMode?: ParseMode;
          performer?: string;
          protectContent?: boolean;
          replyMarkup?:
              | InlineKeyboardMarkup
              | ForceReply
              | ReplyKeyboardMarkup
              | ReplyKeyboardRemove;
          replyParameters?: ReplyParameters;
          thumbnail?:
              | string
              | ArrayBuffer
              | DataView
              | Uint8Array
              | Buffer
              | ReadStream
              | Blob
              | FormData;
          title?: string;
      }, "audio" | "chatId" | "messageThreadId">

      out parameters

    Returns Promise<Message & {
        audio: Audio;
    }>

    On success, the sent Message is returned.

  • Use this method to send phone contacts.

    Parameters

    • phoneNumber: string

      Contact's phone number

    • firstName: string

      Contact's first name

    • Optionaloptions: Omit<{
          businessConnectionId?: string;
          chatId: string | number;
          disableNotification?: boolean;
          firstName: string;
          lastName?: string;
          messageEffectId?: string;
          messageThreadId?: string | number;
          phoneNumber: string;
          protectContent?: boolean;
          replyMarkup?:
              | InlineKeyboardMarkup
              | ForceReply
              | ReplyKeyboardMarkup
              | ReplyKeyboardRemove;
          replyParameters?: ReplyParameters;
          vcard?: string;
      }, "chatId" | "phoneNumber" | "firstName">

      out parameters

    Returns Promise<Message & {
        contact: Contact;
    }>

    On success, the sent Message is returned.

  • Use this method to send an animated emoji that will display a random value.

    Parameters

    • emoji: string

      Emoji on which the dice throw animation is based. Currently, must be one of "🎲", "🎯", "🏀", "⚽", "🎳", or "🎰". Dice can have values 1-6 for "🎲", "🎯" and "🎳", values 1-5 for "🏀" and "⚽", and values 1-64 for "🎰".

    • Optionaloptions: Omit<{
          businessConnectionId?: string;
          chatId: string | number;
          disableNotification?: boolean;
          emoji?: string;
          messageEffectId?: string;
          messageThreadId?: string | number;
          protectContent?: boolean;
          replyMarkup?:
              | InlineKeyboardMarkup
              | ForceReply
              | ReplyKeyboardMarkup
              | ReplyKeyboardRemove;
          replyParameters?: ReplyParameters;
      }, "emoji" | "chatId" | "messageThreadId">

      out parameters

    Returns Promise<Message & {
        dice: Dice;
    }>

    On success, the sent Message is returned.

  • Use this method to send general files.

    Parameters

    • document:
          | string
          | ArrayBuffer
          | DataView
          | Uint8Array
          | Buffer
          | ReadStream
          | Blob
          | FormData

      File to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data

    • Optionaloptions: Omit<{
          businessConnectionId?: string;
          caption?: string;
          captionEntities?: MessageEntity[];
          chatId: string | number;
          disableContentTypeDetection?: boolean;
          disableNotification?: boolean;
          document:
              | string
              | ArrayBuffer
              | DataView
              | Uint8Array
              | Buffer
              | ReadStream
              | Blob
              | FormData;
          messageEffectId?: string;
          messageThreadId?: string | number;
          parseMode?: ParseMode;
          protectContent?: boolean;
          replyMarkup?:
              | InlineKeyboardMarkup
              | ForceReply
              | ReplyKeyboardMarkup
              | ReplyKeyboardRemove;
          replyParameters?: ReplyParameters;
          thumbnail?:
              | string
              | ArrayBuffer
              | DataView
              | Uint8Array
              | Buffer
              | ReadStream
              | Blob
              | FormData;
      }, "document" | "chatId" | "messageThreadId">

      out parameters

    Returns Promise<Message & {
        document: Document;
    }>

    On success, the sent Message is returned. Bots can currently send files of any type of up to 50 MB in size, this limit may be changed in the future.

  • Use this method to send a game.

    Parameters

    • gameShortName: string

      Short name of the game, serves as the unique identifier for the game. Set up your games via BotFather.

    • Optionaloptions: Omit<{
          businessConnectionId?: string;
          chatId: string | number;
          disableNotification?: boolean;
          gameShortName: string;
          messageEffectId?: string;
          messageThreadId?: string | number;
          protectContent?: boolean;
          replyMarkup?: InlineKeyboardMarkup;
          replyParameters?: ReplyParameters;
      }, "chatId" | "messageThreadId" | "gameShortName">

      out parameters

    Returns Promise<Message & {
        game: Game;
    }>

    On success, the sent Message is returned.

  • Use this method to send invoices.

    Parameters

    • title: string

      Product name, 1-32 characters

    • description: string

      Product description, 1-255 characters

    • payload: string

      Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes

    • currency: string

      Three-letter ISO 4217 currency code, see more on currencies. Pass “XTR” for payments in Telegram Stars

    • prices: LabeledPrice[]

      Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in Telegram Stars

    • Optionaloptions: Omit<{
          chatId: string | number;
          currency: string;
          description: string;
          disableNotification?: boolean;
          isFlexible?: boolean;
          maxTipAmount?: number;
          messageEffectId?: string;
          messageThreadId?: string | number;
          needEmail?: boolean;
          needName?: boolean;
          needPhoneNumber?: boolean;
          needShippingAddress?: boolean;
          payload: string;
          photoHeight?: number;
          photoSize?: number;
          photoUrl?: string;
          photoWidth?: number;
          prices: readonly LabeledPrice[];
          protectContent?: boolean;
          providerData?: string;
          providerToken?: string;
          replyMarkup?: InlineKeyboardMarkup;
          replyParameters?: ReplyParameters;
          sendEmailToProvider?: boolean;
          sendPhoneNumberToProvider?: boolean;
          startParameter?: string;
          suggestedTipAmounts?: number[];
          title: string;
      },
          | "currency"
          | "description"
          | "title"
          | "chatId"
          | "messageThreadId"
          | "payload"
          | "prices">

      out parameters

    Returns Promise<Message & {
        invoice: Invoice;
    }>

    On success, the sent Message is returned.

  • Use this method to send point on the map.

    Parameters

    • latitude: number

      Latitude of the location

    • longitude: number

      Longitude of the location

    • Optionaloptions: Omit<{
          businessConnectionId?: string;
          chatId: string | number;
          disableNotification?: boolean;
          heading?: number;
          horizontalAccuracy?: number;
          latitude: number;
          livePeriod?: number;
          longitude: number;
          messageEffectId?: string;
          messageThreadId?: string | number;
          protectContent?: boolean;
          proximityAlertRadius?: number;
          replyMarkup?:
              | InlineKeyboardMarkup
              | ForceReply
              | ReplyKeyboardMarkup
              | ReplyKeyboardRemove;
          replyParameters?: ReplyParameters;
      },
          | "chatId"
          | "messageThreadId"
          | "latitude"
          | "longitude">

      out parameters

    Returns Promise<Message & {
        location: Location;
    }>

    On success, the sent Message is returned.

  • Use this method to send a group of photos, videos, documents or audios as an album. Documents and audio files can be only grouped in an album with messages of the same type.

    Parameters

    • media: readonly (
          | InputMediaAudio
          | InputMediaDocument
          | InputMediaPhoto
          | InputMediaVideo)[]

      media

    • Optionaloptions: Omit<{
          businessConnectionId?: string;
          chatId: string | number;
          disableNotification?: boolean;
          media: readonly (
              | InputMediaAudio
              | InputMediaDocument
              | InputMediaPhoto
              | InputMediaVideo)[];
          messageEffectId?: string;
          messageThreadId?: string | number;
          protectContent?: boolean;
          replyParameters?: ReplyParameters;
      }, "media" | "chatId" | "messageThreadId">

      out parameters

    Returns Promise<(
        | Message & {
            audio: Audio;
        }
        | Message & {
            document: Document;
        }
        | Message & {
            photo: Photo;
        }
        | Message & {
            video: Video;
        })[]>

    On success, an array of Messages that were sent is returned.

  • Use this method to send paid media to channel chats.

    Parameters

    • media: InputPaidMedia[]

      An array describing the media to be sent; up to 10 items

    • starCount: number

      The number of Telegram Stars that must be paid to buy access to the media

    • Optionaloptions: Omit<{
          businessConnectionId?: string;
          caption?: string;
          captionEntities?: MessageEntity[];
          chatId: string | number;
          disableNotification?: boolean;
          media: InputPaidMedia[];
          parseMode?: string;
          protectContent?: boolean;
          replyMarkup?:
              | InlineKeyboardMarkup
              | ForceReply
              | ReplyKeyboardMarkup
              | ReplyKeyboardRemove;
          replyParameters?: ReplyParameters;
          showCaptionAboveMedia?: boolean;
          starCount: number;
      }, "media" | "chatId" | "starCount">

      out parameters

    Returns Promise<Message & {
        paidMedia: PaidMediaInfo;
    }>

    On success, the sent Message is returned.

  • Use this method to send photos.

    Parameters

    • photo:
          | string
          | ArrayBuffer
          | DataView
          | Uint8Array
          | Buffer
          | ReadStream
          | Blob
          | FormData

      Photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a photo from the Internet, or upload a new photo using multipart/form-data. The photo must be at most 10 MB in size. The photo's width and height must not exceed 10000 in total. Width and height ratio must be at most 20

    • Optionaloptions: Omit<{
          businessConnectionId?: string;
          caption?: string;
          captionEntities?: MessageEntity[];
          chatId: string | number;
          disableNotification?: boolean;
          hasSpoiler?: boolean;
          messageEffectId?: string;
          messageThreadId?: string | number;
          parseMode?: ParseMode;
          photo:
              | string
              | ArrayBuffer
              | DataView
              | Uint8Array
              | Buffer
              | ReadStream
              | Blob
              | FormData;
          protectContent?: boolean;
          replyMarkup?:
              | InlineKeyboardMarkup
              | ForceReply
              | ReplyKeyboardMarkup
              | ReplyKeyboardRemove;
          replyParameters?: ReplyParameters;
          showCaptionAboveMedia?: boolean;
      }, "photo" | "chatId" | "messageThreadId">

      out parameters

    Returns Promise<Message & {
        photo: Photo[];
    }>

    On success, the sent Message is returned.

  • Use this method to send a native poll.

    Parameters

    • question: string

      Poll question, 1-300 characters

    • options: InputPollOption[]

      A list of 2-10 answer options

    • Optionalother: Omit<{
          allowsMultipleAnswers?: boolean;
          businessConnectionId?: string;
          chatId: string | number;
          closeDate?: number;
          correctOptionId?: number;
          disableNotification?: boolean;
          explanation?: string;
          explanationEntities?: MessageEntity[];
          explanationParseMode?: ParseMode;
          isAnonymous?: boolean;
          isClosed?: boolean;
          messageEffectId?: string;
          messageThreadId?: string | number;
          openPeriod?: number;
          options: InputPollOption[];
          protectContent?: boolean;
          question: string;
          questionEntities?: MessageEntity[];
          questionParseMode?: string;
          replyMarkup?:
              | InlineKeyboardMarkup
              | ForceReply
              | ReplyKeyboardMarkup
              | ReplyKeyboardRemove;
          replyParameters?: ReplyParameters;
          type?: "quiz" | "regular";
      },
          | "options"
          | "chatId"
          | "messageThreadId"
          | "question">

      out parameters

    Returns Promise<Message & {
        poll: Poll;
    }>

    On success, the sent Message is returned.

  • Use this method to send static .WEBP, animated .TGS, or video .WEBM stickers.

    Parameters

    • sticker:
          | string
          | ArrayBuffer
          | DataView
          | Uint8Array
          | Buffer
          | ReadStream
          | Blob
          | FormData

      Sticker to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a .WEBP sticker from the Internet, or upload a new .WEBP, .TGS, or .WEBM sticker using multipart/form-data. Video and animated stickers can't be sent via an HTTP URL

    • Optionaloptions: Omit<{
          businessConnectionId?: string;
          chatId: string | number;
          disableNotification?: boolean;
          emoji?: string;
          messageEffectId?: string;
          messageThreadId?: string | number;
          protectContent?: boolean;
          replyMarkup?:
              | InlineKeyboardMarkup
              | ForceReply
              | ReplyKeyboardMarkup
              | ReplyKeyboardRemove;
          replyParameters?: ReplyParameters;
          sticker:
              | string
              | ArrayBuffer
              | DataView
              | Uint8Array
              | Buffer
              | ReadStream
              | Blob
              | FormData;
      }, "sticker" | "chatId" | "messageThreadId">

      out parameters

    Returns Promise<Message & {
        sticker: Sticker;
    }>

    On success, the sent Message is returned.

  • Use this method to send information about a venue.

    Parameters

    • latitude: number

      Latitude of the location

    • longitude: number

      Longitude of the location

    • options: Omit<{
          address: string;
          businessConnectionId?: string;
          chatId: string | number;
          disableNotification?: boolean;
          foursquareId?: string;
          foursquareType?: string;
          googlePlaceId?: string;
          googlePlaceType?: string;
          latitude: number;
          longitude: number;
          messageEffectId?: string;
          messageThreadId?: string | number;
          protectContent?: boolean;
          replyMarkup?:
              | InlineKeyboardMarkup
              | ForceReply
              | ReplyKeyboardMarkup
              | ReplyKeyboardRemove;
          replyParameters?: ReplyParameters;
          title: string;
      },
          | "chatId"
          | "messageThreadId"
          | "latitude"
          | "longitude">

      out parameters

    Returns Promise<Message & {
        venue: Venue;
    }>

    On success, the sent Message is returned.

  • Use this method to send video files, Telegram clients support MPEG4 videos (other formats may be sent as Document).

    Parameters

    • video:
          | string
          | ArrayBuffer
          | DataView
          | Uint8Array
          | Buffer
          | ReadStream
          | Blob
          | FormData

      Video to send. Pass a file_id as String to send a video that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a video from the Internet, or upload a new video using multipart/form-data.

    • Optionaloptions: Omit<{
          businessConnectionId?: string;
          caption?: string;
          captionEntities?: MessageEntity[];
          chatId: string | number;
          disableNotification?: boolean;
          duration?: number;
          hasSpoiler?: boolean;
          height?: number;
          messageEffectId?: string;
          messageThreadId?: string | number;
          parseMode?: ParseMode;
          protectContent?: boolean;
          replyMarkup?:
              | InlineKeyboardMarkup
              | ForceReply
              | ReplyKeyboardMarkup
              | ReplyKeyboardRemove;
          replyParameters?: ReplyParameters;
          showCaptionAboveMedia?: boolean;
          supportsStreaming?: boolean;
          thumbnail?:
              | string
              | ArrayBuffer
              | DataView
              | Uint8Array
              | Buffer
              | ReadStream
              | Blob
              | FormData;
          video:
              | string
              | ArrayBuffer
              | DataView
              | Uint8Array
              | Buffer
              | ReadStream
              | Blob
              | FormData;
          width?: number;
      }, "video" | "chatId" | "messageThreadId">

      out parameters

    Returns Promise<Message & {
        video: Video;
    }>

    On success, the sent Message is returned. Bots can currently send video files of up to 50 MB in size, this limit may be changed in the future.

  • Use this method to send video messages.

    Parameters

    • videoNote:
          | string
          | ArrayBuffer
          | DataView
          | Uint8Array
          | Buffer
          | ReadStream
          | Blob
          | FormData

      Video note to send. Pass a file_id as String to send a video note that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data.. Sending video notes by a URL is currently unsupported

    • Optionaloptions: Omit<{
          businessConnectionId?: string;
          chatId: string | number;
          disableNotification?: boolean;
          duration?: number;
          length?: number;
          messageEffectId?: string;
          messageThreadId?: string | number;
          protectContent?: boolean;
          replyMarkup?:
              | InlineKeyboardMarkup
              | ForceReply
              | ReplyKeyboardMarkup
              | ReplyKeyboardRemove;
          replyParameters?: ReplyParameters;
          thumbnail?:
              | string
              | ArrayBuffer
              | DataView
              | Uint8Array
              | Buffer
              | ReadStream
              | Blob
              | FormData;
          videoNote:
              | string
              | ArrayBuffer
              | DataView
              | Uint8Array
              | Buffer
              | ReadStream
              | Blob
              | FormData;
      }, "videoNote" | "chatId" | "messageThreadId">

      out parameters

    Returns Promise<Message & {
        videoNote: VideoNote;
    }>

    On success, the sent Message is returned.

  • Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS, or in .MP3 format, or in .M4A format (other formats may be sent as Audio or Document).

    Parameters

    • voice:
          | string
          | ArrayBuffer
          | DataView
          | Uint8Array
          | Buffer
          | ReadStream
          | Blob
          | FormData

      Audio file to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data

    • Optionaloptions: Omit<{
          businessConnectionId?: string;
          caption?: string;
          captionEntities?: MessageEntity[];
          chatId: string | number;
          disableNotification?: boolean;
          duration?: number;
          messageEffectId?: string;
          messageThreadId?: string | number;
          parseMode?: ParseMode;
          protectContent?: boolean;
          replyMarkup?:
              | InlineKeyboardMarkup
              | ForceReply
              | ReplyKeyboardMarkup
              | ReplyKeyboardRemove;
          replyParameters?: ReplyParameters;
          voice:
              | string
              | ArrayBuffer
              | DataView
              | Uint8Array
              | Buffer
              | ReadStream
              | Blob
              | FormData;
      }, "voice" | "chatId" | "messageThreadId">

      out parameters

    Returns Promise<Message & {
        voice: Voice;
    }>

    On success, the sent Message is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future.

  • Use this method to change the description of a group, a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights.

    Parameters

    • Optionaldescription: string

      New chat description, 0-255 characters

    Returns Promise<true>

    Returns True on success.

  • Use this method to change the bot's menu button in a private chat, or the default menu button.

    Parameters

    • OptionalmenuButton: MenuButton

      An object for the bot's new menu button. Defaults to MenuButtonDefault

    Returns Promise<true>

    Returns True on success.

  • Use this method to set default chat permissions for all members. The bot must be an administrator in the group or a supergroup for this to work and must have the can_restrict_members administrator rights.

    Parameters

    • perms: ChatPermissionFlags

      An object for new default chat permissions

    • OptionaluseIndependentChatPermissions: boolean

      Pass True if chat permissions are set independently. Otherwise, the can_send_other_messages and can_add_web_page_previews permissions will imply the can_send_messages, can_send_audios, can_send_documents, can_send_photos, can_send_videos, can_send_video_notes, and can_send_voice_notes permissions; the can_send_polls permission will imply the can_send_messages permission

    Returns Promise<true>

    Returns True on success.

  • Use this method to set a new profile photo for the chat. Photos can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights.

    Parameters

    • photo:
          | string
          | ArrayBuffer
          | DataView
          | Uint8Array
          | Buffer
          | ReadStream
          | Blob
          | FormData

      New chat photo, uploaded using multipart/form-data

    Returns Promise<true>

    Returns True on success.

  • Use this method to set a new group sticker set for a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Use the field can_set_sticker_set ly returned in getChat requests to check if the bot can use this method

    Parameters

    • name: string

      Name of the sticker set to be set as the group sticker set.

    Returns Promise<true>

    Returns True on success.

  • Use this method to change the title of a chat. Titles can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights.

    Parameters

    • title: string

      New chat title, 1-128 characters

    Returns Promise<true>

    Returns True on success.

  • Use this method to unban a previously banned user in a supergroup or channel. The user will not return to the group or channel automatically, but will be able to join via link, etc. The bot must be an administrator for this to work. By default, this method guarantees that after the call the user is not a member of the chat, but will be able to join it. So if the user is a member of the chat they will also be removed from the chat. If you don't want this, use the parameter only_if_banned.

    Parameters

    • userId: string | number

      Unique identifier of the target user

    • OptionalonlyIfBanned: boolean

      Do nothing if the user is not banned

    Returns Promise<true>

    Returns True on success.

  • Use this method to unban a previously banned channel chat in a supergroup or channel. The bot must be an administrator for this to work and must have the appropriate administrator rights.

    Parameters

    • senderChatId: string | number

      Unique identifier of the target sender chat

    Returns Promise<true>

    Returns True on success.

  • Use this method to unhide the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights.

    Returns Promise<true>

    Returns True on success.

  • Use this method to clear the list of pinned messages in a General forum topic. The bot must be an administrator in the chat for this to work and must have the can_pin_messages administrator right in the supergroup.

    Returns Promise<true>

    Returns True on success.

  • Use this method to clear the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' admin right in a supergroup or 'can_edit_messages' admin right in a channel.

    Returns Promise<true>

    Returns True on success.

  • Use this method to remove a message from the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' admin right in a supergroup or 'can_edit_messages' admin right in a channel.

    Parameters

    • OptionalmessageId: string | number

      Identifier of the message to unpin. Required if business_connection_id is specified. If not specified, the most recent pinned message (by sending date) will be pinned

    • OptionalbusinessConnectionId: string

      Unique identifier of the business connection on behalf of which the message will be unpinned

    Returns Promise<true>

    Returns True on success.