telegraf

  • Version 4.4.2
  • Published
  • 417 kB
  • 9 dependencies
  • MIT license

Install

npm i telegraf
yarn add telegraf
pnpm add telegraf

Overview

Modern Telegram Bot Framework

Index

Functions

Classes

Type Aliases

Namespaces

Functions

function deunionize

deunionize: <T extends object>(t: T) => Deunionize<T, T>;
  • Expose properties from all union variants.

    See Also

    • https://github.com/telegraf/telegraf/issues/1388#issuecomment-791573609

    • https://millsp.github.io/ts-toolbelt/modules/union_strict.html

function session

session: <S extends object>(
options?: SessionOptions<S>
) => MiddlewareFn<SessionContext<S>>;
  • Returns middleware that adds ctx.session for storing arbitrary state per session key.

    The default getSessionKey is `${ctx.from.id}:${ctx.chat.id}`. If either ctx.from or ctx.chat is undefined, default session key and thus ctx.session are also undefined.

    Session data is kept only in memory by default, which means that all data will be lost when the process is terminated. If you want to store data across restarts, or share it among workers, you can [install persistent session middleware from npm](https://www.npmjs.com/search?q=telegraf-session), or pass custom storage.

    Example 1

    https://github.com/telegraf/telegraf/blob/develop/docs/examples/session-bot.ts

    Deprecated

    https://github.com/telegraf/telegraf/issues/1372#issuecomment-782668499

Classes

class Composer

class Composer<C extends Context> implements MiddlewareObj<C> {}

    constructor

    constructor(...fns: readonly Middleware<C>[]);

      method acl

      static acl: <C extends Context<any>>(
      userId: MaybeArray<number>,
      fns_0: Middleware<C>,
      ...fns_1: Middleware<C>[]
      ) => MiddlewareFn<C>;
      • Generates middleware responding only to specified users.

      method action

      static action: <C extends Context<any>>(
      triggers: Triggers<C>,
      fns_0: Middleware<
      MatchedContext<C & { match: RegExpExecArray }, 'callback_query'>
      >,
      ...fns_1: Middleware<
      MatchedContext<C & { match: RegExpExecArray }, 'callback_query'>
      >[]
      ) => MiddlewareFn<C>;
      • Registers middleware for handling matching callback queries.

      • Generates middleware for handling matching callback queries.

      method admin

      static admin: <C extends Context<any>>(
      fns_0: Middleware<C>,
      ...fns_1: Middleware<C>[]
      ) => MiddlewareFn<C>;
      • Generates middleware responding only to chat admins and chat creator.

      method branch

      static branch: <C extends Context<any>>(
      predicate: Predicate<C> | AsyncPredicate<C>,
      trueMiddleware: Middleware<C>,
      falseMiddleware: Middleware<C>
      ) => MiddlewareFn<C>;
      • Parameter trueMiddleware

        middleware to run if the predicate returns true

        Parameter falseMiddleware

        middleware to run if the predicate returns false

      method cashtag

      static cashtag: <C extends Context<any>>(
      cashtag: MaybeArray<string>,
      fns_0: Middleware<
      MatchedContext<
      C & { match: RegExpExecArray },
      'message' | 'channel_post'
      >
      >,
      ...fns_1: Middleware<
      MatchedContext<
      C & { match: RegExpExecArray },
      'message' | 'channel_post'
      >
      >[]
      ) => MiddlewareFn<C>;

        method catch

        static catch: <C extends Context<any>>(
        errorHandler: (err: unknown, ctx: C) => void,
        ...fns: ReadonlyArray<Middleware<C>>
        ) => MiddlewareFn<C>;

          method chatType

          static chatType: <C extends Context<any>>(
          type: MaybeArray<tg.Chat['type']>,
          fns_0: Middleware<C>,
          ...fns_1: Middleware<C>[]
          ) => MiddlewareFn<C>;
          • Generates middleware running only in specified chat types.

          method command

          static command: <C extends Context<any>>(
          command: MaybeArray<string>,
          fns_0: Middleware<MatchedContext<C, 'text'>>,
          ...fns_1: Middleware<MatchedContext<C, 'text'>>[]
          ) => MiddlewareFn<C>;
          • Registers middleware for handling specified commands.

          • Generates middleware for handling specified commands.

          method compose

          static compose: <C extends Context<any>>(
          middlewares: ReadonlyArray<Middleware<C>>
          ) => MiddlewareFn<C>;

            method creator

            static creator: <C extends Context<any>>(
            fns_0: Middleware<C>,
            ...fns_1: Middleware<C>[]
            ) => MiddlewareFn<C>;
            • Generates middleware responding only to chat creator.

            method dispatch

            static dispatch: <
            C extends Context<any>,
            Handlers extends Record<string | number | symbol, Middleware<C>>
            >(
            routeFn: (ctx: C) => MaybePromise<keyof Handlers>,
            handlers: Handlers
            ) => Middleware<C>;

              method drop

              static drop: <C extends Context<any>>(
              predicate: Predicate<C>
              ) => MiddlewareFn<C>;
              • Registers middleware for dropping matching updates.

              • Generates middleware for dropping matching updates.

              method email

              static email: <C extends Context<any>>(
              email: Triggers<C>,
              fns_0: Middleware<
              MatchedContext<
              C & { match: RegExpExecArray },
              'message' | 'channel_post'
              >
              >,
              ...fns_1: Middleware<
              MatchedContext<
              C & { match: RegExpExecArray },
              'message' | 'channel_post'
              >
              >[]
              ) => MiddlewareFn<C>;

                method entityText

                static entityText: <C extends Context<any>>(
                entityType: MaybeArray<string>,
                predicate: Triggers<C>,
                fns_0: Middleware<
                MatchedContext<
                C & { match: RegExpExecArray },
                'message' | 'channel_post'
                >
                >,
                ...fns_1: Middleware<
                MatchedContext<
                C & { match: RegExpExecArray },
                'message' | 'channel_post'
                >
                >[]
                ) => MiddlewareFn<C>;

                  method filter

                  static filter: <C extends Context<any>>(
                  predicate: Predicate<C>
                  ) => MiddlewareFn<C>;

                    method fork

                    static fork: <C extends Context<any>>(
                    middleware: Middleware<C>
                    ) => MiddlewareFn<C>;
                    • Generates middleware that runs in the background.

                    method gameQuery

                    static gameQuery: <C extends Context<any>>(
                    fns_0: Middleware<NarrowedContext<C, GameQueryUpdate>>,
                    ...fns_1: Middleware<NarrowedContext<C, GameQueryUpdate>>[]
                    ) => MiddlewareFn<C>;
                    • Registers middleware for handling game queries

                    • Generates middleware for handling game queries.

                    method groupChat

                    static groupChat: <C extends Context<any>>(
                    fns_0: Middleware<C>,
                    ...fns_1: Middleware<C>[]
                    ) => MiddlewareFn<C>;
                    • Generates middleware running only in groups and supergroups.

                    method guard

                    static guard: <C extends Context<any>, U extends any>(
                    guardFn: (u: any) => u is U,
                    fns_0: Middleware<NarrowedContext<C, U>>,
                    ...fns_1: Middleware<NarrowedContext<C, U>>[]
                    ) => MiddlewareFn<C>;
                    • Registers middleware for handling updates matching given type guard function.

                    • Generates optional middleware based on a predicate that only operates on ctx.update.

                      Example:

                      import { Composer, Update } from 'telegraf'
                      const predicate = (u): u is Update.MessageUpdate => 'message' in u
                      const middleware = Composer.guard(predicate, (ctx) => {
                      const message = ctx.update.message
                      })

                      Note that Composer.mount('message') is preferred over this.

                      Parameter guardFn

                      predicate to decide whether to run the middleware based on the ctx.update object

                      Parameter fns

                      middleware to run if the predicate returns true

                      See Also

                      • Composer.optional for a more generic version of this method that allows the predicate to operate on ctx itself

                    method hashtag

                    static hashtag: <C extends Context<any>>(
                    hashtag: MaybeArray<string>,
                    fns_0: Middleware<
                    MatchedContext<
                    C & { match: RegExpExecArray },
                    'message' | 'channel_post'
                    >
                    >,
                    ...fns_1: Middleware<
                    MatchedContext<
                    C & { match: RegExpExecArray },
                    'message' | 'channel_post'
                    >
                    >[]
                    ) => MiddlewareFn<C>;

                      method hears

                      static hears: <C extends Context<any>>(
                      triggers: Triggers<C>,
                      fns_0: Middleware<MatchedContext<C & { match: RegExpExecArray }, 'text'>>,
                      ...fns_1: Middleware<
                      MatchedContext<C & { match: RegExpExecArray }, 'text'>
                      >[]
                      ) => MiddlewareFn<C>;
                      • Registers middleware for handling matching text messages.

                      • Generates middleware for handling matching text messages.

                      method help

                      help: (
                      fns_0: Middleware<MatchedContext<C, 'text'>>,
                      ...fns_1: Middleware<MatchedContext<C, 'text'>>[]
                      ) => this;
                      • Registers a middleware for handling /help

                      method inlineQuery

                      static inlineQuery: <C extends Context<any>>(
                      triggers: Triggers<C>,
                      fns_0: Middleware<
                      MatchedContext<C & { match: RegExpExecArray }, 'inline_query'>
                      >,
                      ...fns_1: Middleware<
                      MatchedContext<C & { match: RegExpExecArray }, 'inline_query'>
                      >[]
                      ) => MiddlewareFn<C>;
                      • Registers middleware for handling matching inline queries.

                      • Generates middleware for handling matching inline queries.

                      method lazy

                      static lazy: <C extends Context<any>>(
                      factoryFn: (ctx: C) => MaybePromise<Middleware<C>>
                      ) => MiddlewareFn<C>;

                        method log

                        static log: (logFn?: (s: string) => void) => MiddlewareFn<Context>;

                          method mention

                          static mention: <C extends Context<any>>(
                          mention: MaybeArray<string>,
                          fns_0: Middleware<
                          MatchedContext<
                          C & { match: RegExpExecArray },
                          'message' | 'channel_post'
                          >
                          >,
                          ...fns_1: Middleware<
                          MatchedContext<
                          C & { match: RegExpExecArray },
                          'message' | 'channel_post'
                          >
                          >[]
                          ) => MiddlewareFn<C>;

                            method middleware

                            middleware: () => MiddlewareFn<C>;

                              method mount

                              static mount: <C extends Context<any>, T extends 'forward_date'>(
                              updateType: MaybeArray<T>,
                              fns_0: Middleware<MatchedContext<C, T>>,
                              ...fns_1: Middleware<MatchedContext<C, T>>[]
                              ) => MiddlewareFn<C>;
                              • Generates middleware for handling provided update types.

                                Deprecated

                                use Composer.on

                              method on

                              static on: <C extends Context<any>, T extends 'forward_date'>(
                              updateType: MaybeArray<T>,
                              fns_0: Middleware<MatchedContext<C, T>>,
                              ...fns_1: Middleware<MatchedContext<C, T>>[]
                              ) => MiddlewareFn<C>;
                              • Registers middleware for handling provided update types.

                              • Generates middleware for handling provided update types.

                              method optional

                              static optional: <C extends Context<any>>(
                              predicate: Predicate<C> | AsyncPredicate<C>,
                              fns_0: Middleware<C>,
                              ...fns_1: Middleware<C>[]
                              ) => MiddlewareFn<C>;
                              • Generates optional middleware.

                                Parameter predicate

                                predicate to decide on a context object whether to run the middleware

                                Parameter middleware

                                middleware to run if the predicate returns true

                              method passThru

                              static passThru: () => MiddlewareFn<Context>;
                              • Generates middleware that gives up control to the next middleware.

                              method phone

                              static phone: <C extends Context<any>>(
                              number: Triggers<C>,
                              fns_0: Middleware<
                              MatchedContext<
                              C & { match: RegExpExecArray },
                              'message' | 'channel_post'
                              >
                              >,
                              ...fns_1: Middleware<
                              MatchedContext<
                              C & { match: RegExpExecArray },
                              'message' | 'channel_post'
                              >
                              >[]
                              ) => MiddlewareFn<C>;

                                method privateChat

                                static privateChat: <C extends Context<any>>(
                                fns_0: Middleware<C>,
                                ...fns_1: Middleware<C>[]
                                ) => MiddlewareFn<C>;
                                • Generates middleware running only in private chats.

                                method reply

                                static reply: (
                                text: string,
                                extra?: tt.ExtraReplyMessage
                                ) => MiddlewareFn<Context>;

                                  method settings

                                  settings: (
                                  fns_0: Middleware<MatchedContext<C, 'text'>>,
                                  ...fns_1: Middleware<MatchedContext<C, 'text'>>[]
                                  ) => this;
                                  • Registers a middleware for handling /settings

                                  method start

                                  start: (
                                  fns_0: Middleware<
                                  Context<unknown> & Omit<C, keyof Context<any>> & { startPayload: string }
                                  >,
                                  ...fns_1: Middleware<
                                  Context<unknown> & Omit<C, keyof Context<any>> & { startPayload: string }
                                  >[]
                                  ) => this;
                                  • Registers a middleware for handling /start

                                  method tap

                                  static tap: <C extends Context<any>>(
                                  middleware: Middleware<C>
                                  ) => MiddlewareFn<C>;
                                    static textLink: <C extends Context<any>>(
                                    link: Triggers<C>,
                                    fns_0: Middleware<
                                    MatchedContext<
                                    C & { match: RegExpExecArray },
                                    'message' | 'channel_post'
                                    >
                                    >,
                                    ...fns_1: Middleware<
                                    MatchedContext<
                                    C & { match: RegExpExecArray },
                                    'message' | 'channel_post'
                                    >
                                    >[]
                                    ) => MiddlewareFn<C>;

                                      method textMention

                                      static textMention: <C extends Context<any>>(
                                      mention: Triggers<C>,
                                      fns_0: Middleware<
                                      MatchedContext<
                                      C & { match: RegExpExecArray },
                                      'message' | 'channel_post'
                                      >
                                      >,
                                      ...fns_1: Middleware<
                                      MatchedContext<
                                      C & { match: RegExpExecArray },
                                      'message' | 'channel_post'
                                      >
                                      >[]
                                      ) => MiddlewareFn<C>;

                                        method unwrap

                                        static unwrap: <C extends Context<any>>(
                                        handler: Middleware<C>
                                        ) => MiddlewareFn<C>;

                                          method url

                                          static url: <C extends Context<any>>(
                                          url: Triggers<C>,
                                          fns_0: Middleware<
                                          MatchedContext<
                                          C & { match: RegExpExecArray },
                                          'message' | 'channel_post'
                                          >
                                          >,
                                          ...fns_1: Middleware<
                                          MatchedContext<
                                          C & { match: RegExpExecArray },
                                          'message' | 'channel_post'
                                          >
                                          >[]
                                          ) => MiddlewareFn<C>;

                                            method use

                                            use: (...fns: ReadonlyArray<Middleware<C>>) => this;
                                            • Registers a middleware.

                                            class Context

                                            class Context<U extends Deunionize<tg.Update> = tg.Update> {}

                                              constructor

                                              constructor(update: {}, tg: Telegram, botInfo: any);

                                                property botInfo

                                                readonly botInfo: any;

                                                  property callbackQuery

                                                  readonly callbackQuery: {};

                                                    property channelPost

                                                    readonly channelPost: {};

                                                      property chat

                                                      readonly chat: {};

                                                        property chatMember

                                                        readonly chatMember: {};

                                                          property chosenInlineResult

                                                          readonly chosenInlineResult: {};

                                                            property editedChannelPost

                                                            readonly editedChannelPost: {};

                                                              property editedMessage

                                                              readonly editedMessage: {};

                                                                property from

                                                                readonly from: {};

                                                                  property inlineMessageId

                                                                  readonly inlineMessageId: string;

                                                                    property inlineQuery

                                                                    readonly inlineQuery: {};

                                                                      property me

                                                                      readonly me: string;

                                                                        property message

                                                                        readonly message: {};

                                                                          property myChatMember

                                                                          readonly myChatMember: {};

                                                                            property passportData

                                                                            readonly passportData: any;

                                                                              property poll

                                                                              readonly poll: {};

                                                                                property pollAnswer

                                                                                readonly pollAnswer: {};

                                                                                  property preCheckoutQuery

                                                                                  readonly preCheckoutQuery: {};

                                                                                    property senderChat

                                                                                    readonly senderChat: {};

                                                                                      property shippingQuery

                                                                                      readonly shippingQuery: {};

                                                                                        property state

                                                                                        readonly state: Record<string | symbol, any>;

                                                                                          property telegram

                                                                                          readonly telegram: Telegram;

                                                                                            property tg

                                                                                            readonly tg: Telegram;

                                                                                              property update

                                                                                              readonly update: {};

                                                                                                property updateType

                                                                                                readonly updateType: never;

                                                                                                  property webhookReply

                                                                                                  webhookReply: boolean;

                                                                                                  method addStickerToSet

                                                                                                  addStickerToSet: (
                                                                                                  this: Context,
                                                                                                  name: string,
                                                                                                  stickerData: tt.ExtraAddStickerToSet
                                                                                                  ) => Promise<true>;
                                                                                                  • See Also

                                                                                                    • https://core.telegram.org/bots/api#addstickertoset

                                                                                                  method answerCbQuery

                                                                                                  answerCbQuery: (
                                                                                                  this: Context,
                                                                                                  text?: string,
                                                                                                  extra?: tt.ExtraAnswerCbQuery
                                                                                                  ) => Promise<true>;
                                                                                                  • See Also

                                                                                                    • https://core.telegram.org/bots/api#answercallbackquery

                                                                                                  method answerGameQuery

                                                                                                  answerGameQuery: (this: Context, url: string) => Promise<true>;
                                                                                                  • See Also

                                                                                                    • https://core.telegram.org/bots/api#answercallbackquery

                                                                                                  method answerInlineQuery

                                                                                                  answerInlineQuery: (
                                                                                                  this: Context,
                                                                                                  results: readonly any[],
                                                                                                  extra?: tt.ExtraAnswerInlineQuery
                                                                                                  ) => Promise<true>;
                                                                                                  • See Also

                                                                                                    • https://core.telegram.org/bots/api#answerinlinequery

                                                                                                  method answerPreCheckoutQuery

                                                                                                  answerPreCheckoutQuery: (
                                                                                                  this: Context,
                                                                                                  ok: boolean,
                                                                                                  errorMessage?: string
                                                                                                  ) => Promise<true>;
                                                                                                  • See Also

                                                                                                    • https://core.telegram.org/bots/api#answerprecheckoutquery

                                                                                                  method answerShippingQuery

                                                                                                  answerShippingQuery: (
                                                                                                  this: Context,
                                                                                                  ok: boolean,
                                                                                                  shippingOptions: readonly any[],
                                                                                                  errorMessage: string
                                                                                                  ) => Promise<true>;
                                                                                                  • See Also

                                                                                                    • https://core.telegram.org/bots/api#answershippingquery

                                                                                                  method copyMessage

                                                                                                  copyMessage: (
                                                                                                  this: Context,
                                                                                                  chatId: string | number,
                                                                                                  extra?: tt.ExtraCopyMessage
                                                                                                  ) => Promise<tg.MessageId>;
                                                                                                  • See Also

                                                                                                    • https://core.telegram.org/bots/api#copymessage

                                                                                                  createChatInviteLink: (
                                                                                                  this: Context,
                                                                                                  extra?: tt.ExtraCreateChatInviteLink
                                                                                                  ) => Promise<tg.ChatInviteLink>;
                                                                                                  • See Also

                                                                                                    • https://core.telegram.org/bots/api#createchatinvitelink

                                                                                                  method createNewStickerSet

                                                                                                  createNewStickerSet: (
                                                                                                  this: Context,
                                                                                                  name: string,
                                                                                                  title: string,
                                                                                                  stickerData: tt.ExtraCreateNewStickerSet
                                                                                                  ) => Promise<true>;
                                                                                                  • See Also

                                                                                                    • https://core.telegram.org/bots/api#createnewstickerset

                                                                                                  method deleteChatPhoto

                                                                                                  deleteChatPhoto: (this: Context) => Promise<true>;
                                                                                                  • See Also

                                                                                                    • https://core.telegram.org/bots/api#deletechatphoto

                                                                                                  method deleteChatStickerSet

                                                                                                  deleteChatStickerSet: (this: Context) => Promise<true>;
                                                                                                  • See Also

                                                                                                    • https://core.telegram.org/bots/api#deletechatstickerset

                                                                                                  method deleteMessage

                                                                                                  deleteMessage: (this: Context, messageId?: number) => Promise<true>;
                                                                                                  • See Also

                                                                                                    • https://core.telegram.org/bots/api#deletemessage

                                                                                                  method deleteStickerFromSet

                                                                                                  deleteStickerFromSet: (this: Context, sticker: string) => Promise<true>;
                                                                                                  editChatInviteLink: (
                                                                                                  this: Context,
                                                                                                  inviteLink: string,
                                                                                                  extra?: tt.ExtraEditChatInviteLink
                                                                                                  ) => Promise<tg.ChatInviteLink>;
                                                                                                  • See Also

                                                                                                    • https://core.telegram.org/bots/api#editchatinvitelink

                                                                                                  method editMessageCaption

                                                                                                  editMessageCaption: (
                                                                                                  this: Context,
                                                                                                  caption: string | undefined,
                                                                                                  extra?: tt.ExtraEditMessageCaption
                                                                                                  ) => Promise<true | (tg.Update.Edited & tg.Message.CaptionableMessage)>;
                                                                                                  • See Also

                                                                                                    • https://core.telegram.org/bots/api#editmessagecaption

                                                                                                  method editMessageLiveLocation

                                                                                                  editMessageLiveLocation: (
                                                                                                  this: Context,
                                                                                                  latitude: number,
                                                                                                  longitude: number,
                                                                                                  extra?: tt.ExtraEditMessageLiveLocation
                                                                                                  ) => Promise<true | (tg.Update.Edited & tg.Message.LocationMessage)>;
                                                                                                  • See Also

                                                                                                    • https://core.telegram.org/bots/api#editmessagelivelocation

                                                                                                  method editMessageMedia

                                                                                                  editMessageMedia: (
                                                                                                  this: Context,
                                                                                                  media: any,
                                                                                                  extra?: tt.ExtraEditMessageMedia
                                                                                                  ) => Promise<
                                                                                                  | true
                                                                                                  | (tg.Update.Edited & tg.Message.AnimationMessage)
                                                                                                  | (tg.Update.Edited & tg.Message.DocumentMessage)
                                                                                                  | (tg.Update.Edited & tg.Message.AudioMessage)
                                                                                                  | (tg.Update.Edited & tg.Message.PhotoMessage)
                                                                                                  | (tg.Update.Edited & tg.Message.VideoMessage)
                                                                                                  >;
                                                                                                  • See Also

                                                                                                    • https://core.telegram.org/bots/api#editmessagemedia

                                                                                                  method editMessageReplyMarkup

                                                                                                  editMessageReplyMarkup: (
                                                                                                  this: Context,
                                                                                                  markup: tg.InlineKeyboardMarkup | undefined
                                                                                                  ) => Promise<true | (tg.Update.Edited & tg.Message)>;
                                                                                                  • See Also

                                                                                                    • https://core.telegram.org/bots/api#editmessagereplymarkup

                                                                                                  method editMessageText

                                                                                                  editMessageText: (
                                                                                                  this: Context,
                                                                                                  text: string,
                                                                                                  extra?: tt.ExtraEditMessageText
                                                                                                  ) => Promise<true | (tg.Update.Edited & tg.Message.TextMessage)>;
                                                                                                  • See Also

                                                                                                    • https://core.telegram.org/bots/api#editmessagetext

                                                                                                  exportChatInviteLink: (this: Context) => Promise<string>;
                                                                                                  • See Also

                                                                                                    • https://core.telegram.org/bots/api#exportchatinvitelink

                                                                                                  method forwardMessage

                                                                                                  forwardMessage: (
                                                                                                  this: Context,
                                                                                                  chatId: string | number,
                                                                                                  extra?: { disable_notification?: boolean }
                                                                                                  ) => Promise<tg.Message>;
                                                                                                  • See Also

                                                                                                    • https://core.telegram.org/bots/api#forwardmessage

                                                                                                  method getChat

                                                                                                  getChat: (this: Context) => Promise<tg.ChatFromGetChat>;
                                                                                                  • See Also

                                                                                                    • https://core.telegram.org/bots/api#getchat

                                                                                                  method getChatAdministrators

                                                                                                  getChatAdministrators: (this: Context) => Promise<tg.ChatMember[]>;
                                                                                                  • See Also

                                                                                                    • https://core.telegram.org/bots/api#getchatadministrators

                                                                                                  method getChatMember

                                                                                                  getChatMember: (this: Context, userId: number) => Promise<tg.ChatMember>;
                                                                                                  • See Also

                                                                                                    • https://core.telegram.org/bots/api#getchatmember

                                                                                                  method getChatMembersCount

                                                                                                  getChatMembersCount: (this: Context) => Promise<number>;
                                                                                                  • See Also

                                                                                                    • https://core.telegram.org/bots/api#getchatmembercount

                                                                                                  method getMyCommands

                                                                                                  getMyCommands: (this: Context) => Promise<tg.BotCommand[]>;

                                                                                                  method getStickerSet

                                                                                                  getStickerSet: (this: Context, setName: string) => Promise<tg.StickerSet>;

                                                                                                  method kickChatMember

                                                                                                  kickChatMember: (
                                                                                                  this: Context,
                                                                                                  userId: number,
                                                                                                  untilDate?: number,
                                                                                                  extra?: tt.ExtraKickChatMember
                                                                                                  ) => Promise<true>;
                                                                                                  • See Also

                                                                                                    • https://core.telegram.org/bots/api#banchatmember

                                                                                                  method leaveChat

                                                                                                  leaveChat: (this: Context) => Promise<true>;
                                                                                                  • See Also

                                                                                                    • https://core.telegram.org/bots/api#leavechat

                                                                                                  method pinChatMessage

                                                                                                  pinChatMessage: (
                                                                                                  this: Context,
                                                                                                  messageId: number,
                                                                                                  extra?: { disable_notification?: boolean }
                                                                                                  ) => Promise<true>;
                                                                                                  • See Also

                                                                                                    • https://core.telegram.org/bots/api#pinchatmessage

                                                                                                  method promoteChatMember

                                                                                                  promoteChatMember: (
                                                                                                  this: Context,
                                                                                                  userId: number,
                                                                                                  extra: tt.ExtraPromoteChatMember
                                                                                                  ) => Promise<true>;
                                                                                                  • See Also

                                                                                                    • https://core.telegram.org/bots/api#promotechatmember

                                                                                                  method reply

                                                                                                  reply: (
                                                                                                  this: Context,
                                                                                                  text: string,
                                                                                                  extra?: tt.ExtraReplyMessage
                                                                                                  ) => Promise<tg.Message.TextMessage>;
                                                                                                  • See Also

                                                                                                    • https://core.telegram.org/bots/api#sendmessage

                                                                                                  method replyWithAnimation

                                                                                                  replyWithAnimation: (
                                                                                                  this: Context,
                                                                                                  animation: any,
                                                                                                  extra?: tt.ExtraAnimation
                                                                                                  ) => Promise<tg.Message.AnimationMessage>;
                                                                                                  • See Also

                                                                                                    • https://core.telegram.org/bots/api#replywithanimation

                                                                                                  method replyWithAudio

                                                                                                  replyWithAudio: (
                                                                                                  this: Context,
                                                                                                  audio: any,
                                                                                                  extra?: tt.ExtraAudio
                                                                                                  ) => Promise<tg.Message.AudioMessage>;
                                                                                                  • See Also

                                                                                                    • https://core.telegram.org/bots/api#replywithaudio

                                                                                                  method replyWithChatAction

                                                                                                  replyWithChatAction: (this: Context, action: any) => Promise<true>;
                                                                                                  • See Also

                                                                                                    • https://core.telegram.org/bots/api#replywithchataction

                                                                                                  method replyWithContact

                                                                                                  replyWithContact: (
                                                                                                  this: Context,
                                                                                                  phoneNumber: string,
                                                                                                  firstName: string,
                                                                                                  extra?: tt.ExtraContact
                                                                                                  ) => Promise<tg.Message.ContactMessage>;
                                                                                                  • See Also

                                                                                                    • https://core.telegram.org/bots/api#replywithcontact

                                                                                                  method replyWithDice

                                                                                                  replyWithDice: (
                                                                                                  this: Context,
                                                                                                  extra?: tt.ExtraDice
                                                                                                  ) => Promise<tg.Message.DiceMessage>;
                                                                                                  • See Also

                                                                                                    • https://core.telegram.org/bots/api#replywithdice

                                                                                                  method replyWithDocument

                                                                                                  replyWithDocument: (
                                                                                                  this: Context,
                                                                                                  document: any,
                                                                                                  extra?: tt.ExtraDocument
                                                                                                  ) => Promise<tg.Message.DocumentMessage>;
                                                                                                  • See Also

                                                                                                    • https://core.telegram.org/bots/api#replywithdocument

                                                                                                  method replyWithGame

                                                                                                  replyWithGame: (
                                                                                                  this: Context,
                                                                                                  gameName: string,
                                                                                                  extra?: tt.ExtraGame
                                                                                                  ) => Promise<tg.Message.GameMessage>;
                                                                                                  • See Also

                                                                                                    • https://core.telegram.org/bots/api#replywithgame

                                                                                                  method replyWithHTML

                                                                                                  replyWithHTML: (
                                                                                                  this: Context,
                                                                                                  html: string,
                                                                                                  extra?: tt.ExtraReplyMessage
                                                                                                  ) => Promise<tg.Message.TextMessage>;
                                                                                                  • See Also

                                                                                                    • https://core.telegram.org/bots/api#sendmessage

                                                                                                  method replyWithInvoice

                                                                                                  replyWithInvoice: (
                                                                                                  this: Context,
                                                                                                  invoice: tt.NewInvoiceParameters,
                                                                                                  extra?: tt.ExtraInvoice
                                                                                                  ) => Promise<tg.Message.InvoiceMessage>;
                                                                                                  • See Also

                                                                                                    • https://core.telegram.org/bots/api#replywithinvoice

                                                                                                  method replyWithLocation

                                                                                                  replyWithLocation: (
                                                                                                  this: Context,
                                                                                                  latitude: number,
                                                                                                  longitude: number,
                                                                                                  extra?: tt.ExtraLocation
                                                                                                  ) => Promise<tg.Message.LocationMessage>;
                                                                                                  • See Also

                                                                                                    • https://core.telegram.org/bots/api#replywithlocation

                                                                                                  method replyWithMarkdown

                                                                                                  replyWithMarkdown: (
                                                                                                  this: Context,
                                                                                                  markdown: string,
                                                                                                  extra?: tt.ExtraReplyMessage
                                                                                                  ) => Promise<tg.Message.TextMessage>;
                                                                                                  • See Also

                                                                                                    • https://core.telegram.org/bots/api#sendmessage

                                                                                                  method replyWithMarkdownV2

                                                                                                  replyWithMarkdownV2: (
                                                                                                  this: Context,
                                                                                                  markdown: string,
                                                                                                  extra?: tt.ExtraReplyMessage
                                                                                                  ) => Promise<tg.Message.TextMessage>;
                                                                                                  • See Also

                                                                                                    • https://core.telegram.org/bots/api#sendmessage

                                                                                                  method replyWithMediaGroup

                                                                                                  replyWithMediaGroup: (
                                                                                                  this: Context,
                                                                                                  media: readonly any[] | readonly any[],
                                                                                                  extra?: tt.ExtraMediaGroup
                                                                                                  ) => Promise<
                                                                                                  (
                                                                                                  | tg.Message.DocumentMessage
                                                                                                  | tg.Message.AudioMessage
                                                                                                  | tg.Message.PhotoMessage
                                                                                                  | tg.Message.VideoMessage
                                                                                                  )[]
                                                                                                  >;
                                                                                                  • See Also

                                                                                                    • https://core.telegram.org/bots/api#replywithmediagroup

                                                                                                  method replyWithPhoto

                                                                                                  replyWithPhoto: (
                                                                                                  this: Context,
                                                                                                  photo: any,
                                                                                                  extra?: tt.ExtraPhoto
                                                                                                  ) => Promise<tg.Message.PhotoMessage>;
                                                                                                  • See Also

                                                                                                    • https://core.telegram.org/bots/api#replywithphoto

                                                                                                  method replyWithPoll

                                                                                                  replyWithPoll: (
                                                                                                  this: Context,
                                                                                                  question: string,
                                                                                                  options: readonly string[],
                                                                                                  extra?: tt.ExtraPoll
                                                                                                  ) => Promise<tg.Message.PollMessage>;
                                                                                                  • See Also

                                                                                                    • https://core.telegram.org/bots/api#replywithpoll

                                                                                                  method replyWithQuiz

                                                                                                  replyWithQuiz: (
                                                                                                  this: Context,
                                                                                                  question: string,
                                                                                                  options: readonly string[],
                                                                                                  extra: tt.ExtraPoll
                                                                                                  ) => Promise<tg.Message.PollMessage>;
                                                                                                  • See Also

                                                                                                    • https://core.telegram.org/bots/api#replywithquiz

                                                                                                  method replyWithSticker

                                                                                                  replyWithSticker: (
                                                                                                  this: Context,
                                                                                                  sticker: any,
                                                                                                  extra?: tt.ExtraSticker
                                                                                                  ) => Promise<tg.Message.StickerMessage>;
                                                                                                  • See Also

                                                                                                    • https://core.telegram.org/bots/api#replywithsticker

                                                                                                  method replyWithVenue

                                                                                                  replyWithVenue: (
                                                                                                  this: Context,
                                                                                                  latitude: number,
                                                                                                  longitude: number,
                                                                                                  title: string,
                                                                                                  address: string,
                                                                                                  extra?: tt.ExtraVenue
                                                                                                  ) => Promise<tg.Message.VenueMessage>;
                                                                                                  • See Also

                                                                                                    • https://core.telegram.org/bots/api#replywithvenue

                                                                                                  method replyWithVideo

                                                                                                  replyWithVideo: (
                                                                                                  this: Context,
                                                                                                  video: any,
                                                                                                  extra?: tt.ExtraVideo
                                                                                                  ) => Promise<tg.Message.VideoMessage>;
                                                                                                  • See Also

                                                                                                    • https://core.telegram.org/bots/api#replywithvideo

                                                                                                  method replyWithVideoNote

                                                                                                  replyWithVideoNote: (
                                                                                                  this: Context,
                                                                                                  videoNote: string | tg.InputFileVideoNote,
                                                                                                  extra?: tt.ExtraVideoNote
                                                                                                  ) => Promise<tg.Message.VideoNoteMessage>;
                                                                                                  • See Also

                                                                                                    • https://core.telegram.org/bots/api#replywithvideonote

                                                                                                  method replyWithVoice

                                                                                                  replyWithVoice: (
                                                                                                  this: Context,
                                                                                                  voice: any,
                                                                                                  extra?: tt.ExtraVoice
                                                                                                  ) => Promise<tg.Message.VoiceMessage>;
                                                                                                  • See Also

                                                                                                    • https://core.telegram.org/bots/api#replywithvoice

                                                                                                  method restrictChatMember

                                                                                                  restrictChatMember: (
                                                                                                  this: Context,
                                                                                                  userId: number,
                                                                                                  extra: tt.ExtraRestrictChatMember
                                                                                                  ) => Promise<true>;
                                                                                                  • See Also

                                                                                                    • https://core.telegram.org/bots/api#restrictchatmember

                                                                                                  revokeChatInviteLink: (
                                                                                                  this: Context,
                                                                                                  inviteLink: string
                                                                                                  ) => Promise<tg.ChatInviteLink>;
                                                                                                  • See Also

                                                                                                    • https://core.telegram.org/bots/api#revokechatinvitelink

                                                                                                  method setChatAdministratorCustomTitle

                                                                                                  setChatAdministratorCustomTitle: (
                                                                                                  this: Context,
                                                                                                  userId: number,
                                                                                                  title: string
                                                                                                  ) => Promise<true>;
                                                                                                  • See Also

                                                                                                    • https://core.telegram.org/bots/api#setchatadministratorcustomtitle

                                                                                                  method setChatDescription

                                                                                                  setChatDescription: (this: Context, description?: string) => Promise<true>;
                                                                                                  • See Also

                                                                                                    • https://core.telegram.org/bots/api#setchatdescription

                                                                                                  method setChatPermissions

                                                                                                  setChatPermissions: (this: Context, permissions: any) => Promise<true>;
                                                                                                  • See Also

                                                                                                    • https://core.telegram.org/bots/api#setchatpermissions

                                                                                                  method setChatPhoto

                                                                                                  setChatPhoto: (this: Context, photo: any) => Promise<true>;
                                                                                                  • See Also

                                                                                                    • https://core.telegram.org/bots/api#setchatphoto

                                                                                                  method setChatStickerSet

                                                                                                  setChatStickerSet: (this: Context, setName: string) => Promise<true>;
                                                                                                  • See Also

                                                                                                    • https://core.telegram.org/bots/api#setchatstickerset

                                                                                                  method setChatTitle

                                                                                                  setChatTitle: (this: Context, title: string) => Promise<true>;
                                                                                                  • See Also

                                                                                                    • https://core.telegram.org/bots/api#setchattitle

                                                                                                  method setMyCommands

                                                                                                  setMyCommands: (
                                                                                                  this: Context,
                                                                                                  commands: readonly tg.BotCommand[]
                                                                                                  ) => Promise<true>;

                                                                                                  method setPassportDataErrors

                                                                                                  setPassportDataErrors: (
                                                                                                  this: Context,
                                                                                                  errors: readonly tg.PassportElementError[]
                                                                                                  ) => Promise<true>;
                                                                                                  • See Also

                                                                                                    • https://core.telegram.org/bots/api#setpassportdataerrors

                                                                                                  method setStickerPositionInSet

                                                                                                  setStickerPositionInSet: (
                                                                                                  this: Context,
                                                                                                  sticker: string,
                                                                                                  position: number
                                                                                                  ) => Promise<true>;

                                                                                                  method setStickerSetThumb

                                                                                                  setStickerSetThumb: (
                                                                                                  this: Context,
                                                                                                  name: string,
                                                                                                  userId: number,
                                                                                                  thumb: any
                                                                                                  ) => Promise<true>;

                                                                                                  method stopMessageLiveLocation

                                                                                                  stopMessageLiveLocation: (
                                                                                                  this: Context,
                                                                                                  markup?: any
                                                                                                  ) => Promise<true | (tg.Update.Edited & tg.Message.LocationMessage)>;
                                                                                                  • See Also

                                                                                                    • https://core.telegram.org/bots/api#stopmessagelivelocation

                                                                                                  method stopPoll

                                                                                                  stopPoll: (
                                                                                                  this: Context,
                                                                                                  messageId: number,
                                                                                                  extra?: tt.ExtraStopPoll
                                                                                                  ) => Promise<tg.Poll>;
                                                                                                  • See Also

                                                                                                    • https://core.telegram.org/bots/api#stoppoll

                                                                                                  method unbanChatMember

                                                                                                  unbanChatMember: (
                                                                                                  this: Context,
                                                                                                  userId: number,
                                                                                                  extra?: { only_if_banned?: boolean }
                                                                                                  ) => Promise<true>;
                                                                                                  • See Also

                                                                                                    • https://core.telegram.org/bots/api#unbanchatmember

                                                                                                  method unpinAllChatMessages

                                                                                                  unpinAllChatMessages: (this: Context) => Promise<true>;
                                                                                                  • See Also

                                                                                                    • https://core.telegram.org/bots/api#unpinallchatmessages

                                                                                                  method unpinChatMessage

                                                                                                  unpinChatMessage: (this: Context, messageId?: number) => Promise<true>;
                                                                                                  • See Also

                                                                                                    • https://core.telegram.org/bots/api#unpinchatmessage

                                                                                                  method uploadStickerFile

                                                                                                  uploadStickerFile: (this: Context, stickerFile: any) => Promise<tg.File>;
                                                                                                  • See Also

                                                                                                    • https://core.telegram.org/bots/api#uploadstickerfile

                                                                                                  class MemorySessionStore

                                                                                                  class MemorySessionStore<T> implements SessionStore<T> {}
                                                                                                  • Deprecated

                                                                                                    https://github.com/telegraf/telegraf/issues/1372#issuecomment-782668499

                                                                                                  constructor

                                                                                                  constructor(ttl?: number);

                                                                                                    method delete

                                                                                                    delete: (name: string) => void;

                                                                                                      method get

                                                                                                      get: (name: string) => T | undefined;

                                                                                                        method set

                                                                                                        set: (name: string, value: T) => void;

                                                                                                          class Router

                                                                                                          class Router<C extends Context> implements MiddlewareObj<C> {}

                                                                                                            constructor

                                                                                                            constructor(routeFn: RouteFn<C>, handlers?: Map<string, Middleware<C>>);

                                                                                                              property handlers

                                                                                                              handlers: Map<string, Middleware<C>>;

                                                                                                                method middleware

                                                                                                                middleware: () => import('./middleware').MiddlewareFn<C>;

                                                                                                                  method on

                                                                                                                  on: (route: string, fns_0: Middleware<C>, ...fns_1: Middleware<C>[]) => this;

                                                                                                                    method otherwise

                                                                                                                    otherwise: (fns_0: Middleware<C>, ...fns_1: Middleware<C>[]) => this;

                                                                                                                      class Telegraf

                                                                                                                      class Telegraf<C extends Context = Context> extends Composer<C> {}

                                                                                                                        constructor

                                                                                                                        constructor(token: string, options?: Partial<Telegraf.Options<C>>);

                                                                                                                          property botInfo

                                                                                                                          botInfo?: any;
                                                                                                                          • Set manually to avoid implicit getMe call in launch or webhookCallback

                                                                                                                          property context

                                                                                                                          readonly context: Partial<C>;

                                                                                                                            property telegram

                                                                                                                            telegram: Telegram;

                                                                                                                              property webhookReply

                                                                                                                              webhookReply: boolean;

                                                                                                                                method catch

                                                                                                                                catch: (handler: (err: unknown, ctx: C) => MaybePromise<void>) => this;
                                                                                                                                • _Override_ error handling

                                                                                                                                method handleUpdate

                                                                                                                                handleUpdate: (update: any, webhookResponse?: any) => Promise<void>;

                                                                                                                                  method launch

                                                                                                                                  launch: (config?: Telegraf.LaunchOptions) => Promise<void>;
                                                                                                                                  • See Also

                                                                                                                                    • https://github.com/telegraf/telegraf/discussions/1344#discussioncomment-335700

                                                                                                                                  method secretPathComponent

                                                                                                                                  secretPathComponent: () => string;

                                                                                                                                    method stop

                                                                                                                                    stop: (reason?: string) => void;

                                                                                                                                      method webhookCallback

                                                                                                                                      webhookCallback: (
                                                                                                                                      path?: string
                                                                                                                                      ) => (
                                                                                                                                      req: http.IncomingMessage & { body?: tg.Update | undefined },
                                                                                                                                      res: any,
                                                                                                                                      next?: () => void
                                                                                                                                      ) => Promise<void>;

                                                                                                                                        class Telegram

                                                                                                                                        class Telegram extends ApiClient {}

                                                                                                                                          method addStickerToSet

                                                                                                                                          addStickerToSet: (
                                                                                                                                          ownerId: number,
                                                                                                                                          name: string,
                                                                                                                                          stickerData: tt.ExtraAddStickerToSet
                                                                                                                                          ) => Promise<true>;
                                                                                                                                          • Add a new sticker to a set created by the bot

                                                                                                                                            Parameter ownerId

                                                                                                                                            User identifier of sticker set owner

                                                                                                                                            Parameter name

                                                                                                                                            Sticker set name

                                                                                                                                          method answerCbQuery

                                                                                                                                          answerCbQuery: (
                                                                                                                                          callbackQueryId: string,
                                                                                                                                          text?: string,
                                                                                                                                          extra?: tt.ExtraAnswerCbQuery
                                                                                                                                          ) => Promise<true>;

                                                                                                                                            method answerGameQuery

                                                                                                                                            answerGameQuery: (callbackQueryId: string, url: string) => Promise<true>;

                                                                                                                                              method answerInlineQuery

                                                                                                                                              answerInlineQuery: (
                                                                                                                                              inlineQueryId: string,
                                                                                                                                              results: readonly tg.InlineQueryResult[],
                                                                                                                                              extra?: tt.ExtraAnswerInlineQuery
                                                                                                                                              ) => Promise<true>;
                                                                                                                                              • Send answers to an inline query. No more than 50 results per query are allowed.

                                                                                                                                              method answerPreCheckoutQuery

                                                                                                                                              answerPreCheckoutQuery: (
                                                                                                                                              preCheckoutQueryId: string,
                                                                                                                                              ok: boolean,
                                                                                                                                              errorMessage?: string
                                                                                                                                              ) => Promise<true>;
                                                                                                                                              • Once the user has confirmed their payment and shipping details, the Bot API sends the final confirmation in the form of an Update with the field pre_checkout_query. Respond to such pre-checkout queries. On success, True is returned. Note: The Bot API must receive an answer within 10 seconds after the pre-checkout query was sent.

                                                                                                                                                Parameter ok

                                                                                                                                                Specify True if everything is alright (goods are available, etc.) and the bot is ready to proceed with the order. Use False if there are any problems.

                                                                                                                                                Parameter errorMessage

                                                                                                                                                Required if ok is False. Error message in human readable form that explains the reason for failure to proceed with the checkout (e.g. "Sorry, somebody just bought the last of our amazing black T-shirts while you were busy filling out your payment details. Please choose a different color or garment!"). Telegram will display this message to the user.

                                                                                                                                              method answerShippingQuery

                                                                                                                                              answerShippingQuery: (
                                                                                                                                              shippingQueryId: string,
                                                                                                                                              ok: boolean,
                                                                                                                                              shippingOptions: readonly tg.ShippingOption[] | undefined,
                                                                                                                                              errorMessage: string | undefined
                                                                                                                                              ) => Promise<true>;
                                                                                                                                              • If you sent an invoice requesting a shipping address and the parameter is_flexible was specified, the Bot API will send an Update with a shipping_query field to the bot. Reply to shipping queries.

                                                                                                                                                Parameter ok

                                                                                                                                                Specify True if delivery to the specified address is possible and False if there are any problems (for example, if delivery to the specified address is not possible)

                                                                                                                                                Parameter shippingOptions

                                                                                                                                                Required if ok is True. A JSON-serialized array of available shipping options.

                                                                                                                                                Parameter errorMessage

                                                                                                                                                Required if ok is False. Error message in human readable form that explains why it is impossible to complete the order (e.g. "Sorry, delivery to your desired address is unavailable'). Telegram will display this message to the user.

                                                                                                                                              method close

                                                                                                                                              close: () => Promise<true>;
                                                                                                                                              • Close the bot instance before moving it from one local server to another

                                                                                                                                              method copyMessage

                                                                                                                                              copyMessage: (
                                                                                                                                              chatId: number | string,
                                                                                                                                              fromChatId: number | string,
                                                                                                                                              messageId: number,
                                                                                                                                              extra?: tt.ExtraCopyMessage
                                                                                                                                              ) => Promise<tg.MessageId>;
                                                                                                                                              • Send copy of existing message

                                                                                                                                                Parameter chatId

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

                                                                                                                                                Parameter fromChatId

                                                                                                                                                Unique identifier for the chat where the original message was sent (or channel username in the format @channelusername)

                                                                                                                                                Parameter messageId

                                                                                                                                                Message identifier in the chat specified in from_chat_id

                                                                                                                                              createChatInviteLink: (
                                                                                                                                              chatId: number | string,
                                                                                                                                              extra?: tt.ExtraCreateChatInviteLink
                                                                                                                                              ) => Promise<tg.ChatInviteLink>;

                                                                                                                                                method createNewStickerSet

                                                                                                                                                createNewStickerSet: (
                                                                                                                                                ownerId: number,
                                                                                                                                                name: string,
                                                                                                                                                title: string,
                                                                                                                                                stickerData: tt.ExtraCreateNewStickerSet
                                                                                                                                                ) => Promise<true>;
                                                                                                                                                • Create new sticker set owned by a user. The bot will be able to edit the created sticker set

                                                                                                                                                  Parameter ownerId

                                                                                                                                                  User identifier of created sticker set owner

                                                                                                                                                  Parameter name

                                                                                                                                                  Short name of sticker set, to be used in t.me/addstickers/ URLs (e.g., animals). Can contain only english letters, digits and underscores. Must begin with a letter, can't contain consecutive underscores and must end in “_by_<bot username>”. <bot_username> is case insensitive. 1-64 characters.

                                                                                                                                                  Parameter title

                                                                                                                                                  Sticker set title, 1-64 characters

                                                                                                                                                method deleteChatPhoto

                                                                                                                                                deleteChatPhoto: (chatId: number | string) => Promise<true>;

                                                                                                                                                  method deleteChatStickerSet

                                                                                                                                                  deleteChatStickerSet: (chatId: number | string) => Promise<true>;

                                                                                                                                                    method deleteMessage

                                                                                                                                                    deleteMessage: (chatId: number | string, messageId: number) => Promise<true>;
                                                                                                                                                    • 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. - Bots can delete outgoing messages in groups and supergroups. - 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.

                                                                                                                                                      Parameter chatId

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

                                                                                                                                                    method deleteMyCommands

                                                                                                                                                    deleteMyCommands: (extra?: any) => Promise<true>;

                                                                                                                                                      method deleteStickerFromSet

                                                                                                                                                      deleteStickerFromSet: (sticker: string) => Promise<true>;
                                                                                                                                                      • Delete a sticker from a set created by the bot.

                                                                                                                                                        Parameter sticker

                                                                                                                                                        File identifier of the sticker

                                                                                                                                                      method deleteWebhook

                                                                                                                                                      deleteWebhook: (extra?: { drop_pending_updates?: boolean }) => Promise<true>;
                                                                                                                                                      • Remove webhook integration

                                                                                                                                                      editChatInviteLink: (
                                                                                                                                                      chatId: number | string,
                                                                                                                                                      inviteLink: string,
                                                                                                                                                      extra?: tt.ExtraEditChatInviteLink
                                                                                                                                                      ) => Promise<tg.ChatInviteLink>;

                                                                                                                                                        method editMessageCaption

                                                                                                                                                        editMessageCaption: (
                                                                                                                                                        chatId: number | string | undefined,
                                                                                                                                                        messageId: number | undefined,
                                                                                                                                                        inlineMessageId: string | undefined,
                                                                                                                                                        caption: string | undefined,
                                                                                                                                                        extra?: tt.ExtraEditMessageCaption
                                                                                                                                                        ) => Promise<true | (tg.Update.Edited & tg.Message.CaptionableMessage)>;
                                                                                                                                                        • Edit captions of messages sent by the bot or via the bot (for inline bots). On success, if edited message is sent by the bot, the edited Message is returned, otherwise True is returned.

                                                                                                                                                          Parameter chatId

                                                                                                                                                          Required if inlineMessageId is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername)

                                                                                                                                                          Parameter messageId

                                                                                                                                                          Required if inlineMessageId is not specified. Identifier of the sent message

                                                                                                                                                          Parameter inlineMessageId

                                                                                                                                                          Required if chatId and messageId are not specified. Identifier of the inline message

                                                                                                                                                          Parameter caption

                                                                                                                                                          New caption of the message

                                                                                                                                                          Parameter markup

                                                                                                                                                          A JSON-serialized object for an inline keyboard.

                                                                                                                                                        method editMessageLiveLocation

                                                                                                                                                        editMessageLiveLocation: (
                                                                                                                                                        chatId: number | string | undefined,
                                                                                                                                                        messageId: number | undefined,
                                                                                                                                                        inlineMessageId: string | undefined,
                                                                                                                                                        latitude: number,
                                                                                                                                                        longitude: number,
                                                                                                                                                        extra?: tt.ExtraEditMessageLiveLocation
                                                                                                                                                        ) => Promise<true | (tg.Update.Edited & tg.Message.LocationMessage)>;

                                                                                                                                                          method editMessageMedia

                                                                                                                                                          editMessageMedia: (
                                                                                                                                                          chatId: number | string | undefined,
                                                                                                                                                          messageId: number | undefined,
                                                                                                                                                          inlineMessageId: string | undefined,
                                                                                                                                                          media: any,
                                                                                                                                                          extra?: tt.ExtraEditMessageMedia
                                                                                                                                                          ) => Promise<
                                                                                                                                                          | true
                                                                                                                                                          | (tg.Update.Edited & tg.Message.AnimationMessage)
                                                                                                                                                          | (tg.Update.Edited & tg.Message.DocumentMessage)
                                                                                                                                                          | (tg.Update.Edited & tg.Message.AudioMessage)
                                                                                                                                                          | (tg.Update.Edited & tg.Message.PhotoMessage)
                                                                                                                                                          | (tg.Update.Edited & tg.Message.VideoMessage)
                                                                                                                                                          >;
                                                                                                                                                          • Edit animation, audio, document, photo, or video messages. If a message is a part of a message album, then it can be edited only to a photo or a video. Otherwise, message type can be changed arbitrarily. When inline message is edited, new file can't be uploaded. Use previously uploaded file via its file_id or specify a URL.

                                                                                                                                                            Parameter chatId

                                                                                                                                                            Required if inlineMessageId is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername)

                                                                                                                                                            Parameter messageId

                                                                                                                                                            Required if inlineMessageId is not specified. Identifier of the sent message

                                                                                                                                                            Parameter inlineMessageId

                                                                                                                                                            Required if chatId and messageId are not specified. Identifier of the inline message

                                                                                                                                                            Parameter media

                                                                                                                                                            New media of message

                                                                                                                                                            Parameter markup

                                                                                                                                                            Markup of inline keyboard

                                                                                                                                                          method editMessageReplyMarkup

                                                                                                                                                          editMessageReplyMarkup: (
                                                                                                                                                          chatId: number | string | undefined,
                                                                                                                                                          messageId: number | undefined,
                                                                                                                                                          inlineMessageId: string | undefined,
                                                                                                                                                          markup: tg.InlineKeyboardMarkup | undefined
                                                                                                                                                          ) => Promise<true | (tg.Update.Edited & tg.Message)>;
                                                                                                                                                          • Edit only the reply markup of messages sent by the bot or via the bot (for inline bots).

                                                                                                                                                            Parameter chatId

                                                                                                                                                            Required if inlineMessageId is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername)

                                                                                                                                                            Parameter messageId

                                                                                                                                                            Required if inlineMessageId is not specified. Identifier of the sent message

                                                                                                                                                            Parameter inlineMessageId

                                                                                                                                                            Required if chatId and messageId are not specified. Identifier of the inline message

                                                                                                                                                            Parameter markup

                                                                                                                                                            A JSON-serialized object for an inline keyboard.

                                                                                                                                                            Returns

                                                                                                                                                            If edited message is sent by the bot, the edited Message is returned, otherwise True is returned.

                                                                                                                                                          method editMessageText

                                                                                                                                                          editMessageText: (
                                                                                                                                                          chatId: number | string | undefined,
                                                                                                                                                          messageId: number | undefined,
                                                                                                                                                          inlineMessageId: string | undefined,
                                                                                                                                                          text: string,
                                                                                                                                                          extra?: tt.ExtraEditMessageText
                                                                                                                                                          ) => Promise<true | (tg.Update.Edited & tg.Message.TextMessage)>;
                                                                                                                                                          • Edit text and game messages sent by the bot or via the bot (for inline bots). On success, if edited message is sent by the bot, the edited Message is returned, otherwise True is returned.

                                                                                                                                                            Parameter chatId

                                                                                                                                                            Required if inlineMessageId is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername)

                                                                                                                                                            Parameter messageId

                                                                                                                                                            Required if inlineMessageId is not specified. Identifier of the sent message

                                                                                                                                                            Parameter inlineMessageId

                                                                                                                                                            Required if chatId and messageId are not specified. Identifier of the inline message

                                                                                                                                                            Parameter text

                                                                                                                                                            New text of the message

                                                                                                                                                          exportChatInviteLink: (chatId: number | string) => Promise<string>;
                                                                                                                                                          • Export an invite link to a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.

                                                                                                                                                            Parameter chatId

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

                                                                                                                                                          method forwardMessage

                                                                                                                                                          forwardMessage: (
                                                                                                                                                          chatId: number | string,
                                                                                                                                                          fromChatId: number | string,
                                                                                                                                                          messageId: number,
                                                                                                                                                          extra?: { disable_notification?: boolean }
                                                                                                                                                          ) => Promise<tg.Message>;
                                                                                                                                                          • Forward existing message.

                                                                                                                                                            Parameter chatId

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

                                                                                                                                                            Parameter fromChatId

                                                                                                                                                            Unique identifier for the chat where the original message was sent (or channel username in the format @channelusername)

                                                                                                                                                            Parameter messageId

                                                                                                                                                            Message identifier in the chat specified in from_chat_id

                                                                                                                                                          method getChat

                                                                                                                                                          getChat: (chatId: number | string) => Promise<tg.ChatFromGetChat>;
                                                                                                                                                          • Get up to date information about the chat (current name of the user for one-on-one conversations, current username of a user, group or channel, etc.)

                                                                                                                                                            Parameter chatId

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

                                                                                                                                                          method getChatAdministrators

                                                                                                                                                          getChatAdministrators: (chatId: number | string) => Promise<tg.ChatMember[]>;
                                                                                                                                                          • Parameter chatId

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

                                                                                                                                                          method getChatMember

                                                                                                                                                          getChatMember: (
                                                                                                                                                          chatId: string | number,
                                                                                                                                                          userId: number
                                                                                                                                                          ) => Promise<tg.ChatMember>;
                                                                                                                                                          • Get information about a member of a chat.

                                                                                                                                                            Parameter chatId

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

                                                                                                                                                            Parameter userId

                                                                                                                                                            Unique identifier of the target user

                                                                                                                                                          method getChatMembersCount

                                                                                                                                                          getChatMembersCount: (chatId: string | number) => Promise<number>;
                                                                                                                                                          • Get the number of members in a chat

                                                                                                                                                            Parameter chatId

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

                                                                                                                                                          method getFile

                                                                                                                                                          getFile: (fileId: string) => Promise<tg.File>;
                                                                                                                                                          • Get basic info about a file and prepare it for downloading

                                                                                                                                                            Parameter fileId

                                                                                                                                                            Id of file to get link to

                                                                                                                                                          getFileLink: (fileId: string | tg.File) => Promise<URL>;
                                                                                                                                                          • Get download link to a file

                                                                                                                                                          method getGameHighScores

                                                                                                                                                          getGameHighScores: (
                                                                                                                                                          userId: number,
                                                                                                                                                          inlineMessageId: string | undefined,
                                                                                                                                                          chatId: number | undefined,
                                                                                                                                                          messageId: number | undefined
                                                                                                                                                          ) => Promise<tg.GameHighScore[]>;

                                                                                                                                                            method getMe

                                                                                                                                                            getMe: () => Promise<tg.UserFromGetMe>;
                                                                                                                                                            • Get basic information about the bot

                                                                                                                                                            method getMyCommands

                                                                                                                                                            getMyCommands: (extra?: any) => Promise<tg.BotCommand[]>;
                                                                                                                                                            • Get the current list of the bot's commands.

                                                                                                                                                            method getStickerSet

                                                                                                                                                            getStickerSet: (name: string) => Promise<tg.StickerSet>;

                                                                                                                                                              method getUpdates

                                                                                                                                                              getUpdates: (
                                                                                                                                                              timeout: number,
                                                                                                                                                              limit: number,
                                                                                                                                                              offset: number,
                                                                                                                                                              allowedUpdates: readonly tt.UpdateType[] | undefined
                                                                                                                                                              ) => Promise<tg.Update[]>;
                                                                                                                                                              • Directly request incoming updates. You should probably use Telegraf::launch instead.

                                                                                                                                                              method getUserProfilePhotos

                                                                                                                                                              getUserProfilePhotos: (
                                                                                                                                                              userId: number,
                                                                                                                                                              offset?: number,
                                                                                                                                                              limit?: number
                                                                                                                                                              ) => Promise<tg.UserProfilePhotos>;

                                                                                                                                                                method getWebhookInfo

                                                                                                                                                                getWebhookInfo: () => Promise<tg.WebhookInfo>;

                                                                                                                                                                  method kickChatMember

                                                                                                                                                                  kickChatMember: (
                                                                                                                                                                  chatId: number | string,
                                                                                                                                                                  userId: number,
                                                                                                                                                                  untilDate?: number,
                                                                                                                                                                  extra?: tt.ExtraKickChatMember
                                                                                                                                                                  ) => Promise<true>;
                                                                                                                                                                  • Kick a user from a group, a supergroup or a channel. In the case of supergroups and channels, the user will not be able to return to the group 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 admin rights

                                                                                                                                                                    Parameter chatId

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

                                                                                                                                                                    Parameter untilDate

                                                                                                                                                                    Date when the user will be unbanned, unix time. If user is banned for more than 366 days or less than 30 seconds from the current time they are considered to be banned forever

                                                                                                                                                                  method leaveChat

                                                                                                                                                                  leaveChat: (chatId: number | string) => Promise<true>;
                                                                                                                                                                  • Use this method for your bot to leave a group, supergroup or channel

                                                                                                                                                                    Parameter chatId

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

                                                                                                                                                                  method logOut

                                                                                                                                                                  logOut: () => Promise<true>;
                                                                                                                                                                  • Log out from the cloud Bot API server before launching the bot locally

                                                                                                                                                                  method pinChatMessage

                                                                                                                                                                  pinChatMessage: (
                                                                                                                                                                  chatId: number | string,
                                                                                                                                                                  messageId: number,
                                                                                                                                                                  extra?: { disable_notification?: boolean }
                                                                                                                                                                  ) => Promise<true>;
                                                                                                                                                                  • Pin a message in a group, a supergroup, or a channel. The bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' admin right in the supergroup or 'can_edit_messages' admin right in the channel.

                                                                                                                                                                    Parameter chatId

                                                                                                                                                                    Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)

                                                                                                                                                                  method promoteChatMember

                                                                                                                                                                  promoteChatMember: (
                                                                                                                                                                  chatId: number | string,
                                                                                                                                                                  userId: number,
                                                                                                                                                                  extra: tt.ExtraPromoteChatMember
                                                                                                                                                                  ) => Promise<true>;
                                                                                                                                                                  • Promote or demote a user in a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Pass False for all boolean parameters to demote a user.

                                                                                                                                                                    Parameter chatId

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

                                                                                                                                                                  method restrictChatMember

                                                                                                                                                                  restrictChatMember: (
                                                                                                                                                                  chatId: string | number,
                                                                                                                                                                  userId: number,
                                                                                                                                                                  extra: tt.ExtraRestrictChatMember
                                                                                                                                                                  ) => Promise<true>;
                                                                                                                                                                  • Restrict a user in a supergroup. The bot must be an administrator in the supergroup for this to work and must have the appropriate admin rights. Pass True for all boolean parameters to lift restrictions from a user.

                                                                                                                                                                    Parameter chatId

                                                                                                                                                                    Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)

                                                                                                                                                                  revokeChatInviteLink: (
                                                                                                                                                                  chatId: number | string,
                                                                                                                                                                  inviteLink: string
                                                                                                                                                                  ) => Promise<tg.ChatInviteLink>;

                                                                                                                                                                    method sendAnimation

                                                                                                                                                                    sendAnimation: (
                                                                                                                                                                    chatId: number | string,
                                                                                                                                                                    animation: any,
                                                                                                                                                                    extra?: tt.ExtraAnimation
                                                                                                                                                                    ) => Promise<tg.Message.AnimationMessage>;
                                                                                                                                                                    • Send .gif animations

                                                                                                                                                                      Parameter chatId

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

                                                                                                                                                                    method sendAudio

                                                                                                                                                                    sendAudio: (
                                                                                                                                                                    chatId: number | string,
                                                                                                                                                                    audio: any,
                                                                                                                                                                    extra?: tt.ExtraAudio
                                                                                                                                                                    ) => Promise<tg.Message.AudioMessage>;
                                                                                                                                                                    • Send audio files, if you want Telegram clients to display them in the music player. Your audio must be in the .mp3 format. Bots can currently send audio files of up to 50 MB in size, this limit may be changed in the future.

                                                                                                                                                                      Parameter chatId

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

                                                                                                                                                                    method sendChatAction

                                                                                                                                                                    sendChatAction: (chatId: number | string, action: any) => Promise<true>;
                                                                                                                                                                    • 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).

                                                                                                                                                                      Parameter chatId

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

                                                                                                                                                                    method sendContact

                                                                                                                                                                    sendContact: (
                                                                                                                                                                    chatId: number | string,
                                                                                                                                                                    phoneNumber: string,
                                                                                                                                                                    firstName: string,
                                                                                                                                                                    extra?: tt.ExtraContact
                                                                                                                                                                    ) => Promise<tg.Message.ContactMessage>;

                                                                                                                                                                      method sendCopy

                                                                                                                                                                      sendCopy: (
                                                                                                                                                                      chatId: number | string,
                                                                                                                                                                      message: any,
                                                                                                                                                                      extra?: tt.ExtraCopyMessage
                                                                                                                                                                      ) => Promise<tg.MessageId>;
                                                                                                                                                                      • Send copy of existing message.

                                                                                                                                                                        Parameter chatId

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

                                                                                                                                                                        Parameter message

                                                                                                                                                                        Received message object

                                                                                                                                                                        Deprecated

                                                                                                                                                                        use copyMessage instead

                                                                                                                                                                      method sendDice

                                                                                                                                                                      sendDice: (
                                                                                                                                                                      chatId: number | string,
                                                                                                                                                                      extra?: tt.ExtraDice
                                                                                                                                                                      ) => Promise<tg.Message.DiceMessage>;
                                                                                                                                                                      • Send a dice, which will have a random value from 1 to 6.

                                                                                                                                                                        Parameter chatId

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

                                                                                                                                                                      method sendDocument

                                                                                                                                                                      sendDocument: (
                                                                                                                                                                      chatId: number | string,
                                                                                                                                                                      document: any,
                                                                                                                                                                      extra?: tt.ExtraDocument
                                                                                                                                                                      ) => Promise<tg.Message.DocumentMessage>;
                                                                                                                                                                      • Send general files. Bots can currently send files of any type of up to 50 MB in size, this limit may be changed in the future.

                                                                                                                                                                        Parameter chatId

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

                                                                                                                                                                      method sendGame

                                                                                                                                                                      sendGame: (
                                                                                                                                                                      chatId: number,
                                                                                                                                                                      gameName: string,
                                                                                                                                                                      extra?: tt.ExtraGame
                                                                                                                                                                      ) => Promise<tg.Message.GameMessage>;
                                                                                                                                                                      • Parameter chatId

                                                                                                                                                                        Unique identifier for the target chat

                                                                                                                                                                        Parameter gameShortName

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

                                                                                                                                                                      method sendInvoice

                                                                                                                                                                      sendInvoice: (
                                                                                                                                                                      chatId: number | string,
                                                                                                                                                                      invoice: tt.NewInvoiceParameters,
                                                                                                                                                                      extra?: tt.ExtraInvoice
                                                                                                                                                                      ) => Promise<tg.Message.InvoiceMessage>;
                                                                                                                                                                      • Parameter chatId

                                                                                                                                                                        Unique identifier for the target private chat

                                                                                                                                                                      method sendLocation

                                                                                                                                                                      sendLocation: (
                                                                                                                                                                      chatId: number | string,
                                                                                                                                                                      latitude: number,
                                                                                                                                                                      longitude: number,
                                                                                                                                                                      extra?: tt.ExtraLocation
                                                                                                                                                                      ) => Promise<tg.Message.LocationMessage>;
                                                                                                                                                                      • Send point on the map

                                                                                                                                                                        Parameter chatId

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

                                                                                                                                                                      method sendMediaGroup

                                                                                                                                                                      sendMediaGroup: (
                                                                                                                                                                      chatId: number | string,
                                                                                                                                                                      media:
                                                                                                                                                                      | ReadonlyArray<tg.InputMediaPhoto | tg.InputMediaVideo>
                                                                                                                                                                      | readonly tg.InputMediaAudio[]
                                                                                                                                                                      | readonly tg.InputMediaDocument[],
                                                                                                                                                                      extra?: tt.ExtraMediaGroup
                                                                                                                                                                      ) => Promise<
                                                                                                                                                                      (
                                                                                                                                                                      | tg.Message.DocumentMessage
                                                                                                                                                                      | tg.Message.AudioMessage
                                                                                                                                                                      | tg.Message.PhotoMessage
                                                                                                                                                                      | tg.Message.VideoMessage
                                                                                                                                                                      )[]
                                                                                                                                                                      >;
                                                                                                                                                                      • Send a group of photos or videos as an album

                                                                                                                                                                        Parameter chatId

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

                                                                                                                                                                        Parameter media

                                                                                                                                                                        A JSON-serialized array describing photos and videos to be sent, must include 2–10 items

                                                                                                                                                                      method sendMessage

                                                                                                                                                                      sendMessage: (
                                                                                                                                                                      chatId: number | string,
                                                                                                                                                                      text: string,
                                                                                                                                                                      extra?: tt.ExtraReplyMessage
                                                                                                                                                                      ) => Promise<tg.Message.TextMessage>;
                                                                                                                                                                      • Send a text message

                                                                                                                                                                        Parameter chatId

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

                                                                                                                                                                        Parameter text

                                                                                                                                                                        Text of the message to be sent

                                                                                                                                                                      method sendPhoto

                                                                                                                                                                      sendPhoto: (
                                                                                                                                                                      chatId: number | string,
                                                                                                                                                                      photo: any,
                                                                                                                                                                      extra?: tt.ExtraPhoto
                                                                                                                                                                      ) => Promise<tg.Message.PhotoMessage>;
                                                                                                                                                                      • Parameter chatId

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

                                                                                                                                                                      method sendPoll

                                                                                                                                                                      sendPoll: (
                                                                                                                                                                      chatId: number | string,
                                                                                                                                                                      question: string,
                                                                                                                                                                      options: readonly string[],
                                                                                                                                                                      extra?: tt.ExtraPoll
                                                                                                                                                                      ) => Promise<tg.Message.PollMessage>;
                                                                                                                                                                      • Send a native poll.

                                                                                                                                                                        Parameter chatId

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

                                                                                                                                                                        Parameter question

                                                                                                                                                                        Poll question, 1-255 characters

                                                                                                                                                                        Parameter options

                                                                                                                                                                        A JSON-serialized list of answer options, 2-10 strings 1-100 characters each

                                                                                                                                                                      method sendQuiz

                                                                                                                                                                      sendQuiz: (
                                                                                                                                                                      chatId: number | string,
                                                                                                                                                                      question: string,
                                                                                                                                                                      options: readonly string[],
                                                                                                                                                                      extra: tt.ExtraPoll
                                                                                                                                                                      ) => Promise<tg.Message.PollMessage>;
                                                                                                                                                                      • Send a native quiz.

                                                                                                                                                                        Parameter chatId

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

                                                                                                                                                                        Parameter question

                                                                                                                                                                        Poll question, 1-255 characters

                                                                                                                                                                        Parameter options

                                                                                                                                                                        A JSON-serialized list of answer options, 2-10 strings 1-100 characters each

                                                                                                                                                                      method sendSticker

                                                                                                                                                                      sendSticker: (
                                                                                                                                                                      chatId: number | string,
                                                                                                                                                                      sticker: any,
                                                                                                                                                                      extra?: tt.ExtraSticker
                                                                                                                                                                      ) => Promise<tg.Message.StickerMessage>;
                                                                                                                                                                      • Send .webp stickers

                                                                                                                                                                        Parameter chatId

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

                                                                                                                                                                      method sendVenue

                                                                                                                                                                      sendVenue: (
                                                                                                                                                                      chatId: number | string,
                                                                                                                                                                      latitude: number,
                                                                                                                                                                      longitude: number,
                                                                                                                                                                      title: string,
                                                                                                                                                                      address: string,
                                                                                                                                                                      extra?: tt.ExtraVenue
                                                                                                                                                                      ) => Promise<tg.Message.VenueMessage>;

                                                                                                                                                                        method sendVideo

                                                                                                                                                                        sendVideo: (
                                                                                                                                                                        chatId: number | string,
                                                                                                                                                                        video: any,
                                                                                                                                                                        extra?: tt.ExtraVideo
                                                                                                                                                                        ) => Promise<tg.Message.VideoMessage>;
                                                                                                                                                                        • Send video files, Telegram clients support mp4 videos (other formats may be sent as Document) Bots can currently send video files of up to 50 MB in size, this limit may be changed in the future.

                                                                                                                                                                          Parameter chatId

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

                                                                                                                                                                        method sendVideoNote

                                                                                                                                                                        sendVideoNote: (
                                                                                                                                                                        chatId: number | string,
                                                                                                                                                                        videoNote: string | tg.InputFileVideoNote,
                                                                                                                                                                        extra?: tt.ExtraVideoNote
                                                                                                                                                                        ) => Promise<tg.Message.VideoNoteMessage>;
                                                                                                                                                                        • Send video messages

                                                                                                                                                                          Parameter chatId

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

                                                                                                                                                                        method sendVoice

                                                                                                                                                                        sendVoice: (
                                                                                                                                                                        chatId: number | string,
                                                                                                                                                                        voice: any,
                                                                                                                                                                        extra?: tt.ExtraVoice
                                                                                                                                                                        ) => Promise<tg.Message.VoiceMessage>;
                                                                                                                                                                        • 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 (other formats may be sent as Audio or Document). 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.

                                                                                                                                                                          Parameter chatId

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

                                                                                                                                                                        method setChatAdministratorCustomTitle

                                                                                                                                                                        setChatAdministratorCustomTitle: (
                                                                                                                                                                        chatId: number | string,
                                                                                                                                                                        userId: number,
                                                                                                                                                                        title: string
                                                                                                                                                                        ) => Promise<true>;

                                                                                                                                                                          method setChatDescription

                                                                                                                                                                          setChatDescription: (
                                                                                                                                                                          chatId: number | string,
                                                                                                                                                                          description?: string
                                                                                                                                                                          ) => Promise<true>;

                                                                                                                                                                            method setChatPermissions

                                                                                                                                                                            setChatPermissions: (chatId: number | string, permissions: any) => Promise<true>;

                                                                                                                                                                              method setChatPhoto

                                                                                                                                                                              setChatPhoto: (chatId: number | string, photo: any) => Promise<true>;

                                                                                                                                                                                method setChatStickerSet

                                                                                                                                                                                setChatStickerSet: (chatId: number | string, setName: string) => Promise<true>;

                                                                                                                                                                                  method setChatTitle

                                                                                                                                                                                  setChatTitle: (chatId: number | string, title: string) => Promise<true>;
                                                                                                                                                                                  • 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 admin rights

                                                                                                                                                                                    Parameter chatId

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

                                                                                                                                                                                    Parameter title

                                                                                                                                                                                    New chat title, 1-255 characters

                                                                                                                                                                                  method setGameScore

                                                                                                                                                                                  setGameScore: (
                                                                                                                                                                                  userId: number,
                                                                                                                                                                                  score: number,
                                                                                                                                                                                  inlineMessageId: string | undefined,
                                                                                                                                                                                  chatId: number | undefined,
                                                                                                                                                                                  messageId: number | undefined,
                                                                                                                                                                                  editMessage?: boolean,
                                                                                                                                                                                  force?: boolean
                                                                                                                                                                                  ) => Promise<true | (tg.Update.Edited & tg.Message.GameMessage)>;

                                                                                                                                                                                    method setMyCommands

                                                                                                                                                                                    setMyCommands: (
                                                                                                                                                                                    commands: readonly tg.BotCommand[],
                                                                                                                                                                                    extra?: tt.ExtraSetMyCommands
                                                                                                                                                                                    ) => Promise<true>;
                                                                                                                                                                                    • Change the list of the bot's commands.

                                                                                                                                                                                      Parameter commands

                                                                                                                                                                                      A list of bot commands to be set as the list of the bot's commands. At most 100 commands can be specified.

                                                                                                                                                                                    method setPassportDataErrors

                                                                                                                                                                                    setPassportDataErrors: (
                                                                                                                                                                                    userId: number,
                                                                                                                                                                                    errors: readonly tg.PassportElementError[]
                                                                                                                                                                                    ) => Promise<true>;

                                                                                                                                                                                      method setStickerPositionInSet

                                                                                                                                                                                      setStickerPositionInSet: (sticker: string, position: number) => Promise<true>;
                                                                                                                                                                                      • Move a sticker in a set created by the bot to a specific position

                                                                                                                                                                                        Parameter sticker

                                                                                                                                                                                        File identifier of the sticker

                                                                                                                                                                                        Parameter position

                                                                                                                                                                                        New sticker position in the set, zero-based

                                                                                                                                                                                      method setStickerSetThumb

                                                                                                                                                                                      setStickerSetThumb: (name: string, userId: number, thumb: any) => Promise<true>;

                                                                                                                                                                                        method setWebhook

                                                                                                                                                                                        setWebhook: (url: string, extra?: tt.ExtraSetWebhook) => Promise<true>;
                                                                                                                                                                                        • Specify a url to receive incoming updates via an outgoing webhook

                                                                                                                                                                                          Parameter url

                                                                                                                                                                                          HTTPS url to send updates to. Use an empty string to remove webhook integration

                                                                                                                                                                                        method stopMessageLiveLocation

                                                                                                                                                                                        stopMessageLiveLocation: (
                                                                                                                                                                                        chatId: number | string | undefined,
                                                                                                                                                                                        messageId: number | undefined,
                                                                                                                                                                                        inlineMessageId: string | undefined,
                                                                                                                                                                                        markup?: any
                                                                                                                                                                                        ) => Promise<true | (tg.Update.Edited & tg.Message.LocationMessage)>;

                                                                                                                                                                                          method stopPoll

                                                                                                                                                                                          stopPoll: (
                                                                                                                                                                                          chatId: number | string,
                                                                                                                                                                                          messageId: number,
                                                                                                                                                                                          extra?: tt.ExtraStopPoll
                                                                                                                                                                                          ) => Promise<tg.Poll>;
                                                                                                                                                                                          • Parameter chatId

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

                                                                                                                                                                                            Parameter messageId

                                                                                                                                                                                            Identifier of the original message with the poll

                                                                                                                                                                                          method unbanChatMember

                                                                                                                                                                                          unbanChatMember: (
                                                                                                                                                                                          chatId: number | string,
                                                                                                                                                                                          userId: number,
                                                                                                                                                                                          extra?: { only_if_banned?: boolean }
                                                                                                                                                                                          ) => Promise<true>;
                                                                                                                                                                                          • Unban a user from a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights

                                                                                                                                                                                            Parameter chatId

                                                                                                                                                                                            Unique identifier for the target group or username of the target supergroup or channel (in the format @username)

                                                                                                                                                                                            Parameter userId

                                                                                                                                                                                            Unique identifier of the target user

                                                                                                                                                                                          method unpinAllChatMessages

                                                                                                                                                                                          unpinAllChatMessages: (chatId: number | string) => Promise<true>;
                                                                                                                                                                                          • Clear the list of pinned messages in a chat

                                                                                                                                                                                            Parameter chatId

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

                                                                                                                                                                                          method unpinChatMessage

                                                                                                                                                                                          unpinChatMessage: (chatId: number | string, messageId?: number) => Promise<true>;
                                                                                                                                                                                          • Unpin a message in a group, a supergroup, or a channel. The bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' admin right in the supergroup or 'can_edit_messages' admin right in the channel.

                                                                                                                                                                                            Parameter chatId

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

                                                                                                                                                                                          method uploadStickerFile

                                                                                                                                                                                          uploadStickerFile: (ownerId: number, stickerFile: any) => Promise<tg.File>;
                                                                                                                                                                                          • Upload a .png file with a sticker for later use in createNewStickerSet and addStickerToSet methods (can be used multiple times) https://core.telegram.org/bots/api#sending-files

                                                                                                                                                                                            Parameter ownerId

                                                                                                                                                                                            User identifier of sticker file owner

                                                                                                                                                                                            Parameter stickerFile

                                                                                                                                                                                            Png image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either width or height must be exactly 512px.

                                                                                                                                                                                          class TelegramError

                                                                                                                                                                                          class TelegramError extends Error {}

                                                                                                                                                                                            constructor

                                                                                                                                                                                            constructor(response: ErrorPayload, on?: {});

                                                                                                                                                                                              property code

                                                                                                                                                                                              readonly code: number;

                                                                                                                                                                                                property description

                                                                                                                                                                                                readonly description: string;

                                                                                                                                                                                                  property on

                                                                                                                                                                                                  readonly on: {};

                                                                                                                                                                                                    property parameters

                                                                                                                                                                                                    readonly parameters: any;

                                                                                                                                                                                                      property response

                                                                                                                                                                                                      readonly response: ErrorPayload;

                                                                                                                                                                                                        Type Aliases

                                                                                                                                                                                                        type Middleware

                                                                                                                                                                                                        type Middleware<C extends Context> = MiddlewareFn<C> | MiddlewareObj<C>;

                                                                                                                                                                                                          type MiddlewareFn

                                                                                                                                                                                                          type MiddlewareFn<C extends Context> = (
                                                                                                                                                                                                          ctx: C,
                                                                                                                                                                                                          next: () => Promise<void>
                                                                                                                                                                                                          ) => Promise<unknown> | void;

                                                                                                                                                                                                            type NarrowedContext

                                                                                                                                                                                                            type NarrowedContext<C extends Context, U extends tg.Update> = Context<U> &
                                                                                                                                                                                                            Omit<C, keyof Context>;
                                                                                                                                                                                                            • Narrows down C['update'] (and derived getters) to specific update type U.

                                                                                                                                                                                                              Used by [[Composer]], possibly useful for splitting a bot into multiple files.

                                                                                                                                                                                                            Namespaces

                                                                                                                                                                                                            namespace Markup

                                                                                                                                                                                                            module 'typings/markup.d.ts' {}

                                                                                                                                                                                                              function forceReply

                                                                                                                                                                                                              forceReply: () => Markup<ForceReply>;

                                                                                                                                                                                                                function inlineKeyboard

                                                                                                                                                                                                                inlineKeyboard: {
                                                                                                                                                                                                                (buttons: HideableIKBtn[][]): Markup<InlineKeyboardMarkup>;
                                                                                                                                                                                                                (buttons: any[], options?: Partial<KeyboardBuildingOptions<any>>): Markup<any>;
                                                                                                                                                                                                                };

                                                                                                                                                                                                                  function keyboard

                                                                                                                                                                                                                  keyboard: {
                                                                                                                                                                                                                  (buttons: HideableKBtn[][]): Markup<ReplyKeyboardMarkup>;
                                                                                                                                                                                                                  (buttons: any[], options?: Partial<KeyboardBuildingOptions<any>>): Markup<any>;
                                                                                                                                                                                                                  };

                                                                                                                                                                                                                    function removeKeyboard

                                                                                                                                                                                                                    removeKeyboard: () => Markup<ReplyKeyboardRemove>;

                                                                                                                                                                                                                      class Markup

                                                                                                                                                                                                                      class Markup<
                                                                                                                                                                                                                      T extends
                                                                                                                                                                                                                      | InlineKeyboardMarkup
                                                                                                                                                                                                                      | ReplyKeyboardMarkup
                                                                                                                                                                                                                      | ReplyKeyboardRemove
                                                                                                                                                                                                                      | ForceReply
                                                                                                                                                                                                                      > {}

                                                                                                                                                                                                                        constructor

                                                                                                                                                                                                                        constructor(reply_markup: {});

                                                                                                                                                                                                                          property reply_markup

                                                                                                                                                                                                                          readonly reply_markup: {};

                                                                                                                                                                                                                            method oneTime

                                                                                                                                                                                                                            oneTime: (
                                                                                                                                                                                                                            this: Markup<ReplyKeyboardMarkup>,
                                                                                                                                                                                                                            value?: boolean
                                                                                                                                                                                                                            ) => Markup<ReplyKeyboardMarkup>;

                                                                                                                                                                                                                              method placeholder

                                                                                                                                                                                                                              placeholder: <T extends unknown>(
                                                                                                                                                                                                                              this: Markup<T>,
                                                                                                                                                                                                                              placeholder: string
                                                                                                                                                                                                                              ) => Markup<T>;

                                                                                                                                                                                                                                method resize

                                                                                                                                                                                                                                resize: (
                                                                                                                                                                                                                                this: Markup<ReplyKeyboardMarkup>,
                                                                                                                                                                                                                                value?: boolean
                                                                                                                                                                                                                                ) => Markup<ReplyKeyboardMarkup>;

                                                                                                                                                                                                                                  method selective

                                                                                                                                                                                                                                  selective: <T extends unknown>(this: Markup<T>, value?: boolean) => Markup<T>;

                                                                                                                                                                                                                                    namespace button

                                                                                                                                                                                                                                    module 'typings/button.d.ts' {}

                                                                                                                                                                                                                                      function callback

                                                                                                                                                                                                                                      callback: (
                                                                                                                                                                                                                                      text: string,
                                                                                                                                                                                                                                      data: string,
                                                                                                                                                                                                                                      hide?: boolean
                                                                                                                                                                                                                                      ) => Hideable<InlineKeyboardButton.CallbackButton>;

                                                                                                                                                                                                                                        function contactRequest

                                                                                                                                                                                                                                        contactRequest: (
                                                                                                                                                                                                                                        text: string,
                                                                                                                                                                                                                                        hide?: boolean
                                                                                                                                                                                                                                        ) => Hideable<KeyboardButton.RequestContactButton>;

                                                                                                                                                                                                                                          function game

                                                                                                                                                                                                                                          game: (
                                                                                                                                                                                                                                          text: string,
                                                                                                                                                                                                                                          hide?: boolean
                                                                                                                                                                                                                                          ) => Hideable<InlineKeyboardButton.GameButton>;

                                                                                                                                                                                                                                            function locationRequest

                                                                                                                                                                                                                                            locationRequest: (
                                                                                                                                                                                                                                            text: string,
                                                                                                                                                                                                                                            hide?: boolean
                                                                                                                                                                                                                                            ) => Hideable<KeyboardButton.RequestLocationButton>;

                                                                                                                                                                                                                                              function login

                                                                                                                                                                                                                                              login: (
                                                                                                                                                                                                                                              text: string,
                                                                                                                                                                                                                                              url: string,
                                                                                                                                                                                                                                              opts?: {
                                                                                                                                                                                                                                              forward_text?: string;
                                                                                                                                                                                                                                              bot_username?: string;
                                                                                                                                                                                                                                              request_write_access?: boolean;
                                                                                                                                                                                                                                              },
                                                                                                                                                                                                                                              hide?: boolean
                                                                                                                                                                                                                                              ) => Hideable<InlineKeyboardButton.LoginButton>;

                                                                                                                                                                                                                                                function pay

                                                                                                                                                                                                                                                pay: (text: string, hide?: boolean) => Hideable<InlineKeyboardButton.PayButton>;

                                                                                                                                                                                                                                                  function pollRequest

                                                                                                                                                                                                                                                  pollRequest: (
                                                                                                                                                                                                                                                  text: string,
                                                                                                                                                                                                                                                  type?: 'quiz' | 'regular',
                                                                                                                                                                                                                                                  hide?: boolean
                                                                                                                                                                                                                                                  ) => Hideable<KeyboardButton.RequestPollButton>;

                                                                                                                                                                                                                                                    function switchToChat

                                                                                                                                                                                                                                                    switchToChat: (
                                                                                                                                                                                                                                                    text: string,
                                                                                                                                                                                                                                                    value: string,
                                                                                                                                                                                                                                                    hide?: boolean
                                                                                                                                                                                                                                                    ) => Hideable<InlineKeyboardButton.SwitchInlineButton>;

                                                                                                                                                                                                                                                      function switchToCurrentChat

                                                                                                                                                                                                                                                      switchToCurrentChat: (
                                                                                                                                                                                                                                                      text: string,
                                                                                                                                                                                                                                                      value: string,
                                                                                                                                                                                                                                                      hide?: boolean
                                                                                                                                                                                                                                                      ) => Hideable<InlineKeyboardButton.SwitchInlineCurrentChatButton>;

                                                                                                                                                                                                                                                        function text

                                                                                                                                                                                                                                                        text: (text: string, hide?: boolean) => Hideable<KeyboardButton.CommonButton>;

                                                                                                                                                                                                                                                          function url

                                                                                                                                                                                                                                                          url: (
                                                                                                                                                                                                                                                          text: string,
                                                                                                                                                                                                                                                          url: string,
                                                                                                                                                                                                                                                          hide?: boolean
                                                                                                                                                                                                                                                          ) => Hideable<InlineKeyboardButton.UrlButton>;

                                                                                                                                                                                                                                                            namespace Scenes

                                                                                                                                                                                                                                                            module 'typings/scenes/index.d.ts' {}
                                                                                                                                                                                                                                                            • See Also

                                                                                                                                                                                                                                                              • https://github.com/telegraf/telegraf/issues/705#issuecomment-549056045

                                                                                                                                                                                                                                                              • https://www.npmjs.com/package/telegraf-stateless-question

                                                                                                                                                                                                                                                            class BaseScene

                                                                                                                                                                                                                                                            class BaseScene<C extends Context = Context> extends Composer<C> {}

                                                                                                                                                                                                                                                              constructor

                                                                                                                                                                                                                                                              constructor(id: string, options?: SceneOptions<C>);

                                                                                                                                                                                                                                                                property enterHandler

                                                                                                                                                                                                                                                                enterHandler: MiddlewareFn<C>;

                                                                                                                                                                                                                                                                  property id

                                                                                                                                                                                                                                                                  id: string;

                                                                                                                                                                                                                                                                    property leaveHandler

                                                                                                                                                                                                                                                                    leaveHandler: MiddlewareFn<C>;

                                                                                                                                                                                                                                                                      property ttl

                                                                                                                                                                                                                                                                      ttl?: number;

                                                                                                                                                                                                                                                                        method enter

                                                                                                                                                                                                                                                                        enter: (...fns: Array<Middleware<C>>) => this;

                                                                                                                                                                                                                                                                          method enterMiddleware

                                                                                                                                                                                                                                                                          enterMiddleware: () => MiddlewareFn<C>;

                                                                                                                                                                                                                                                                            method leave

                                                                                                                                                                                                                                                                            leave: (...fns: Array<Middleware<C>>) => this;

                                                                                                                                                                                                                                                                              method leaveMiddleware

                                                                                                                                                                                                                                                                              leaveMiddleware: () => MiddlewareFn<C>;

                                                                                                                                                                                                                                                                                class SceneContextScene

                                                                                                                                                                                                                                                                                class SceneContextScene<
                                                                                                                                                                                                                                                                                C extends SessionContext<SceneSession<D>>,
                                                                                                                                                                                                                                                                                D extends SceneSessionData = SceneSessionData
                                                                                                                                                                                                                                                                                > {}

                                                                                                                                                                                                                                                                                  constructor

                                                                                                                                                                                                                                                                                  constructor(
                                                                                                                                                                                                                                                                                  ctx: SessionContext<SceneSession<D>>,
                                                                                                                                                                                                                                                                                  scenes: Map<string, BaseScene<C>>,
                                                                                                                                                                                                                                                                                  options: Partial<SceneContextSceneOptions<D>>
                                                                                                                                                                                                                                                                                  );

                                                                                                                                                                                                                                                                                    property current

                                                                                                                                                                                                                                                                                    readonly current: BaseScene<C>;

                                                                                                                                                                                                                                                                                      property session

                                                                                                                                                                                                                                                                                      readonly session: SceneSessionData;

                                                                                                                                                                                                                                                                                        property state

                                                                                                                                                                                                                                                                                        state: {};

                                                                                                                                                                                                                                                                                          method enter

                                                                                                                                                                                                                                                                                          enter: (
                                                                                                                                                                                                                                                                                          sceneId: string,
                                                                                                                                                                                                                                                                                          initialState?: object,
                                                                                                                                                                                                                                                                                          silent?: boolean
                                                                                                                                                                                                                                                                                          ) => Promise<unknown>;

                                                                                                                                                                                                                                                                                            method leave

                                                                                                                                                                                                                                                                                            leave: () => Promise<void>;

                                                                                                                                                                                                                                                                                              method reenter

                                                                                                                                                                                                                                                                                              reenter: () => Promise<unknown> | undefined;

                                                                                                                                                                                                                                                                                                method reset

                                                                                                                                                                                                                                                                                                reset: () => void;

                                                                                                                                                                                                                                                                                                  class Stage

                                                                                                                                                                                                                                                                                                  class Stage<
                                                                                                                                                                                                                                                                                                  C extends SessionContext<SceneSession<D>> & {
                                                                                                                                                                                                                                                                                                  scene: SceneContextScene<C, D>;
                                                                                                                                                                                                                                                                                                  },
                                                                                                                                                                                                                                                                                                  D extends SceneSessionData = SceneSessionData
                                                                                                                                                                                                                                                                                                  > extends Composer<C> {}

                                                                                                                                                                                                                                                                                                    constructor

                                                                                                                                                                                                                                                                                                    constructor(
                                                                                                                                                                                                                                                                                                    scenes?: readonly BaseScene<C>[],
                                                                                                                                                                                                                                                                                                    options?: Partial<SceneContextSceneOptions<D>>
                                                                                                                                                                                                                                                                                                    );

                                                                                                                                                                                                                                                                                                      property options

                                                                                                                                                                                                                                                                                                      options: Partial<SceneContextSceneOptions<D>>;

                                                                                                                                                                                                                                                                                                        property scenes

                                                                                                                                                                                                                                                                                                        scenes: Map<string, BaseScene<C>>;

                                                                                                                                                                                                                                                                                                          method enter

                                                                                                                                                                                                                                                                                                          static enter: <C extends Context<any> & { scene: SceneContextScene<C> }>(
                                                                                                                                                                                                                                                                                                          sceneId: string,
                                                                                                                                                                                                                                                                                                          initialState?: object,
                                                                                                                                                                                                                                                                                                          silent?: boolean
                                                                                                                                                                                                                                                                                                          ) => (ctx: C) => Promise<unknown>;

                                                                                                                                                                                                                                                                                                            method leave

                                                                                                                                                                                                                                                                                                            static leave: <C extends Context<any> & { scene: SceneContextScene<C> }>() => (
                                                                                                                                                                                                                                                                                                            ctx: C
                                                                                                                                                                                                                                                                                                            ) => Promise<void>;

                                                                                                                                                                                                                                                                                                              method middleware

                                                                                                                                                                                                                                                                                                              middleware: () => import('..').MiddlewareFn<C>;

                                                                                                                                                                                                                                                                                                                method reenter

                                                                                                                                                                                                                                                                                                                static reenter: <C extends Context<any> & { scene: SceneContextScene<C> }>() => (
                                                                                                                                                                                                                                                                                                                ctx: C
                                                                                                                                                                                                                                                                                                                ) => Promise<unknown> | undefined;

                                                                                                                                                                                                                                                                                                                  method register

                                                                                                                                                                                                                                                                                                                  register: (...scenes: ReadonlyArray<BaseScene<C>>) => this;

                                                                                                                                                                                                                                                                                                                    class WizardContextWizard

                                                                                                                                                                                                                                                                                                                    class WizardContextWizard<
                                                                                                                                                                                                                                                                                                                    C extends SessionContext<WizardSession> & {
                                                                                                                                                                                                                                                                                                                    scene: SceneContextScene<C, WizardSessionData>;
                                                                                                                                                                                                                                                                                                                    }
                                                                                                                                                                                                                                                                                                                    > {}

                                                                                                                                                                                                                                                                                                                      constructor

                                                                                                                                                                                                                                                                                                                      constructor(
                                                                                                                                                                                                                                                                                                                      ctx: SessionContext<WizardSession<WizardSessionData>> & {
                                                                                                                                                                                                                                                                                                                      scene: SceneContextScene<C, WizardSessionData>;
                                                                                                                                                                                                                                                                                                                      },
                                                                                                                                                                                                                                                                                                                      steps: readonly Middleware<C>[]
                                                                                                                                                                                                                                                                                                                      );

                                                                                                                                                                                                                                                                                                                        property cursor

                                                                                                                                                                                                                                                                                                                        cursor: number;

                                                                                                                                                                                                                                                                                                                          property state

                                                                                                                                                                                                                                                                                                                          readonly state: {};

                                                                                                                                                                                                                                                                                                                            property step

                                                                                                                                                                                                                                                                                                                            readonly step: Middleware<C>;

                                                                                                                                                                                                                                                                                                                              method back

                                                                                                                                                                                                                                                                                                                              back: () => this;

                                                                                                                                                                                                                                                                                                                                method next

                                                                                                                                                                                                                                                                                                                                next: () => this;

                                                                                                                                                                                                                                                                                                                                  method selectStep

                                                                                                                                                                                                                                                                                                                                  selectStep: (index: number) => this;

                                                                                                                                                                                                                                                                                                                                    class WizardScene

                                                                                                                                                                                                                                                                                                                                    class WizardScene<
                                                                                                                                                                                                                                                                                                                                    C extends Context & {
                                                                                                                                                                                                                                                                                                                                    scene: SceneContextScene<C, WizardSessionData>;
                                                                                                                                                                                                                                                                                                                                    wizard: WizardContextWizard<C>;
                                                                                                                                                                                                                                                                                                                                    }
                                                                                                                                                                                                                                                                                                                                    >
                                                                                                                                                                                                                                                                                                                                    extends BaseScene<C>
                                                                                                                                                                                                                                                                                                                                    implements MiddlewareObj<C> {}

                                                                                                                                                                                                                                                                                                                                      constructor

                                                                                                                                                                                                                                                                                                                                      constructor(id: string, ...steps: Middleware<C>[]);

                                                                                                                                                                                                                                                                                                                                        constructor

                                                                                                                                                                                                                                                                                                                                        constructor(id: string, options: SceneOptions<C>, ...steps: Middleware<C>[]);

                                                                                                                                                                                                                                                                                                                                          property steps

                                                                                                                                                                                                                                                                                                                                          steps: Middleware<C>[];

                                                                                                                                                                                                                                                                                                                                            method enterMiddleware

                                                                                                                                                                                                                                                                                                                                            enterMiddleware: () => import('../../middleware').MiddlewareFn<C>;

                                                                                                                                                                                                                                                                                                                                              method middleware

                                                                                                                                                                                                                                                                                                                                              middleware: () => import('../../middleware').MiddlewareFn<C>;

                                                                                                                                                                                                                                                                                                                                                interface SceneContext

                                                                                                                                                                                                                                                                                                                                                interface SceneContext<D extends SceneSessionData = SceneSessionData>
                                                                                                                                                                                                                                                                                                                                                extends Context {}

                                                                                                                                                                                                                                                                                                                                                  property scene

                                                                                                                                                                                                                                                                                                                                                  scene: SceneContextScene<SceneContext<D>, D>;

                                                                                                                                                                                                                                                                                                                                                    property session

                                                                                                                                                                                                                                                                                                                                                    session: SceneSession<D>;

                                                                                                                                                                                                                                                                                                                                                      interface SceneSession

                                                                                                                                                                                                                                                                                                                                                      interface SceneSession<S extends SceneSessionData = SceneSessionData> {}

                                                                                                                                                                                                                                                                                                                                                        interface SceneSessionData

                                                                                                                                                                                                                                                                                                                                                        interface SceneSessionData {}

                                                                                                                                                                                                                                                                                                                                                          property current

                                                                                                                                                                                                                                                                                                                                                          current?: string;

                                                                                                                                                                                                                                                                                                                                                            property expires

                                                                                                                                                                                                                                                                                                                                                            expires?: number;

                                                                                                                                                                                                                                                                                                                                                              property state

                                                                                                                                                                                                                                                                                                                                                              state?: object;

                                                                                                                                                                                                                                                                                                                                                                interface WizardContext

                                                                                                                                                                                                                                                                                                                                                                interface WizardContext<D extends WizardSessionData = WizardSessionData>
                                                                                                                                                                                                                                                                                                                                                                extends Context {}

                                                                                                                                                                                                                                                                                                                                                                  property scene

                                                                                                                                                                                                                                                                                                                                                                  scene: SceneContextScene<WizardContext<D>, D>;

                                                                                                                                                                                                                                                                                                                                                                    property session

                                                                                                                                                                                                                                                                                                                                                                    session: WizardSession<D>;

                                                                                                                                                                                                                                                                                                                                                                      property wizard

                                                                                                                                                                                                                                                                                                                                                                      wizard: WizardContextWizard<WizardContext<D>>;

                                                                                                                                                                                                                                                                                                                                                                        interface WizardSession

                                                                                                                                                                                                                                                                                                                                                                        interface WizardSession<S extends WizardSessionData = WizardSessionData>
                                                                                                                                                                                                                                                                                                                                                                        extends SceneSession<S> {}

                                                                                                                                                                                                                                                                                                                                                                          interface WizardSessionData

                                                                                                                                                                                                                                                                                                                                                                          interface WizardSessionData extends SceneSessionData {}

                                                                                                                                                                                                                                                                                                                                                                            property cursor

                                                                                                                                                                                                                                                                                                                                                                            cursor: number;

                                                                                                                                                                                                                                                                                                                                                                              namespace Telegraf

                                                                                                                                                                                                                                                                                                                                                                              namespace Telegraf {}

                                                                                                                                                                                                                                                                                                                                                                                interface LaunchOptions

                                                                                                                                                                                                                                                                                                                                                                                interface LaunchOptions {}

                                                                                                                                                                                                                                                                                                                                                                                  property allowedUpdates

                                                                                                                                                                                                                                                                                                                                                                                  allowedUpdates?: tt.UpdateType[];
                                                                                                                                                                                                                                                                                                                                                                                  • List the types of updates you want your bot to receive

                                                                                                                                                                                                                                                                                                                                                                                  property dropPendingUpdates

                                                                                                                                                                                                                                                                                                                                                                                  dropPendingUpdates?: boolean;

                                                                                                                                                                                                                                                                                                                                                                                    property webhook

                                                                                                                                                                                                                                                                                                                                                                                    webhook?: {
                                                                                                                                                                                                                                                                                                                                                                                    /** Public domain for webhook. If domain is not specified, hookPath should contain a domain name as well (not only path component). */
                                                                                                                                                                                                                                                                                                                                                                                    domain?: string;
                                                                                                                                                                                                                                                                                                                                                                                    /** Webhook url path; will be automatically generated if not specified */
                                                                                                                                                                                                                                                                                                                                                                                    hookPath?: string;
                                                                                                                                                                                                                                                                                                                                                                                    host?: string;
                                                                                                                                                                                                                                                                                                                                                                                    port?: number;
                                                                                                                                                                                                                                                                                                                                                                                    /** TLS server options. Omit to use http. */
                                                                                                                                                                                                                                                                                                                                                                                    tlsOptions?: TlsOptions;
                                                                                                                                                                                                                                                                                                                                                                                    cb?: http.RequestListener;
                                                                                                                                                                                                                                                                                                                                                                                    };
                                                                                                                                                                                                                                                                                                                                                                                    • Configuration options for when the bot is run via webhooks

                                                                                                                                                                                                                                                                                                                                                                                    interface Options

                                                                                                                                                                                                                                                                                                                                                                                    interface Options<TContext extends Context> {}

                                                                                                                                                                                                                                                                                                                                                                                      property contextType

                                                                                                                                                                                                                                                                                                                                                                                      contextType: new (...args: ConstructorParameters<typeof Context>) => TContext;

                                                                                                                                                                                                                                                                                                                                                                                        property handlerTimeout

                                                                                                                                                                                                                                                                                                                                                                                        handlerTimeout: number;

                                                                                                                                                                                                                                                                                                                                                                                          property telegram

                                                                                                                                                                                                                                                                                                                                                                                          telegram?: Partial<ApiClient.Options>;

                                                                                                                                                                                                                                                                                                                                                                                            namespace Types

                                                                                                                                                                                                                                                                                                                                                                                            module 'typings/telegram-types.d.ts' {}

                                                                                                                                                                                                                                                                                                                                                                                            class Markup

                                                                                                                                                                                                                                                                                                                                                                                            class Markup<
                                                                                                                                                                                                                                                                                                                                                                                            T extends
                                                                                                                                                                                                                                                                                                                                                                                            | InlineKeyboardMarkup
                                                                                                                                                                                                                                                                                                                                                                                            | ReplyKeyboardMarkup
                                                                                                                                                                                                                                                                                                                                                                                            | ReplyKeyboardRemove
                                                                                                                                                                                                                                                                                                                                                                                            | ForceReply
                                                                                                                                                                                                                                                                                                                                                                                            > {}

                                                                                                                                                                                                                                                                                                                                                                                              constructor

                                                                                                                                                                                                                                                                                                                                                                                              constructor(reply_markup: {});

                                                                                                                                                                                                                                                                                                                                                                                                property reply_markup

                                                                                                                                                                                                                                                                                                                                                                                                readonly reply_markup: {};

                                                                                                                                                                                                                                                                                                                                                                                                  method oneTime

                                                                                                                                                                                                                                                                                                                                                                                                  oneTime: (
                                                                                                                                                                                                                                                                                                                                                                                                  this: Markup<ReplyKeyboardMarkup>,
                                                                                                                                                                                                                                                                                                                                                                                                  value?: boolean
                                                                                                                                                                                                                                                                                                                                                                                                  ) => Markup<ReplyKeyboardMarkup>;

                                                                                                                                                                                                                                                                                                                                                                                                    method placeholder

                                                                                                                                                                                                                                                                                                                                                                                                    placeholder: <T extends unknown>(
                                                                                                                                                                                                                                                                                                                                                                                                    this: Markup<T>,
                                                                                                                                                                                                                                                                                                                                                                                                    placeholder: string
                                                                                                                                                                                                                                                                                                                                                                                                    ) => Markup<T>;

                                                                                                                                                                                                                                                                                                                                                                                                      method resize

                                                                                                                                                                                                                                                                                                                                                                                                      resize: (
                                                                                                                                                                                                                                                                                                                                                                                                      this: Markup<ReplyKeyboardMarkup>,
                                                                                                                                                                                                                                                                                                                                                                                                      value?: boolean
                                                                                                                                                                                                                                                                                                                                                                                                      ) => Markup<ReplyKeyboardMarkup>;

                                                                                                                                                                                                                                                                                                                                                                                                        method selective

                                                                                                                                                                                                                                                                                                                                                                                                        selective: <T extends unknown>(this: Markup<T>, value?: boolean) => Markup<T>;

                                                                                                                                                                                                                                                                                                                                                                                                          type ChatAction

                                                                                                                                                                                                                                                                                                                                                                                                          type ChatAction = Opts<'sendChatAction'>['action'];

                                                                                                                                                                                                                                                                                                                                                                                                            type ExtraAddStickerToSet

                                                                                                                                                                                                                                                                                                                                                                                                            type ExtraAddStickerToSet = MakeExtra<'addStickerToSet', 'name' | 'user_id'>;

                                                                                                                                                                                                                                                                                                                                                                                                              type ExtraAnimation

                                                                                                                                                                                                                                                                                                                                                                                                              type ExtraAnimation = MakeExtra<'sendAnimation', 'animation'>;

                                                                                                                                                                                                                                                                                                                                                                                                                type ExtraAnswerCbQuery

                                                                                                                                                                                                                                                                                                                                                                                                                type ExtraAnswerCbQuery = MakeExtra<
                                                                                                                                                                                                                                                                                                                                                                                                                'answerCallbackQuery',
                                                                                                                                                                                                                                                                                                                                                                                                                'text' | 'callback_query_id'
                                                                                                                                                                                                                                                                                                                                                                                                                >;

                                                                                                                                                                                                                                                                                                                                                                                                                  type ExtraAnswerInlineQuery

                                                                                                                                                                                                                                                                                                                                                                                                                  type ExtraAnswerInlineQuery = MakeExtra<
                                                                                                                                                                                                                                                                                                                                                                                                                  'answerInlineQuery',
                                                                                                                                                                                                                                                                                                                                                                                                                  'inline_query_id' | 'results'
                                                                                                                                                                                                                                                                                                                                                                                                                  >;

                                                                                                                                                                                                                                                                                                                                                                                                                    type ExtraAudio

                                                                                                                                                                                                                                                                                                                                                                                                                    type ExtraAudio = MakeExtra<'sendAudio', 'audio'>;

                                                                                                                                                                                                                                                                                                                                                                                                                      type ExtraContact

                                                                                                                                                                                                                                                                                                                                                                                                                      type ExtraContact = MakeExtra<'sendContact', 'phone_number' | 'first_name'>;

                                                                                                                                                                                                                                                                                                                                                                                                                        type ExtraCopyMessage

                                                                                                                                                                                                                                                                                                                                                                                                                        type ExtraCopyMessage = MakeExtra<'copyMessage', 'from_chat_id' | 'message_id'>;
                                                                                                                                                                                                                                                                                                                                                                                                                          type ExtraCreateChatInviteLink = MakeExtra<'createChatInviteLink'>;

                                                                                                                                                                                                                                                                                                                                                                                                                            type ExtraCreateNewStickerSet

                                                                                                                                                                                                                                                                                                                                                                                                                            type ExtraCreateNewStickerSet = MakeExtra<
                                                                                                                                                                                                                                                                                                                                                                                                                            'createNewStickerSet',
                                                                                                                                                                                                                                                                                                                                                                                                                            'name' | 'title' | 'user_id'
                                                                                                                                                                                                                                                                                                                                                                                                                            >;

                                                                                                                                                                                                                                                                                                                                                                                                                              type ExtraDice

                                                                                                                                                                                                                                                                                                                                                                                                                              type ExtraDice = MakeExtra<'sendDice'>;

                                                                                                                                                                                                                                                                                                                                                                                                                                type ExtraDocument

                                                                                                                                                                                                                                                                                                                                                                                                                                type ExtraDocument = MakeExtra<'sendDocument', 'document'>;
                                                                                                                                                                                                                                                                                                                                                                                                                                  type ExtraEditChatInviteLink = MakeExtra<'editChatInviteLink', 'invite_link'>;

                                                                                                                                                                                                                                                                                                                                                                                                                                    type ExtraEditMessageCaption

                                                                                                                                                                                                                                                                                                                                                                                                                                    type ExtraEditMessageCaption = MakeExtra<
                                                                                                                                                                                                                                                                                                                                                                                                                                    'editMessageCaption',
                                                                                                                                                                                                                                                                                                                                                                                                                                    'message_id' | 'inline_message_id' | 'caption'
                                                                                                                                                                                                                                                                                                                                                                                                                                    >;

                                                                                                                                                                                                                                                                                                                                                                                                                                      type ExtraEditMessageLiveLocation

                                                                                                                                                                                                                                                                                                                                                                                                                                      type ExtraEditMessageLiveLocation = MakeExtra<
                                                                                                                                                                                                                                                                                                                                                                                                                                      'editMessageLiveLocation',
                                                                                                                                                                                                                                                                                                                                                                                                                                      'message_id' | 'inline_message_id' | 'latitude' | 'longitude'
                                                                                                                                                                                                                                                                                                                                                                                                                                      >;

                                                                                                                                                                                                                                                                                                                                                                                                                                        type ExtraEditMessageMedia

                                                                                                                                                                                                                                                                                                                                                                                                                                        type ExtraEditMessageMedia = MakeExtra<
                                                                                                                                                                                                                                                                                                                                                                                                                                        'editMessageMedia',
                                                                                                                                                                                                                                                                                                                                                                                                                                        'message_id' | 'inline_message_id' | 'media'
                                                                                                                                                                                                                                                                                                                                                                                                                                        >;

                                                                                                                                                                                                                                                                                                                                                                                                                                          type ExtraEditMessageText

                                                                                                                                                                                                                                                                                                                                                                                                                                          type ExtraEditMessageText = MakeExtra<
                                                                                                                                                                                                                                                                                                                                                                                                                                          'editMessageText',
                                                                                                                                                                                                                                                                                                                                                                                                                                          'message_id' | 'inline_message_id' | 'text'
                                                                                                                                                                                                                                                                                                                                                                                                                                          >;

                                                                                                                                                                                                                                                                                                                                                                                                                                            type ExtraGame

                                                                                                                                                                                                                                                                                                                                                                                                                                            type ExtraGame = MakeExtra<'sendGame', 'game_short_name'>;

                                                                                                                                                                                                                                                                                                                                                                                                                                              type ExtraInvoice

                                                                                                                                                                                                                                                                                                                                                                                                                                              type ExtraInvoice = MakeExtra<'sendInvoice', keyof NewInvoiceParameters>;

                                                                                                                                                                                                                                                                                                                                                                                                                                                type ExtraKickChatMember

                                                                                                                                                                                                                                                                                                                                                                                                                                                type ExtraKickChatMember = MakeExtra<'kickChatMember', 'user_id' | 'until_date'>;

                                                                                                                                                                                                                                                                                                                                                                                                                                                  type ExtraLocation

                                                                                                                                                                                                                                                                                                                                                                                                                                                  type ExtraLocation = MakeExtra<'sendLocation', 'latitude' | 'longitude'>;

                                                                                                                                                                                                                                                                                                                                                                                                                                                    type ExtraMediaGroup

                                                                                                                                                                                                                                                                                                                                                                                                                                                    type ExtraMediaGroup = MakeExtra<'sendMediaGroup', 'media'>;

                                                                                                                                                                                                                                                                                                                                                                                                                                                      type ExtraPhoto

                                                                                                                                                                                                                                                                                                                                                                                                                                                      type ExtraPhoto = MakeExtra<'sendPhoto', 'photo'>;

                                                                                                                                                                                                                                                                                                                                                                                                                                                        type ExtraPoll

                                                                                                                                                                                                                                                                                                                                                                                                                                                        type ExtraPoll = MakeExtra<'sendPoll', 'question' | 'options' | 'type'>;

                                                                                                                                                                                                                                                                                                                                                                                                                                                          type ExtraPromoteChatMember

                                                                                                                                                                                                                                                                                                                                                                                                                                                          type ExtraPromoteChatMember = MakeExtra<'promoteChatMember', 'user_id'>;

                                                                                                                                                                                                                                                                                                                                                                                                                                                            type ExtraReplyMessage

                                                                                                                                                                                                                                                                                                                                                                                                                                                            type ExtraReplyMessage = MakeExtra<'sendMessage', 'text'>;

                                                                                                                                                                                                                                                                                                                                                                                                                                                              type ExtraRestrictChatMember

                                                                                                                                                                                                                                                                                                                                                                                                                                                              type ExtraRestrictChatMember = MakeExtra<'restrictChatMember', 'user_id'>;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                type ExtraSetMyCommands

                                                                                                                                                                                                                                                                                                                                                                                                                                                                type ExtraSetMyCommands = MakeExtra<'setMyCommands', 'commands'>;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                  type ExtraSetWebhook

                                                                                                                                                                                                                                                                                                                                                                                                                                                                  type ExtraSetWebhook = MakeExtra<'setWebhook', 'url'>;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                    type ExtraSticker

                                                                                                                                                                                                                                                                                                                                                                                                                                                                    type ExtraSticker = MakeExtra<'sendSticker', 'sticker'>;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                      type ExtraStopPoll

                                                                                                                                                                                                                                                                                                                                                                                                                                                                      type ExtraStopPoll = MakeExtra<'stopPoll', 'message_id'>;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                        type ExtraVenue

                                                                                                                                                                                                                                                                                                                                                                                                                                                                        type ExtraVenue = MakeExtra<
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        'sendVenue',
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        'latitude' | 'longitude' | 'title' | 'address'
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        >;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                          type ExtraVideo

                                                                                                                                                                                                                                                                                                                                                                                                                                                                          type ExtraVideo =