The underlying axios instance.
Use this method to add a new sticker to a set created by the bot.
User identifier of sticker set owner
Sticker set name
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. Pass a file_id as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet. Upload file is not supported yet.
One or more emoji corresponding to the sticker
Options for other optional parameters.
Returns True on success.
Use this method to send answers to callback queries sent from inline keyboards. The answer will be displayed to the user as a notification at the top of the chat screen or as an alert. On success, True is returned.
Alternatively, the user can be redirected to the specified Game URL. For this option to work, you must first create a game for your bot via @Botfather
and accept the terms. Otherwise, you may use links like t.me/your_bot?start=XXXX that open your bot with a parameter.
Unique identifier for the query to be answered
Optional parameters for other parameters.
Use this method to send answers to an inline query. No more than 50 results per query are allowed.
Unique identifier for the answered query
A JSON-serialized array of results for the inline query
Optional parameters for other parameters.
On success, True is returned.
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. Use this method to respond to such pre-checkout queries. Note: The Bot API must receive an answer within 10 seconds after the pre-checkout query was sent.
Unique identifier for the query to be answered
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.
Optional parameters for other parameters.
On success, True is returned.
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. Use this method to reply to shipping queries. On success, True is returned.
Unique identifier for the query to be answered
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)
Options for other optional parameters.
Use this method to create new sticker set owned by a user. The bot will be able to edit the created sticker set.
User identifier of created sticker set owner
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.
Sticker set title, 1-64 characters
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. Pass a file_id as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet. Upload file is not supported yet.
Returns True on success.
Use this method to delete a chat photo. Photos can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.
Note: In regular groups (non-supergroups), this method will only work if the ‘All Members Are Admins’ setting is off in the target group.
Unique identifier for the target chat or username of the target channel (in the format @channelusername
)
Returns True on success.
Use this method to delete a group sticker set from a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Use the field canSetStickerSet optionally returned in getChat requests to check if the bot can use this method.
Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername
)
Returns True on success.
Use this method to delete a message, including service messages, with the following limitations:
Unique identifier for the target chat or username of the target channel (in the format @channelusername
)
Identifier of the message to delete
True on success.
Use this method to delete a sticker from a set created by the bot.
File identifier of the sticker
Returns True on success.
Use this method to remove webhook integration if you decide to switch back to getUpdates.
Returns True on success.
Use this method to edit captions of messages.
New caption of the message
Options for other optional parameters. One of chatId, messageId or inlineMessageId is required.
On success, if edited message is sent by the bot, the edited Message is returned, otherwise True is returned.
Use this method to edit live location messages. A location can be edited until its live_period expires or editing is explicitly disabled by a call to stopMessageLiveLocation. On success, if the edited message was sent by the bot, the edited Message is returned, otherwise True is returned.
Object contains new latitude and longitude.
Latitude of new location
Longitude of new location
One of chatId, messageId or inlineMessageId is required.
Use this method to 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. On success, if the edited message was sent by the bot, the edited Message is returned, otherwise True is returned.
A JSON-serialized object for a new media content of the message
Options for other optional parameters.
Use this method to edit only the reply markup of messages.
A JSON-serialized object for an inline keyboard.
Options for other optional parameters. One of chatId, messageId or inlineMessageId is required.
On success, if edited message is sent by the bot, the edited Message is returned, otherwise True is returned.
Use this method to edit text and game messages.
New text of the message
Options for other optional parameters. One of chatId, messageId or inlineMessageId is required.
On success, if edited message is sent by the bot, the edited Message is returned, otherwise True is returned.
Use this method to generate a new invite link for a chat; any previously generated link is revoked. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.
Note: Each administrator in a chat generates their own invite links. Bots can't use invite links generated by other administrators. If you want your bot to work with invite links, it will need to generate its own link using exportChatInviteLink – after this the link will become available to the bot via the getChat method. If your bot needs to generate a new invite link replacing its previous one, use exportChatInviteLink again.
Unique identifier for the target chat or username of the target channel (in the format @channelusername
)
Returns the new invite link as String on success.
Use this method to forward messages of any kind.
Unique identifier for the target chat or username of the target channel (in the format @channelusername
)
Unique identifier for the chat where the original message was sent (or channel username in the format @channelusername
)
Message identifier in the chat specified in fromChatId
Options for other optional parameters.
On success, the sent Message is returned.
Use this method to 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.).
Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername
)
Returns a Chat object on success.
Use this method to get a list of administrators in a chat.
Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername
)
On success, returns an Array of ChatMember objects that contains information about all chat administrators except other bots. If the chat is a group or a supergroup and no administrators were appointed, only the creator will be returned.
Use this method to get information about a member of a chat.
Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername
)
Unique identifier of the target user
Returns a ChatMember object on success.
Use this method to get the number of members in a chat.
Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername
)
Returns Int on success.
Use this method to get basic info about a file and prepare it for downloading. For the moment, bots can download files of up to 20MB in size.
File identifier to get info about
On success, a File object is returned. The file can then be downloaded via the link https://api.telegram.org/file/bot<token>/<file_path>
, where <file_path>
is taken from the response. It is guaranteed that the link will be valid for at least 1 hour. When the link expires, a new one can be requested by calling getFile again.
Get link for file. This is an extension method of getFile()
File identifier to get info about
On success, a File URL is returned.
Use this method to get data for high score tables. Will return the score of the specified user and several of his neighbors in a game. On success, returns an Array of GameHighScore objects.
This method will currently return scores for the target user, plus two of his closest neighbors on each side. Will also return the top three users if the user and his neighbors are not among them. Please note that this behavior is subject to change.
Target user id
Optional parameters for other parameters.
Will return the score of the specified user and several of his neighbors in a game. On success, returns an Array of GameHighScore objects.
A simple method for testing your bot's auth token.
Returns basic information about the bot in form of a User object.
Use this method to get a sticker set.
Name of the sticker set
On success, a StickerSet object is returned.
Use this method to receive incoming updates using long polling.
Optional parameters.
An array of Update objects is returned.
Use this method to get a list of profile pictures for a user.
Unique identifier of the target user
Options for other optional parameters.
Returns a UserProfilePhotos object.
Use this method to get current webhook status.
On success, returns a WebhookInfo object. If the bot is using getUpdates, will return an object with the url field empty.
Use this method to 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.
Note: In regular groups (non-supergroups), this method will only work if the ‘All Members Are Admins’ setting is off in the target group. Otherwise members may only be removed by the group's creator or by the member that added them.
Unique identifier for the target group or username of the target supergroup or channel (in the format @channelusername
)
Unique identifier of the target user
Returns True on success.
Use this method for your bot to leave a group, supergroup or channel.
Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername
)
Returns True on success.
Use this method to 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.
Unique identifier for the target chat or username of the target channel (in the format @channelusername
)
Identifier of a message to pin
Options for other optional parameters.
Returns True on success.
Use this method to 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.
Unique identifier for the target chat or username of the target channel (in the format @channelusername
)
Unique identifier of the target user
Options for other optional parameters
Returns True on success.
Use this method to 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 permissions to lift restrictions from a user.
Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername
)
Unique identifier of the target user
New user permissions
Other optional parameters.
Returns True on success.
Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound). Bots can currently send animation files of up to 50 MB in size, this limit may be changed in the future.
Unique identifier for the target chat or username of the target channel (in the format @channelusername
)
Animation to send. Pass a file_id as String to send an animation that exists on the Telegram servers (recommended) or pass an HTTP URL as a String for Telegram to get an animation from the Internet. Upload file is not supported yet.
Options for other optional parameters.
On success, the sent Message is returned.
Use this method to send audio files, if you want Telegram clients to display them in the music player. Your audio must be in the .mp3 format. Bots can currently send audio files of up to 50 MB in size, this limit may be changed in the future.
For sending voice messages, use the sendVoice method instead.
Unique identifier for the target chat or username of the target channel (in the format @channelusername
)
-Audio file to send. Pass a file_id as String to send an audio file that exists on the Telegram servers (recommended) or pass an HTTP URL as a String for Telegram to get an audio file from the Internet. Upload file is not supported yet.
Options for other optional parameters.
On success, the sent Message is returned.
Use this method when you need to tell the user that something is happening on the bot's side. The status is set for 5 seconds or less (when a message arrives from your bot, Telegram clients clear its typing status).
Example: The ImageBot needs some time to process a request and upload the image. Instead of sending a text message along the lines of “Retrieving image, please wait…”, the bot may use sendChatAction with action = upload_photo. The user will see a “sending photo” status for the bot.
Unique identifier for the target chat or username of the target channel (in the format @channelusername
)
Types of action to broadcast. Choose one, depending on what the user is about to receive: typing for text messages, upload_photo for photos, record_video or upload_video for videos, record_audio or upload_audio for audio files, upload_document for general files, find_location for location data, record_video_note or upload_video_note for video notes.
Use this method to send phone contacts.
Unique identifier for the target chat or username of the target channel (in the format @channelusername
)
Optional parameters for other parameters.
On success, the sent Message is returned.
Use this method to 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.
Unique identifier for the target chat or username of the target channel (in the format @channelusername
)
File to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet. Upload file is not supported yet.
Options for other optional parameters.
On success, the sent Message is returned.
Use this method to send a game.
Unique identifier for the target chat
Short name of the game, serves as the unique identifier for the game. Set up your games via Botfather.
Options for other optional parameters.
On success, the sent Message is returned.
Use this method to send invoices.
Unique identifier for the target private chat
Options for other optional parameters.
On success, the sent Message is returned.
Use this method to send point on the map.
Unique identifier for the target chat or username of the target channel (in the format @channelusername
)
Object contains latitude and longitude.
Latitude of the location.
Longitude of the location.
Options for other optional parameters.
On success, the sent Message is returned.
Use this method to send a group of photos or videos as an album.
Unique identifier for the target chat or username of the target channel (in the format @channelusername
)
A JSON-serialized array describing photos and videos to be sent, must include 2–10 items
Options for other optional parameters.
On success, an array of the sent Messages is returned.
Use this method to send text messages.
Unique identifier for the target chat or username of the target channel (in the format @channelusername
)
Text of the message to be sent.
Options for other optional parameters.
On success, the sent Message is returned.
Use this method to send photos.
Unique identifier for the target chat or username of the target channel (in the format @channelusername
)
Photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended) or pass an HTTP URL as a String for Telegram to get a photo from the Internet. Upload file is not supported yet.
Options for other optional parameters.
On success, the sent Message is returned.
Use this method to send a native poll. A native poll can't be sent to a private chat.
Unique identifier for the target chat or username of the target channel (in the format @channelusername
). A native poll can't be sent to a private chat.
Poll question, 1-255 characters
List of answer options, 2-10 strings 1-100 characters each
Optional parameters for other parameters.
On success, the sent Message is returned.
Use this method to send static .WEBP or animated .TGS stickers.
Unique identifier for the target chat or username of the target channel (in the format @channelusername
)
Sticker to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), or pass an HTTP URL as a String for Telegram to get a .webp file from the Internet. Upload file is not supported yet.
Options for other optional parameters.
On success, the sent Message is returned.
Use this method to send information about a venue.
Unique identifier for the target chat or username of the target channel (in the format @channelusername
)
Object contains information of the venue.
Optional parameters for other parameters.
On success, the sent Message is returned.
Use this method to 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.
Unique identifier for the target chat or username of the target channel (in the format @channelusername
)
Video to send. Pass a file_id as String to send a video that exists on the Telegram servers (recommended) or pass an HTTP URL as a String for Telegram to get a video from the Internet. Upload file is not supported yet.
Options for other optional parameters.
On success, the sent Message is returned.
As of v.4.0, Telegram clients support rounded square mp4 videos of up to 1 minute long. Use this method to send video messages.
Unique identifier for the target chat or username of the target channel (in the format @channelusername
)
Video note to send. Pass a file_id as String to send a video note that exists on the Telegram servers. Sending video notes by a URL is currently unsupported. Upload file is not supported yet.
Options for other optional parameters.
On success, the sent Message is returned.
Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .ogg file encoded with OPUS (other formats may be sent as Audio or Document). Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future.
identifier for the target chat or username of the target channel (in the format @channelusername
)
Audio file to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended) or pass an HTTP URL as a String for Telegram to get a file from the Internet. Upload file is not supported yet.
Options for other optional parameters.
On success, the sent Message is returned.
Use this method to change the description of a group, a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.
Unique identifier for the target chat or username of the target channel (in the format @channelusername
)
New chat description, 0-255 characters
Returns True on success.
Use this method to set default chat permissions for all members. The bot must be an administrator in the group or a supergroup for this to work and must have the can_restrict_members admin rights.
Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername
)
New default chat permissions
Returns True on success.
Use this method to set a new group sticker set for a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Use the field canSetStickerSet optionally returned in getChat requests to check if the bot can use this method.
Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername
)
Name of the sticker set to be set as the group sticker set
Returns True on success.
Use this method to change the title of a chat. Titles can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.
Note: In regular groups (non-supergroups), this method will only work if the ‘All Members Are Admins’ setting is off in the target group.
Unique identifier for the target chat or username of the target channel (in the format @channelusername
)
New chat title, 1-255 characters
Returns True on success.
Use this method to set the score of the specified user in a game.
User identifier
New score, must be non-negative
Options for other optional parameters.
On success, if the message was sent by the bot, returns the edited Message, otherwise returns True. Returns an error, if the new score is not greater than the user's current score in the chat and force is False.
Use this method to move a sticker in a set created by the bot to a specific position.
File identifier of the sticker
New sticker position in the set, zero-based.
Returns True on success.
Use this method to specify a url and receive incoming updates via an outgoing webhook. Whenever there is an update for the bot, we will send an HTTPS POST request to the specified url, containing a JSON-serialized Update. In case of an unsuccessful request, we will give up after a reasonable amount of attempts.
If you'd like to make sure that the Webhook request comes from Telegram, we recommend using a secret path in the URL, e.g. https://www.example.com/
HTTPS url to send updates to. Use an empty string to remove webhook integration.
Optional parameters.
True on success.
Use this method to stop updating a live location message before live_period expires. On success, if the message was sent by the bot, the sent Message is returned, otherwise True is returned.
One of chatId, messageId or inlineMessageId is required.
Use this method to stop a poll which was sent by the bot.
Unique identifier for the target chat or username of the target channel (in the format @channelusername
)
Identifier of the original message with the poll
Options for other optional parameters.
On success, the stopped Poll with the final results is returned.
Use this method to unban a previously kicked user in a supergroup or channel. The user will not return to the group or channel automatically, but will be able to join via link, etc. The bot must be an administrator for this to work.
Unique identifier for the target group or username of the target supergroup or channel (in the format @username
)
Unique identifier of the target user
Returns True on success.
Use this method to 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.
Unique identifier for the target chat or username of the target channel (in the format @channelusername
)
Returns True on success.
Generated using TypeDoc
The access token used by the client.