Class BotContext
java.lang.Object
io.github.natanimn.telebof.BotContext
This class implemented all classes defined in io.github.natanimn.telebof.requests as directly usable methods.
- Since:
- March 3, 2025
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionaddStickerToSet(long user_id, String name, InputSticker sticker) Use this method to add a new sticker to a set created by the bot.answerCallbackQuery(String callback_query_id) Use this method to send answers to callback queries sent from inline keyboards.answerCallbackQuery(String callback_query_id, String text) answerCallbackQuery(java.lang.String)with text parameteranswerInlineQuery(String inline_query_id, InlineQueryResult[] results) Use this method to send answers to an inline query.answerPreCheckoutQuery(String pre_checkout_query_id, boolean ok) 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.answerShippingQuery(String shipping_query_id, boolean ok) 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.answerWebAppQuery(String web_app_query_id, InlineQueryResult result) Use this method to set the result of an interaction with a Web App and send a corresponding message on behalf of the user to the chat from which the query originated.approveChatJoinRequest(Object chat_id, long user_id) Use this method to approve a chat join request.approveSuggestedPost(long chat_id, int message_id) Use this method to approve a suggested post in a direct messages chat.banChatMember(Object chat_id, long user_id) Use this method to ban a user in a group, a supergroup or a channel.banChatSenderChat(Object chat_id, long sender_chat_id) Use this method to ban a channel chat in a supergroup or a channel.voidclearState(long user_id) Use this method to clear an existing state when it is no longer needed in a private chat for a user.voidclearState(long chat_id, long user_id) Use this method to clear an existing state when it is no longer needed in a group/supergroup chat for a user.close()Use this method to close the bot instance before moving it from one local server to another.closeForumTopic(Object chat_id, int message_thread_id) Use this method to close an open topic in a forum supergroup chat.closeGeneralForumTopic(Object chat_id) Use this method to close an open 'General' topic in a forum supergroup chat.convertGiftToStars(String business_connection_id, String owned_gift_id) Converts a given regular gift to Telegram Stars.Use this method to copy messages of any kind.copyMessages(Object chat_id, Object from_chat_id, Integer[] message_ids) Use this method to copy messages of any kind.createChatInviteLink(Object chat_id) Use this method to create an additional invite link for a chat.createChatSubscriptionInviteLink(Object chat_id, int subscription_period, int subscription_price) Use this method to create a subscription invite link for a channel chat.createForumTopic(Object chat_id, String name) Use this method to create a topic in a forum supergroup chat.createInvoiceLink(String title, String description, String payload, String currency, LabeledPrice[] prices) Use this method to create a link for an invoice.createNewStickerSet(long user_id, String name, String title, InputSticker[] stickers) Use this method to create a new sticker set owned by a user.declineChatJoinRequest(Object chat_id, long user_id) Use this method to decline a chat join request.declineSuggestedPost(long chat_id, int message_id) Use this method to decline a suggested post in a direct messages chat.deleteBusinessMessages(String business_connection_id, Integer[] message_ids) Delete messages on behalf of a business account.deleteChatPhoto(Object chat_id) Use this method to delete a chat photo.deleteChatStickerSet(Object chat_id) Use this method to delete a group sticker set from a supergroup.deleteForumTopic(Object chat_id, int message_thread_id) Use this method to delete a forum topic along with all its messages in a forum supergroup chat.deleteMessage(Object chat_id, int message_id) Use this method to delete a message, including service messages, with the following limitations:deleteMessages(Object chat_id, Integer[] message_ids) Use this method to delete multiple messages simultaneously.Use this method to delete the list of the bot's commands for the given scope and user language.deleteStickerFromSet(String sticker) Use this method to delete a sticker from a set created by the bot.deleteStickerSet(String name) Use this method to delete a sticker set that was created by the bot.deleteStory(String business_connection_id, Integer story_id) Deletes a story previously posted by the bot on behalf of a managed business account.voidUse this method to remove webhook integration if you decide to back getUpdates.byte[]downloadFile(String file_path) Use this method to download files up to 20MB in size.editChatInviteLink(Object chat_id, String invite_link) Use this method to edit a non-primary invite link created by the bot.editChatSubscriptionInviteLink(Object chat_id, String invite_link) Use this method to edit a subscription invite link created by the bot.editForumTopic(Object chat_id, int message_thread_id) Use this method to edit name and icon of a topic in a forum supergroup chat.editGeneralForumTopic(Object chat_id, String name) Use this method to edit the name of the 'General' topic in a forum supergroup chat.editMessageCaption(Object chat_id, int message_id) Use this method to edit captions of messages.editMessageCaption(String inline_message_id) Use this method to edit captions of messages.editMessageChecklist(String business_connection_id, Object chat_id, Integer message_id, InputChecklist checklist) Use this method to edit a checklist on behalf of a connected business account.editMessageLiveLocation(Object chat_id, double latitude, double longitude, int message_id) Use this method to edit live location messages.editMessageLiveLocation(String inline_message_id, double latitude, double longitude) Use this method to edit live location messages.editMessageMedia(Object chat_id, InputMedia media, int message_id) Use this method to edit animation, audio, document, photo, or video messages, or to add media to text messages.editMessageMedia(String inline_message_id, InputMedia media) Use this method to edit animation, audio, document, photo, or video messages, or to add media to text messages.editMessageReplyMarkup(Object chat_id, int message_id) Use this method to edit only the reply markup of messages.editMessageReplyMarkup(String inline_message_id) Use this method to edit only the reply markup of messages.editMessageText(String text, Object chat_id, int message_id) Use this method to edit text and game messages.editMessageText(String text, String inline_message_id) Use this method to edit text and game messages.editStory(String business_connection_id, Integer story_id, InputStoryContent content) Edits a story previously posted by the bot on behalf of a managed business account.editUserStarSubscription(long user_id, String telegram_charge_id, boolean is_cancelled) This a method that allows the bot to cancel or re-enable extension of a subscription paid in Telegram Stars.exportChatInviteLink(Object chat_id) Use this method to generate a new primary invite link for a chat; any previously generated primary link is revoked.Use this method to forward messages of any kind.forwardMessages(Object chat_id, Object from_chat_id, Integer[] message_id) Use this method to forward multiple messages of any kind.Returns the list of gifts that can be sent by the bot to users and channel chats.getBusinessAccountGifts(String business_connection_id) Returns the gifts received and owned by a managed business account.getBusinessAccountStarBalance(String business_connection_id) Returns the amount of Telegram Stars owned by a managed business account.getBusinessConnection(String business_connection_id) Use this method to get information about the connection of the bot with a business account.Use this method to get up-to-date information about the chat.getChatAdministrators(Object chat_id) Use this method to get a list of administrators in a chat, which aren't bots.getChatMember(Object chat_id, long user_id) Use this method to get information about a member of a chat.getChatMemberCount(Object chat_id) Use this method to get the number of members in a chat.Use this method to get the current value of the bot's menu button in a private chat, or the default menu button.getCustomEmojiStickers(String[] custom_emoji_ids) Use this method to get information about custom emoji stickers by their identifiers.Use this method to get basic information about a file and prepare it for downloading.Use this method to get custom emoji stickers, which can be used as a forum topic icon by any user.getGameHighScores(long chat_id, long user_id, int message_id) Use this method to get data for high score tables.getGameHighScores(String inline_message_id, long user_id) Use this method to get data for high score tables.getMe()A simple method for testing your bot's authentication token.Use this method to get the current list of the bot's commands for the given scope and user language.Use this method to get the current default administrator rights of the bot.Use this method to get the current bot description for the given user language.Use this method to get the current bot name for the given user languageA method to get the current Telegram Stars balance of the bot.Returns the bot's Telegram Star transactions in chronological order.getStateData(long user_id) Use this method to retrieve saved state data in a private chat for a usergetStateData(long chat_id, long user_id) Use this method to retrieve saved state data in a group/supergroup chat for a usergetStickerSet(String name) Use this method to get a sticker set.Use this method to receive incoming updates using long pollinggetUserChatBoosts(Object chat_id, long user_id) Use this method to get the list of boosts added to a chat by a user.getUserProfilePhotos(long user_id) Use this method to get a list of profile pictures for a user.giftPremiumSubscription(long user_id, Integer month_count, Integer star_count) Gifts a Telegram Premium subscription to the given user.hideGeneralForumTopic(Object chat_id) Use this method to hide the 'General' topic in a forum supergroup chat.Use this method for your bot to leave a group, supergroup or channel.logOut()Use this method to log out from the cloud Bot API server before launching the bot locally.pinChatMessage(Object chat_id, int message_id) Use this method to add a message to the list of pinned messages in a chat.postStory(String business_connection_id, InputStoryContent content, Integer active_period) Posts a story on behalf of a managed business account.promoteChatMember(Object chat_id, long user_id) Use this method to promote or demote a user in a supergroup or a channel.readBusinessMessage(long chat_id, String business_connection_id, int message_id) Marks incoming message as read on behalf of a business account.refundStarPayment(long user_id, String telegram_payment_change_id) Refunds a successful payment in Telegram Stars.removeBusinessAccountProfilePhoto(String business_connection_id) Removes the current profile photo of a managed business account.removeChatVerification(Object chat_id) Removes verification from a chat that is currently verified on behalf of the organization represented by the bot.removeUserVerification(long user_id) Removes verification from a user who is currently verified on behalf of the organization represented by the bot.reopenForumTopic(Object chat_id, int message_thread_id) Use this method to reopen a closed topic in a forum supergroup chat.reopenGeneralForumTopic(Object chat_id) Use this method to reopen a closed 'General' topic in a forum supergroup chat.replaceStickerInSet(long user_id, String name, String old_sticker, InputSticker sticker) Use this method to replace an existing sticker in a sticker set with a new one.restrictChatMember(Object chat_id, long user_id, ChatPermissions permissions) Use this method to restrict a user in a supergroup.revokeChatInviteLink(Object chat_id, String invite_link) Use this method to revoke an invite link created by the bot.savePreparedInlineMessage(long user_id, InlineQueryResult result) Stores a message that can be sent by a user of a Mini App.sendAnimation(Object chat_id, File animation) Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound).sendAnimation(Object chat_id, String animation) Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound).Use this method to send audio files, if you want Telegram clients to display them in the music player.Use this method to send audio files, if you want Telegram clients to display them in the music player.sendChatAction(Object chat_id, ChatAction action) Use this method when you need to tell the user that something is happening on the bot's side.sendChecklist(String business_connection_id, Object chat_id, InputChecklist checklist) Use this method to send a checklist on behalf of a connected business account.sendContact(Object chat_id, String phone_number, String first_name) Use this method to send phone contacts.Use this method to send an animated emoji that will display a random value.sendDocument(Object chat_id, File document) Use this method to send general files.sendDocument(Object chat_id, String document) Use this method to send general files.Use this method to send a gameSends a gift to the given user or channel chat.Sends a gift to the given user or channel chat.sendInvoice(Object chat_id, String title, String description, String payload, String currency, LabeledPrice[] prices) Use this method to send invoices.sendLocation(Object chat_id, double latitude, double longitude) Use this method to send point on the map.sendMediaGroup(Object chat_id, InputMedia[] media) Use this method to send a group of photos, videos, documents or audios as an album.sendMessage(Object chat_id, String text) Use this method to send text messages.sendPaidMedia(Object chat_id, short star_count, InputPaidMedia[] media) Use this method to send paid media.Use this method to send photos.Use this method to send photos.sendPoll(Object chat_id, String question, InputPollOption[] options) Use this method to send a native poll.sendSticker(Object chat_id, File sticker) sendSticker(Object chat_id, String sticker) Use this method to send information about a venue.Use this method to send video files, Telegram clients support MPEG4 videos (other formats may be sent as Document).Use this method to send video files, Telegram clients support MPEG4 videos (other formats may be sent as Document).sendVideoNote(Object chat_id, File video_note) As of v.4.0, Telegram clients support rounded square MPEG4 videos of up to 1 minute long.sendVideoNote(Object chat_id, String video_note) As of v.4.0, Telegram clients support rounded square MPEG4 videos of up to 1 minute long.Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message.Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message.setBusinessAccountBio(String business_connection_id) Changes the bio of a managed business account.setBusinessAccountGiftSettings(String business_connection_id, boolean show_gift_button, AcceptedGiftTypes accepted_gift_types) Changes the privacy settings pertaining to incoming gifts in a managed business account.setBusinessAccountName(String business_connection_id, String first_name) Changes the first and last name of a managed business account.setBusinessAccountProfilePhoto(String business_connection_id, InputProfilePhoto photo) Changes the profile photo of a managed business account.setBusinessAccountUsername(String business_connection_id) Changes the username of a managed business account.setChatAdministratorCustomTitle(Object chat_id, long user_id, String custom_title) Use this method to set a custom title for an administrator in a supergroup promoted by the bot.setChatDescription(Object chat_id, String description) Use this method to change the description of a group, a supergroup or a channel.Use this method to change the bot's menu button in a private chat, or the default menu button.setChatPermissions(Object chat_id, ChatPermissions permissions) Use this method to set default chat permissions for all members.setChatPhoto(Object chat_id, File photo) Use this method to set a new profile photo for the chat.setChatStickerSet(Object chat_id, String sticker_set_name) Use this method to set a new group sticker set for a supergroup.setChatTitle(Object chat_id, String title) Use this method to change the title of a chat.Use this method to set the thumbnail of a custom emoji sticker set.setGameScore(long chat_id, long user_id, int score, int message_id) Use this method to set the score of the specified user in a game message.setGameScore(String inline_message_id, long user_id, int score) Use this method to set the score of the specified user in a game message.setMessageReaction(Object chat_id, int message_id) Use this method to change the chosen reactions on a message.setMyCommands(BotCommand[] commands) Use this method to change the list of the bot's commands.Use this method to change the default administrator rights requested by the bot when it's added as an administrator to groups or channels.Use this method to change the bot's description, which is shown in the chat with the bot if the chat is empty.Use this method to change the bot's name.setPassportDataErrors(long user_id, PassportElementError[] errors) Informs a user that some of the Telegram Passport elements they provided contains errors.voidUse this method to set new state in group/supergroup chat for a uservoidUse this method to set new state in private chat for a usersetStickerEmojiList(String sticker, String[] emoji_list) Use this method to change the list of emoji assigned to a regular or custom emoji sticker.setStickerKeywords(String sticker, String[] keywords) Use this method to change search keywords assigned to a regular or custom emoji sticker.setStickerMaskPosition(String sticker) Use this method to change the mask position of a mask sticker.setStickerPositionInSet(String sticker, int position) Use this method to move a sticker in a set created by the bot to a specific position.setStickerSetThumbnail(String name, long user_id, File thumbnail, StickerFormat format) Use this method to set the thumbnail of a regular or mask sticker set.setStickerSetThumbnail(String name, long user_id, String thumbnail, StickerFormat format) Use this method to set the thumbnail of a regular or mask sticker set.setStickerSetTitle(String name, String title) Use this method to set the title of a created sticker set.setUserEmojiStatus(long user_id) This method Changes the emoji status for a given user that previously allowed the bot to manage their emoji status via the Mini App method requestEmojiStatusAccess.setWebhook(String url) Use this method to specify a URL and receive incoming updates via an outgoing webhook.stopMessageLiveLocation(Object chat_id, int message_id) Use this method to stop updating a live location message before live_period expires.stopMessageLiveLocation(String inline_message_id) Use this method to stop updating a live location message before live_period expires.Use this method to stop a poll which was sent by the bot.transferBusinessAccountStars(String business_connection_id, short star_count) Transfers Telegram Stars from the business account balance to the bot's balance.transferGift(String business_connection_id, String owned_gift_id, long new_owner_chat_id) Transfers an owned unique gift to another user.unbanChatMember(Object chat_id, long user_id) Use this method to unban a previously banned user in a supergroup or channel.unbanChatSenderChat(Object chat_id, long sender_chat_id) Use this method to unban a previously banned channel chat in a supergroup or channel.unHideGeneralForumTopic(Object chat_id) Use this method to unhide the 'General' topic in a forum supergroup chat.unpinAllChatMessages(Object chat_id) Use this method to clear the list of pinned messages in a chat.unpinAllForumTopicMessages(Object chat_id, int message_thread_id) Use this method to clear the list of pinned messages in a forum topic.unpinAllGeneralForumTopicMessages(Object chat_id) Use this method to clear the list of pinned messages in a General forum topic.unpinChatMessage(Object chat_id) Use this method to remove a message from the list of pinned messages in a chat.upgradeGift(String business_connection_id, String owned_gift_id) Upgrades a given regular gift to a unique gift.uploadStickerFile(long user_id, File sticker, StickerFormat sticker_format) Use this method to upload a file with a sticker for later use in thecreateNewStickerSet(long, java.lang.String, java.lang.String, io.github.natanimn.telebof.types.input.InputSticker[]),addStickerToSet(long, java.lang.String, io.github.natanimn.telebof.types.input.InputSticker), orreplaceStickerInSet(long, java.lang.String, java.lang.String, io.github.natanimn.telebof.types.input.InputSticker)methods (the file can be used multiple times).verifyUChat(Object chat_id) Verifies a c chat on behalf of the organization which is represented by the bot.verifyUser(long user_id) Verifies a user on behalf of the organization which is represented by the bot.
- 
Constructor Details- 
BotContext
 
- 
- 
Method Details- 
setWebhookUse 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 If you'd like to make sure that the webhook was set by you, you can specify secret data in the parameter secretToken. If specified, the request will contain a header “X-Telegram-Bot-Api-Secret-Token” with the secret token as content. - Parameters:
- url- holds parameters for webhook.
- See Also:
 
- 
getWebhookInfo
- 
deleteWebhookpublic void deleteWebhook()Use this method to remove webhook integration if you decide to back getUpdates.- See Also:
 
- 
getMe
- 
logOutUse this method to log out from the cloud Bot API server before launching the bot locally. You must log out the bot before running it locally, otherwise there is no guarantee that the bot will receive updates. After a successful call, you can immediately log in on a local server, but will not be able to log in back to the cloud Bot API server for 10 minutes.- Returns:
- LogOut
 
- 
closeUse this method to close the bot instance before moving it from one local server to another. You need to delete the webhook before calling this method to ensure that the bot isn't launched again after server restart. The method will return error 429 in the first 10 minutes after the bot is launched.- Returns:
- Close
 
- 
sendMessageUse this method to send text messages.- Parameters:
- chat_id- Unique identifier for the target chat or username of the target channel (in the format @channelusername)
- text- Text of the message to be sent, 1-4096 characters after entities parsing
- Returns:
- SendMessage
 
- 
downloadFileUse this method to download files up to 20MB in size. On success, aFileobject is returned.- Parameters:
- file_path- taken from- GetFileresponse. 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(String)again
- Returns:
- array of byte
 
- 
forwardUse this method to forward messages of any kind. Service messages and messages with protected content can't be forwarded.- Parameters:
- chat_id- Unique identifier for the target chat or username of the target channel (in the format @channelusername)
- from_chat_id- Unique identifier for the chat where the original message was sent (or channel username in the format @channelusername)
- message_id- Message identifier in the chat specified in from_chat_id
- Returns:
- ForwardMessage
 
- 
copyUse this method to copy messages of any kind. Service messages, paid media messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz poll can be copied only if the value of the field correct_option_id is known to the bot. The method is analogous to the method forwardMessage, but the copied message doesn't have a link to the original message.- Parameters:
- chat_id- Unique identifier for the target chat or username of the target channel (in the format @channelusername)
- from_chat_id- Unique identifier for the chat where the original message was sent (or channel username in the format @channelusername)
- message_id- Message identifier in the chat specified in from_chat_id
- Returns:
- CopyMessage
 
- 
copyMessagesUse this method to copy messages of any kind. If some of the specified messages can't be found or copied, they are skipped. Service messages, paid media messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz poll can be copied only if the value of the field correct_option_id is known to the bot. The method is analogous to the method forwardMessages, but the copied messages don't have a link to the original message. Album grouping is kept for copied messages.- Parameters:
- chat_id- Unique identifier for the target chat or username of the target channel (in the format @channelusername)
- from_chat_id- Unique identifier for the chat where the original message was sent (or channel username in the format @channelusername)
- message_ids- A JSON-serialized list of 1-100 identifiers of messages in the chat from_chat_id to copy. The identifiers must be specified in a strictly increasing order.
- Returns:
- CopyMessage
 
- 
forwardMessagesUse this method to forward multiple messages of any kind. If some of the specified messages can't be found or forwarded, they are skipped. Service messages and messages with protected content can't be forwarded. Album grouping is kept for forwarded messages.- Parameters:
- chat_id- Unique identifier for the target chat or username of the target channel (in the format @channelusername)
- from_chat_id- Unique identifier for the chat where the original messages were sent (or channel username in the format @channelusername)
- message_id- A JSON-serialized list of 1-100 identifiers of messages in the chat from_chat_id to forward. The identifiers must be specified in a strictly increasing order.
- Returns:
- ForwardMessages
 
- 
sendPhotoUse this method to send photos.- Parameters:
- chat_id- Unique identifier for the target chat or username of the target channel (in the format @channelusername)
- photo- Photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a photo from the Internet
- Returns:
- SendPhoto
 
- 
sendPhotoUse this method to send photos.- Parameters:
- chat_id- Unique identifier for the target chat or username of the target channel (in the format @channelusername)
- photo- Photo to send. Upload new photo using- File. The photo must be at most 10 MB in size. The photo's width and height must not exceed 10000 in total. Width and height ratio must be at most 20
- Returns:
- SendPhoto
 
- 
sendAudioUse this method to send audio files, if you want Telegram clients to display them in the music player. Your audio must be in the .MP3 or .M4A format. Bots can currently send audio files of up to 50 MB in size, this limit may be changed in the future- Parameters:
- chat_id- Unique identifier for the target chat or username of the target channel (in the format @channelusername)
- audio- 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.
- Returns:
- SendAudio
 
- 
sendAudioUse this method to send audio files, if you want Telegram clients to display them in the music player. Your audio must be in the .MP3 or .M4A format. Bots can currently send audio files of up to 50 MB in size, this limit may be changed in the future
- 
sendDocumentUse 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.- Parameters:
- chat_id- Unique identifier for the target chat or username of the target channel (in the format @channelusername)
- document- 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.
- Returns:
- SendDocument
 
- 
sendDocumentUse 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.- Parameters:
- chat_id- Unique identifier for the target chat or username of the target channel (in the format @channelusername)
- document- File to send. Upload using- File
- Returns:
- SendDocument
 
- 
sendVideoUse this method to send video files, Telegram clients support MPEG4 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.- Parameters:
- chat_id- Unique identifier for the target chat or username of the target channel (in the format @channelusername)
- video- 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
- Returns:
- SendVideo
 
- 
sendVideoUse this method to send video files, Telegram clients support MPEG4 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.
- 
sendAnimationUse 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.- Parameters:
- chat_id- Unique identifier for the target chat or username of the target channel (in the format @channelusername)
- animation- 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.
- Returns:
- SendAnimation
 
- 
sendAnimationUse 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.- Parameters:
- chat_id- Unique identifier for the target chat or username of the target channel (in the format @channelusername)
- animation- Animation to send. Upload using- File.
- Returns:
- SendAnimation
 
- 
sendVoiceUse this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS, or in .MP3 format, or in .M4A format (other formats may be sent as Audio or Document). Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future.- Parameters:
- chat_id- Unique identifier for the target chat or username of the target channel (in the format @channelusername)
- voice- 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.
- Returns:
- SendVoice
 
- 
sendVoiceUse this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS, or in .MP3 format, or in .M4A format (other formats may be sent as Audio or Document). Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future.
- 
sendVideoNoteAs of v.4.0, Telegram clients support rounded square MPEG4 videos of up to 1 minute long.
 Use this method to send video messages.- Parameters:
- chat_id- Unique identifier for the target chat or username of the target channel (in the format @channelusername)
- video_note- Video note to send. Pass a file_id as String to send a video note that exists on the Telegram servers (recommended)
- Returns:
- SendVideoNote
 
- 
sendVideoNoteAs of v.4.0, Telegram clients support rounded square MPEG4 videos of up to 1 minute long.
 Use this method to send video messages.- Parameters:
- chat_id- Unique identifier for the target chat or username of the target channel (in the format @channelusername)
- video_note- Video note to send. Upload using- File
- Returns:
- SendVideoNote
 
- 
sendMediaGroupUse this method to send a group of photos, videos, documents or audios as an album. Documents and audio files can be only grouped in an album with messages of the same type.- Parameters:
- chat_id- Unique identifier for the target chat or username of the target channel (in the format @channelusername)
- media- An array of- InputMediaVideo,- InputMediaAudio,- InputMediaPhoto, or- InputMediaDocumentdescribing messages to be sent, must include 2-10 items.
- Returns:
- SendMediaGroup
 
- 
sendPaidMediaUse this method to send paid media.- Parameters:
- chat_id- Unique identifier for the target chat or username of the target channel (in the format @channelusername). If the chat is a channel, all Telegram Star proceeds from this media will be credited to the chat's balance. Otherwise, they will be credited to the bot's balance.
- star_count- The number of Telegram Stars that must be paid to buy access to the media; 1-10000
- media- A JSON-serialized array describing the media to be sent; up to 10 items
- Returns:
- SendPaidMedia
 
- 
sendLocationUse this method to send point on the map.- Parameters:
- chat_id- Unique identifier for the target chat or username of the target channel (in the format @channelusername)
- latitude- Latitude of the location
- longitude- Longitude of the location
- Returns:
- SendLocation
 
- 
editMessageLiveLocationpublic EditMessageLiveLocation editMessageLiveLocation(Object chat_id, double latitude, double longitude, int message_id) 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, the edited Message is returned.- Parameters:
- chat_id- Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername)
- latitude- Latitude of new location
- longitude- Longitude of new location
- message_id- Required if inline_message_id is not specified. Identifier of the message to edit
- Returns:
- EditMessageLiveLocation
 
- 
editMessageLiveLocationpublic EditMessageLiveLocation editMessageLiveLocation(String inline_message_id, double latitude, double longitude) 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, True is returned.- Parameters:
- inline_message_id- Required if chat_id and message_id are not specified. Identifier of the inline message
- latitude- Latitude of new location
- longitude- Longitude of new location
- Returns:
- EditMessageLiveLocation
 
- 
editUserStarSubscriptionpublic EditUserStarSubscription editUserStarSubscription(long user_id, String telegram_charge_id, boolean is_cancelled) This a method that allows the bot to cancel or re-enable extension of a subscription paid in Telegram Stars.- Parameters:
- user_id- Identifier of the user whose subscription will be edited
- telegram_charge_id- Telegram payment identifier for the subscription
- is_cancelled- Pass True to cancel extension of the user subscription; the subscription must be active up to the end of the current subscription period. Pass False to allow the user to re-enable a subscription that was previously canceled by the bot.
- Returns:
- EditUserStarSubscription
 
- 
stopMessageLiveLocationUse this method to stop updating a live location message before live_period expires. On success, the edited Message is returned.- Parameters:
- chat_id- Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername)
- message_id- Required if inline_message_id is not specified. Identifier of the message with live location to stop
- Returns:
- StopMessageLiveLocation
 
- 
stopMessageLiveLocationUse this method to stop updating a live location message before live_period expires. On success, True is returned.- Parameters:
- inline_message_id- Required if chat_id and message_id are not specified.
 Identifier of the inline message
- Returns:
- StopMessageLiveLocation
 
- 
editMessageChecklistpublic EditMessageChecklist editMessageChecklist(String business_connection_id, Object chat_id, Integer message_id, InputChecklist checklist) Use this method to edit a checklist on behalf of a connected business account.- Parameters:
- business_connection_id- Unique identifier of the business connection on behalf of which the message will be sent
- chat_id- Unique identifier for the target chat
- message_id- Unique identifier for the target message
- checklist- A JSON-serialized object for the new checklist
- Returns:
- EditMessageChecklist
 
- 
sendVenuepublic SendVenue sendVenue(Object chat_id, double latitude, double longitude, String title, String address) Use this method to send information about a venue.- Parameters:
- chat_id- Unique identifier for the target chat or username of the target channel (in the format @channelusername)
- latitude- Latitude of the venue
- longitude- Longitude of the venue
- title- Name of the venue
- address- Address of the venue
- Returns:
- SendVenue
 
- 
sendContactUse this method to send phone contacts.- Parameters:
- chat_id- Unique identifier for the target chat or username of the target channel (in the format @channelusername)
- phone_number- Contact's phone number
- first_name- Contact's first name
- Returns:
- SendContact
 
- 
sendPollUse this method to send a native poll.- Parameters:
- chat_id- Unique identifier for the target chat or username of the target channel (in the format @channelusername)
- question- Poll question, 1-300 characters
- options- A JSON-serialized list of 2-12 answer options
- Returns:
- SendPoll
 
- 
sendChecklistpublic SendChecklist sendChecklist(String business_connection_id, Object chat_id, InputChecklist checklist) Use this method to send a checklist on behalf of a connected business account.- Parameters:
- business_connection_id- Unique identifier of the business connection on behalf of which the message will be sent
- chat_id- Unique identifier for the target chat
- checklist- A JSON-serialized object for the checklist to send
- Returns:
- SendChecklist
 
- 
sendDice
- 
sendChatActionUse this method when you need to tell the user that something is happening on the bot's side. The status is set for 5 seconds or less (when a message arrives from your bot, Telegram clients clear its typing status).- Parameters:
- chat_id- Unique identifier for the target chat or username of the target channel (in the format @channelusername)
- action- Type of action to broadcast. Choose one, depending on what the user is about to receive:- ChatAction.TYPINGfor text messages,- ChatAction.UPLOAD_PHOTOfor photos,- ChatAction.RECORD_VIDEOor- ChatAction.UPLOAD_VIDEOfor videos,- ChatAction.RECORD_VOICEor- ChatAction.UPLOAD_VOICEfor voice notes,- ChatAction.UPLOAD_DOCUMENTfor general files,- ChatAction.CHOSE_STICKERfor stickers,- ChatAction.FIND_LOCATIONfor location data,- ChatAction.RECORD_VIDEO_NOTEor- ChatAction.UPLOAD_VIDEO_NOTEfor video notes.
- Returns:
- SendChatAction
 
- 
sendGiftSends a gift to the given user or channel chat. The gift can't be converted to Telegram Stars by the receiver- Parameters:
- user_id- Unique identifier of the target user who will receive the gift.
- gift_id- Identifier of the gift
- Returns:
- SendGift
 
- 
sendGiftSends a gift to the given user or channel chat. The gift can't be converted to Telegram Stars by the receiver- Parameters:
- chat_id- Unique identifier for the chat or username of the channel (in the format @channelusername) that will receive the gift.
- gift_id- Identifier of the gift
- Returns:
- SendGift
 
- 
giftPremiumSubscriptionpublic GiftPremiumSubscription giftPremiumSubscription(long user_id, Integer month_count, Integer star_count) Gifts a Telegram Premium subscription to the given user.- Parameters:
- user_id- Unique identifier of the target user who will receive a Telegram Premium subscription
- month_count- Number of months the Telegram Premium subscription will be active for the user; must be one of 3, 6, or 12
- star_count- Number of Telegram Stars to pay for the Telegram Premium subscription; must be 1000 for 3 months, 1500 for 6 months, and 2500 for 12 months
- Returns:
- GiftPremiumSubscription
 
- 
getUserProfilePhotosUse this method to get a list of profile pictures for a user.- Parameters:
- user_id- Unique identifier of the target user
- Returns:
- GetUserProfilePhotos
 
- 
refundStarPaymentRefunds a successful payment in Telegram Stars.- Parameters:
- user_id- Identifier of the user whose payment will be refunded
- telegram_payment_change_id- Telegram payment identifier
- Returns:
- RefundStarPayment
 
- 
verifyUserVerifies a user on behalf of the organization which is represented by the bot.- Parameters:
- user_id- Unique identifier of the target user
- Returns:
- VerifyUser
 
- 
verifyUChatVerifies a c chat on behalf of the organization which is represented by the bot.- Parameters:
- chat_id- Unique identifier for the target chat or username of the target channel (in the format @channelusername)
- Returns:
- VerifyUser
 
- 
removeUserVerificationRemoves verification from a user who is currently verified on behalf of the organization represented by the bot.- Parameters:
- user_id- Unique identifier of the target user
- Returns:
- RemoveUserVerification
 
- 
removeChatVerificationRemoves verification from a chat that is currently verified on behalf of the organization represented by the bot.- Parameters:
- chat_id- Unique identifier for the target chat or username of the target channel (in the format @channelusername)
- Returns:
- RemoveUserVerification
 
- 
readBusinessMessagepublic ReadBusinessMessage readBusinessMessage(long chat_id, String business_connection_id, int message_id) Marks incoming message as read on behalf of a business account. Requires the can_read_messages business bot right.- Parameters:
- chat_id- Unique identifier of the chat in which the message was received. The chat must have been active in the last 24 hours.
- business_connection_id- Unique identifier of the business connection on behalf of which to read the message
- message_id- Unique identifier of the message to mark as read
- Returns:
- ReadBusinessMessage
 
- 
approveSuggestedPostUse this method to approve a suggested post in a direct messages chat. The bot must have the 'can_post_messages' administrator right in the corresponding channel chat.- Parameters:
- chat_id- Unique identifier for the target direct messages chat
- message_id- Identifier of a suggested post message to approve
- Returns:
- ApproveSuggestedPost
 
- 
declineSuggestedPostUse this method to decline a suggested post in a direct messages chat. The bot must have the 'can_manage_direct_messages' administrator right in the corresponding channel chat.- Parameters:
- chat_id- Unique identifier for the target direct messages chat
- message_id- Identifier of a suggested post message to approve
- Returns:
- ApproveSuggestedPost
 
- 
deleteBusinessMessagespublic DeleteBusinessMessages deleteBusinessMessages(String business_connection_id, Integer[] message_ids) Delete messages on behalf of a business account. Requires the can_delete_sent_messages business bot right to delete messages sent by the bot itself, or the can_delete_all_messages business bot right to delete any message.- Parameters:
- business_connection_id- Unique identifier of the business connection on behalf of which to delete the messages
- message_ids- A JSON-serialized list of 1-100 identifiers of messages to delete. All messages must be from the same chat
 See- deleteMessage(java.lang.Object, int)for limitations on which messages can be deleted
- Returns:
- DeleteBusinessMessages
 
- 
setBusinessAccountNamepublic SetBusinessAccountName setBusinessAccountName(String business_connection_id, String first_name) Changes the first and last name of a managed business account. Requires the can_change_name business bot right.- Parameters:
- business_connection_id- Unique identifier of the business connection
- first_name- The new value of the first name for the business account; 1-64 characters
- Returns:
- SetBusinessAccountName
 
- 
setBusinessAccountUsernameChanges the username of a managed business account. Requires the can_change_username business bot right.- Parameters:
- business_connection_id- Unique identifier of the business connection
- Returns:
- SetBusinessAccountUsername
 
- 
setBusinessAccountBioChanges the bio of a managed business account. Requires the can_change_bio business bot right.- Parameters:
- business_connection_id- Unique identifier of the business connection
- Returns:
- SetBusinessAccountBio
 
- 
setBusinessAccountProfilePhotopublic SetBusinessAccountProfilePhoto setBusinessAccountProfilePhoto(String business_connection_id, InputProfilePhoto photo) Changes the profile photo of a managed business account. Requires the can_edit_profile_photo business bot right.- Parameters:
- business_connection_id- Unique identifier of the business connection
- photo- The new profile photo to set
- Returns:
- SetBusinessAccountProfilePhoto
 
- 
removeBusinessAccountProfilePhotopublic RemoveBusinessAccountProfilePhoto removeBusinessAccountProfilePhoto(String business_connection_id) Removes the current profile photo of a managed business account. Requires the can_edit_profile_photo business bot right- Parameters:
- business_connection_id- Unique identifier of the business connection
- Returns:
- RemoveBusinessAccountProfilePhoto
 
- 
setBusinessAccountGiftSettingspublic SetBusinessAccountGiftSettings setBusinessAccountGiftSettings(String business_connection_id, boolean show_gift_button, AcceptedGiftTypes accepted_gift_types) Changes the privacy settings pertaining to incoming gifts in a managed business account. Requires the can_change_gift_settings business bot right.- Parameters:
- business_connection_id- Unique identifier of the business connection
- show_gift_button- Pass True, if a button for sending a gift to the user or by the business account must always be shown in the input field
- accepted_gift_types- Types of gifts accepted by the business account
- Returns:
- SetBusinessAccountGiftSettings
 
- 
getBusinessAccountStarBalanceReturns the amount of Telegram Stars owned by a managed business account. Requires the can_view_gifts_and_stars business bot right.- Parameters:
- business_connection_id- Unique identifier of the business connection
- Returns:
- GetBusinessAccountStarBalance
 
- 
transferBusinessAccountStarspublic TransferBusinessAccountStars transferBusinessAccountStars(String business_connection_id, short star_count) Transfers Telegram Stars from the business account balance to the bot's balance. Requires the can_transfer_stars business bot right.- Parameters:
- business_connection_id- Unique identifier of the business connection
- star_count- Number of Telegram Stars to transfer; 1-10000
- Returns:
- TransferBusinessAccountStars
 
- 
getBusinessAccountGiftsReturns the gifts received and owned by a managed business account. Requires the can_view_gifts_and_stars business bot right.- Parameters:
- business_connection_id- Unique identifier of the business connection
- Returns:
- GetBusinessAccountGifts
 
- 
convertGiftToStarsConverts a given regular gift to Telegram Stars. Requires the can_convert_gifts_to_stars business bot right.- Parameters:
- business_connection_id- Unique identifier of the business connection
- owned_gift_id- Unique identifier of the regular gift that should be converted to Telegram Stars
- Returns:
- ConvertGiftToStars
 
- 
upgradeGiftUpgrades a given regular gift to a unique gift. Requires the can_transfer_and_upgrade_gifts business bot right. Additionally, requires the can_transfer_stars business bot right if the upgrade is paid.- Parameters:
- business_connection_id- Unique identifier of the business connection
- owned_gift_id- Unique identifier of the regular gift that should be upgraded to a unique one
- Returns:
- UpgradeGift
 
- 
transferGiftpublic TransferGift transferGift(String business_connection_id, String owned_gift_id, long new_owner_chat_id) Transfers an owned unique gift to another user. Requires the can_transfer_and_upgrade_gifts business bot right. Requires can_transfer_stars business bot right if the transfer is paid.- Parameters:
- business_connection_id- Unique identifier of the business connection
- owned_gift_id- Unique identifier of the regular gift that should be transferred
- new_owner_chat_id- Unique identifier of the chat which will own the gift. The chat must be active in the last 24 hours.
- Returns:
- TransferGift
 
- 
postStorypublic PostStory postStory(String business_connection_id, InputStoryContent content, Integer active_period) Posts a story on behalf of a managed business account. Requires the can_manage_stories business bot right.- Parameters:
- business_connection_id- Unique identifier of the business connection
- content- Content of the story
- active_period- Period after which the story is moved to the archive, in seconds; must be one of 6 * 3600, 12 * 3600, 86400, or 2 * 86400
- Returns:
- PostStory
 
- 
editStorypublic EditStory editStory(String business_connection_id, Integer story_id, InputStoryContent content) Edits a story previously posted by the bot on behalf of a managed business account. Requires the can_manage_stories business bot right.- Parameters:
- business_connection_id- Unique identifier of the business connection
- story_id- Unique identifier of the story to edit
- content- Content of the story
- Returns:
- EditStory
 
- 
deleteStoryDeletes a story previously posted by the bot on behalf of a managed business account. Requires the can_manage_stories business bot right.- Parameters:
- business_connection_id- Unique identifier of the business connection
- story_id- Unique identifier of the story to delete
- Returns:
- DeleteStory
 
- 
getFileUse this method to get basic information about a file and prepare it for downloading. For the moment, bots can download files of up to 20MB in size. The file can then be downloaded viadownloadFile(String)where field 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.- Parameters:
- file_id- File identifier to get information about
- Returns:
- GetFile
 
- 
banChatMemberUse this method to ban a user in a group, a supergroup or a channel. In the case of supergroups and channels, the user will not be able to return to the chat on their own using invite links, etc., unless unbanned first. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights.- Parameters:
- chat_id- Unique identifier for the target group or username of the target supergroup or channel (in the format @channelusername)
- user_id- Unique identifier of the target user
- Returns:
- BanChatMember
 
- 
unbanChatMemberUse this method to unban a previously banned user in a supergroup or channel. The user will not return to the group or channel automatically, but will be able to join via link, etc. The bot must be an administrator for this to work. By default, this method guarantees that after the call the user is not a member of the chat, but will be able to join it. So if the user is a member of the chat they will also be removed from the chat. If you don't want this, use the parameter only_if_banned.- Parameters:
- chat_id- Unique identifier for the target group or username of the target supergroup or channel (in the format @channelusername)
- user_id- Unique identifier of the target user
- Returns:
- UnbanChatMember
 
- 
unbanChatSenderChatUse this method to unban a previously banned channel chat in a supergroup or channel. The bot must be an administrator for this to work and must have the appropriate administrator rights.- Parameters:
- chat_id- Unique identifier for the target chat or username of the target channel (in the format @channelusername)
- sender_chat_id- Unique identifier of the target sender chat
- Returns:
- UnbanChatSenderChat
 
- 
restrictChatMemberpublic RestrictChatMember restrictChatMember(Object chat_id, long user_id, ChatPermissions permissions) 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 administrator rights. Pass True for all permissions to lift restrictions from a user.- Parameters:
- chat_id- Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
- user_id- Unique identifier of the target user
- permissions- A JSON-serialized object for new user permissions
- Returns:
- RestrictChatMember
 
- 
promoteChatMemberUse 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 administrator rights. Pass False for all boolean parameters to demote a user- Parameters:
- chat_id- Unique identifier for the target chat or username of the target channel (in the format @channelusername)
- user_id- Unique identifier of the target user
- Returns:
- PromoteChatMember
 
- 
setChatAdministratorCustomTitlepublic SetChatAdministratorCustomTitle setChatAdministratorCustomTitle(Object chat_id, long user_id, String custom_title) Use this method to set a custom title for an administrator in a supergroup promoted by the bot. Returns True on success.- Parameters:
- chat_id- Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
- user_id- Unique identifier of the target user
- custom_title- New custom title for the administrator; 0-16 characters, emoji are not allowed
- Returns:
- SetChatAdministratorCustomTitle
 
- 
setUserEmojiStatusThis method Changes the emoji status for a given user that previously allowed the bot to manage their emoji status via the Mini App method requestEmojiStatusAccess. Return True on success- Parameters:
- user_id- Unique identifier of the target user
- Returns:
- SetUserEmojiStatus
 
- 
banChatSenderChatUse this method to ban a channel chat in a supergroup or a channel. Until the chat is unbanned, the owner of the banned chat won't be able to send messages on behalf of any of their channels. The bot must be an administrator in the supergroup or channel for this to work and must have the appropriate administrator rights.- Parameters:
- chat_id- Unique identifier for the target chat or username of the target channel (in the format @channelusername)
- sender_chat_id- Unique identifier of the target sender chat
- Returns:
- BanChatSenderChat
 
- 
setChatPermissionsUse this method to set default chat permissions for all members. The bot must be an administrator in the group or a supergroup for this to work and must have the can_restrict_members administrator rights.- Parameters:
- chat_id- Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
- permissions- A JSON-serialized object for new default chat permissions
- Returns:
- SetChatPermissions
 
- 
exportChatInviteLinkUse this method to generate a new primary invite link for a chat; any previously generated primary link is revoked. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights.- Parameters:
- chat_id- Unique identifier for the target chat or username of the target channel (in the format @channelusername)
- Returns:
- ExportChatInviteLink
 
- 
createChatInviteLinkUse this method to create an additional invite link for a chat. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. The link can be revoked using the methodrevokeChatInviteLink(java.lang.Object, java.lang.String).- Parameters:
- chat_id- Unique identifier for the target chat or username of the target channel (in the format @channelusername)
- Returns:
- CreateChatInviteLink
 
- 
createChatSubscriptionInviteLinkpublic CreateChatSubscriptionInviteLink createChatSubscriptionInviteLink(Object chat_id, int subscription_period, int subscription_price) Use this method to create a subscription invite link for a channel chat. The bot must have the can_invite_users administrator rights. The link can be edited using the methodeditChatSubscriptionInviteLink(java.lang.Object, java.lang.String)or revoked using the methodrevokeChatInviteLink(java.lang.Object, java.lang.String).- Parameters:
- chat_id- Unique identifier for the target channel chat or username of the target channel (in the format @channelusername)
- subscription_period- The number of seconds the subscription will be active for before the next payment. Currently, it must always be 2592000 (30 days).
- subscription_price- The amount of Telegram Stars a user must pay initially and after each subsequent subscription period to be a member of the chat; 1-10000
- Returns:
- CreateChatSubscriptionInviteLink
 
- 
editChatInviteLinkUse this method to edit a non-primary invite link created by the bot. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights- Parameters:
- chat_id- Unique identifier for the target chat or username of the target channel (in the format @channelusername)
- invite_link- The invite link to edit
- Returns:
- EditChatInviteLink
 
- 
editChatSubscriptionInviteLinkpublic EditChatSubscriptionInviteLink editChatSubscriptionInviteLink(Object chat_id, String invite_link) Use this method to edit a subscription invite link created by the bot. The bot must have the can_invite_users administrator rights.- Parameters:
- chat_id- Unique identifier for the target chat or username of the target channel (in the format @channelusername)
- invite_link- The invite link to edit
- Returns:
- EditChatSubscriptionInviteLink
 
- 
revokeChatInviteLinkUse this method to revoke an invite link created by the bot. If the primary link is revoked, a new link is automatically generated. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights.- Parameters:
- chat_id- Unique identifier of the target chat or username of the target channel (in the format @channelusername)
- invite_link- The invite link to revoke
- Returns:
- RevokeChatInviteLink
 
- 
approveChatJoinRequestUse this method to approve a chat join request. The bot must be an administrator in the chat for this to work and must have the can_invite_users administrator right.- Parameters:
- chat_id- Unique identifier for the target chat or username of the target channel (in the format @channelusername)
- user_id- Unique identifier of the target user
- Returns:
- ApproveChatJoinRequest
 
- 
declineChatJoinRequestUse this method to decline a chat join request. The bot must be an administrator in the chat for this to work and must have the can_invite_users administrator right.- Parameters:
- chat_id- Unique identifier for the target chat or username of the target channel (in the format @channelusername)
- user_id- Unique identifier of the target user
- Returns:
- DeclineChatJoinRequest
 
- 
setChatPhotoUse this method to set a new profile photo for the chat. Photos can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights.- Parameters:
- chat_id- Unique identifier for the target chat or username of the target channel (in the format @channelusername)
- photo- New chat photo, uploaded using- File
- Returns:
- SetChatPhoto
 
- 
deleteChatPhotoUse this method to delete a chat photo. Photos can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights.- Parameters:
- chat_id- Unique identifier for the target chat or username of the target channel (in the format @channelusername)
- Returns:
- DeleteChatPhoto
 
- 
setChatTitleUse this method to change the title of a chat. Titles can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights.- Parameters:
- chat_id- Unique identifier for the target chat or username of the target channel (in the format @channelusername)
- title- New chat title, 1-128 characters
- Returns:
- SetChatTitle
 
- 
setChatDescriptionUse this method to change the description of a group, a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights.- Parameters:
- chat_id- Unique identifier for the target chat or username of the target channel (in the format @channelusername)
- description- New chat description, 0-255 characters
- Returns:
- SetChatDescription
 
- 
pinChatMessageUse this method to add a message to the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' administrator right in a supergroup or 'can_edit_messages' administrator right in a channel- Parameters:
- chat_id- Unique identifier for the target chat or username of the target channel (in the format @channelusername)
- message_id- Identifier of a message to pin
- Returns:
- PinChatMessage
 
- 
unpinChatMessageUse this method to remove a message from the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' administrator right in a supergroup or 'can_edit_messages' administrator right in a channel.- Parameters:
- chat_id- Unique identifier for the target chat or username of the target channel (in the format @channelusername)
- Returns:
- UnpinChatMessage
 
- 
unpinAllChatMessagesUse this method to clear the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' administrator right in a supergroup or 'can_edit_messages' administrator right in a channel- Parameters:
- chat_id- Unique identifier for the target chat or username of the target channel (in the format @channelusername)
- Returns:
- UnpinAllChatMessages
 
- 
getMyStarBalanceA method to get the current Telegram Stars balance of the bot. Requires no parameters.- Returns:
- GetMyStarBalance
 
- 
getStarTransactionsReturns the bot's Telegram Star transactions in chronological order.- Returns:
- GetStarTransactions
 
- 
leaveChat
- 
getChat
- 
getUserChatBoostsUse this method to get the list of boosts added to a chat by a user. Requires administrator rights in the chat.- Parameters:
- chat_id- Unique identifier for the chat or username of the channel (in the format @channelusername)
- user_id- Unique identifier of the target user
- Returns:
- GetUserChatBoosts
 
- 
getChatAdministratorsUse this method to get a list of administrators in a chat, which aren't bots.- Parameters:
- chat_id- Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)
- Returns:
- GetChatAdministrators
 
- 
getChatMemberCountUse this method to get the number of members in a chat.- Parameters:
- chat_id- Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)
- Returns:
- GetChatMemberCount
 
- 
getChatMemberUse this method to get information about a member of a chat. The method is only guaranteed to work for other users if the bot is an administrator in the chat- Parameters:
- chat_id- Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)
- user_id- Unique identifier of the target user
- Returns:
- GetChatMember
 
- 
setMessageReactionUse this method to change the chosen reactions on a message. Service messages of some types can't be reacted to. Automatically forwarded messages from a channel to its discussion group have the same available reactions as messages in the channel. Bots can't use paid reactions.- Parameters:
- chat_id- Unique identifier for the target chat or username of the target channel (in the format @channelusername)
- message_id- Identifier of the target message. If the message belongs to a media group, the reaction is set to the first non-deleted message in the group instead.
- Returns:
- SetMessageReaction
 
- 
setChatStickerSetUse this method to set a new group sticker set for a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Use the field can_set_sticker_set optionally returned ingetChat(java.lang.Object)requests to check if the bot can use this method.- Parameters:
- chat_id- Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
- sticker_set_name- Name of the sticker set to be set as the group sticker set
- Returns:
- SetChatStickerSet
 
- 
deleteChatStickerSetUse this method to delete a group sticker set from a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Use the field can_set_sticker_set optionally returned ingetChat(java.lang.Object)requests to check if the bot can use this method.- Parameters:
- chat_id- Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
- Returns:
- DeleteChatStickerSet
 
- 
getForumTopicIconStickersUse this method to get custom emoji stickers, which can be used as a forum topic icon by any user. Requires no parameters.- Returns:
- GetForumTopicIconStickers
 
- 
createForumTopicUse this method to create a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights- Parameters:
- chat_id- Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
- name- Topic name, 1-128 characters
- Returns:
- CreateForumTopic
 
- 
editForumTopicUse this method to edit name and icon of a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic.- Parameters:
- chat_id- Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
- message_thread_id- Unique identifier for the target message thread of the forum topic
- Returns:
- EditForumTopic
 
- 
closeForumTopicUse this method to close an open topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic.- Parameters:
- chat_id- Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
- message_thread_id- Unique identifier for the target message thread of the forum topic
- Returns:
- CloseForumTopic
 
- 
reopenForumTopicUse this method to reopen a closed topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic.- Parameters:
- chat_id- Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
- message_thread_id- Unique identifier for the target message thread of the forum topic
- Returns:
- ReopenForumTopic
 
- 
deleteForumTopicUse this method to delete a forum topic along with all its messages in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_delete_messages administrator rights.- Parameters:
- chat_id- Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
- message_thread_id- Unique identifier for the target message thread of the forum topic
- Returns:
- DeleteForumTopic
 
- 
unpinAllForumTopicMessagesUse this method to clear the list of pinned messages in a forum topic. The bot must be an administrator in the chat for this to work and must have the can_pin_messages administrator right in the supergroup.- Parameters:
- chat_id- Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
- message_thread_id- Unique identifier for the target message thread of the forum topic
- Returns:
- UnpinAllForumTopicMessages
 
- 
editGeneralForumTopicUse this method to edit the name of the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights.- Parameters:
- chat_id- Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
- name- New topic name, 1-128 characters
- Returns:
- EditGeneralForumTopic
 
- 
closeGeneralForumTopicUse this method to close an open 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights.- Parameters:
- chat_id- Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
- Returns:
- CloseForumTopic
 
- 
reopenGeneralForumTopicUse this method to reopen a closed 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. The topic will be automatically unhidden if it was hidden.- Parameters:
- chat_id- Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
- Returns:
- ReopenGeneralForumTopic
 
- 
hideGeneralForumTopicUse this method to hide the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. The topic will be automatically closed if it was open.- Parameters:
- chat_id- Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
- Returns:
- HideGeneralForumTopic
 
- 
unHideGeneralForumTopicUse this method to unhide the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights.- Parameters:
- chat_id- Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
- Returns:
- UnHideGeneralForumTopic
 
- 
unpinAllGeneralForumTopicMessagesUse this method to clear the list of pinned messages in a General forum topic. The bot must be an administrator in the chat for this to work and must have the can_pin_messages administrator right in the supergroup.- Parameters:
- chat_id- Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
- Returns:
- UnpinAllGeneralForumTopicMessages
 
- 
answerCallbackQueryUse 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.- Parameters:
- callback_query_id- Unique identifier for the query to be answered
- Returns:
- AnswerCallbackQuery
 
- 
answerCallbackQueryanswerCallbackQuery(java.lang.String)with text parameter- Parameters:
- callback_query_id- Unique identifier for the query to be answered
- text- text Text of the notification.
- Returns:
- AnswerCallbackQuery
 
- 
setMyCommandsUse this method to change the list of the bot's commands.- Parameters:
- commands- A JSON-serialized list of bot commands to be set as the list of the bot's commands. At most 100 commands can be specified.
- Returns:
- SetMyCommands
- See Also:
 
- 
deleteMyCommandsUse this method to delete the list of the bot's commands for the given scope and user language. After deletion, higher level commands will be shown to affected users.- Returns:
- DeleteMyCommands
 
- 
getMyCommandsUse this method to get the current list of the bot's commands for the given scope and user language.- Returns:
- GetMyCommands
 
- 
setChatMenuButtonUse this method to change the bot's menu button in a private chat, or the default menu button.- Returns:
- SetChatMenuButton
 
- 
getChatMenuButtonUse this method to get the current value of the bot's menu button in a private chat, or the default menu button.- Returns:
- GetChatMenuButton
 
- 
setMyDefaultAdministratorRightsUse this method to change the default administrator rights requested by the bot when it's added as an administrator to groups or channels. These rights will be suggested to users, but they are free to modify the list before adding the bot.- Returns:
- SetMyDefaultAdministratorRights
 
- 
getMyDefaultAdministratorRightsUse this method to get the current default administrator rights of the bot. Returns ChatAdministratorRights on success.- Returns:
- GetMyDefaultAdministratorRights
 
- 
editMessageTextUse this method to edit text and game messages. On success, the edited Message is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent.- Parameters:
- text- New text of the message, 1-4096 characters after entities parsing
- chat_id- Unique identifier for the target chat or username of the target channel (in the format @channelusername)
- message_id- Identifier of the message to edit
- Returns:
- EditMessageText
 
- 
editMessageTextUse this method to edit text and game messages. On success, True is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent.- Parameters:
- text- ew text of the message, 1-4096 characters after entities parsing
- inline_message_id- Identifier of the inline message
- Returns:
- EditMessageText
 
- 
editMessageCaptionUse this method to edit captions of messages. On success, the edited Message is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent.- Parameters:
- chat_id- Unique identifier for the target chat or username of the target channel (in the format @channelusername)
- message_id- Identifier of the message to edit
- Returns:
- EditMessageCaption
 
- 
editMessageCaptionUse this method to edit captions of messages. On success, True is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent.- Parameters:
- inline_message_id- Identifier of the inline message
- Returns:
- EditMessageCaption
 
- 
editMessageMediaUse this method to edit animation, audio, document, photo, or video messages, or to add media to text messages. If a message is part of a message album, then it can be edited only to an audio for audio albums, only to a document for document albums and to a photo or a video otherwise. When an inline message is edited, a new file can't be uploaded; use a previously uploaded file via its file_id or specify a URL. On success, the edited Message is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent.- Parameters:
- chat_id- Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername)
- media- A JSON-serialized object for a new media content of the message
- message_id- Required if inline_message_id is not specified. Identifier of the message to edit
- Returns:
- EditMessageMedia
 
- 
editMessageMediaUse this method to edit animation, audio, document, photo, or video messages, or to add media to text messages. If a message is part of a message album, then it can be edited only to an audio for audio albums, only to a document for document albums and to a photo or a video otherwise. When an inline message is edited, a new file can't be uploaded; use a previously uploaded file via its file_id or specify a URL. On success, True is returned.- Parameters:
- inline_message_id- Required if chat_id and message_id are not specified. Identifier of the inline message
- media- A JSON-serialized object for a new media content of the message
- Returns:
- EditMessageMedia
 
- 
editMessageReplyMarkupUse this method to edit only the reply markup of messages. On success, the edited Message is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent.- Parameters:
- chat_id- Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername)
- message_id- Required if inline_message_id is not specified. Identifier of the message to edit
- Returns:
- EditMessageReplyMarkup
 
- 
editMessageReplyMarkupUse this method to edit only the reply markup of messages. On success, True is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent.- Parameters:
- inline_message_id- Required if chat_id and message_id are not specified. Identifier of the inline message
- Returns:
- EditMessageReplyMarkup
 
- 
stopPollUse this method to stop a poll which was sent by the bot.- Parameters:
- chat_id- Unique identifier for the target chat or username of the target channel (in the format @channelusername)
- message_id- Identifier of the original message with the poll
- Returns:
- StopPoll
 
- 
deleteMessageUse this method to delete a message, including service messages, with the following limitations:- A message can only be deleted if it was sent less than 48 hours ago. - Service messages about a supergroup, channel, or forum topic creation can't be deleted. - A dice message in a private chat can only be deleted if it was sent more than 24 hours ago. - Bots can delete outgoing messages in private chats, groups, and supergroups. - Bots can delete incoming messages in private chats. - Bots granted can_post_messages permissions can delete outgoing messages in channels. - If the bot is an administrator of a group, it can delete any message there. - If the bot has can_delete_messages permission in a supergroup or a channel, it can delete any message there. - Parameters:
- chat_id- Unique identifier for the target chat or username of the target channel (in the format @channelusername)
- message_id- Identifier of the message to delete
- Returns:
- DeleteMessage
 
- 
deleteMessagesUse this method to delete multiple messages simultaneously. If some of the specified messages can't be found, they are skipped.- Parameters:
- chat_id- Unique identifier for the target chat or username of the target channel (in the format @channelusername)
- message_ids- A JSON-serialized list of 1-100 identifiers of messages to delete.
- Returns:
 
- 
sendSticker- Parameters:
- chat_id- Unique identifier for the target chat or username of the target channel (in the format @channelusername)
- sticker- Sticker to send. Pass .WEBM file
- Returns:
- SendSticker
 
- 
sendSticker- Parameters:
- chat_id- Unique identifier for the target chat or username of the target channel (in the format @channelusername)
- sticker- Sticker to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a .WEBP sticker from the Internet, or upload a new .WEBP, .TGS, Video and animated stickers can't be sent via an HTTP URL.
- Returns:
- SendSticker
 
- 
getStickerSetUse this method to get a sticker set.- Parameters:
- name- Name of the sticker set
- Returns:
- GetStickerSet
 
- 
getCustomEmojiStickersUse this method to get information about custom emoji stickers by their identifiers.- Parameters:
- custom_emoji_ids- A JSON-serialized list of custom emoji identifiers. At most 200 custom emoji identifiers can be specified.
- Returns:
- GetCustomEmojiStickers
 
- 
uploadStickerFilepublic UploadStickerFile uploadStickerFile(long user_id, File sticker, StickerFormat sticker_format) Use this method to upload a file with a sticker for later use in thecreateNewStickerSet(long, java.lang.String, java.lang.String, io.github.natanimn.telebof.types.input.InputSticker[]),addStickerToSet(long, java.lang.String, io.github.natanimn.telebof.types.input.InputSticker), orreplaceStickerInSet(long, java.lang.String, java.lang.String, io.github.natanimn.telebof.types.input.InputSticker)methods (the file can be used multiple times).- Parameters:
- user_id- User identifier of sticker file owner
- sticker- A file with the sticker in .WEBP, .PNG, .TGS, or .WEBM format.
- sticker_format- Format of the sticker
- Returns:
- UploadStickerFile
 
- 
createNewStickerSetpublic CreateNewStickerSet createNewStickerSet(long user_id, String name, String title, InputSticker[] stickers) Use this method to create a new sticker set owned by a user. The bot will be able to edit the sticker set thus created.- Parameters:
- user_id- User identifier of created sticker set owner
- 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_- ". - is case-insensitive. 1-64 characters. 
- title- Sticker set title, 1-64 characters
- stickers- A JSON-serialized list of 1-50 initial stickers to be added to the sticker set
- Returns:
- CreateNewStickerSet
 
- 
addStickerToSetUse this method to add a new sticker to a set created by the bot. Emoji sticker sets can have up to 200 stickers. Other sticker sets can have up to 120 stickers.- Parameters:
- user_id- User identifier of sticker set owner
- name- Sticker set name
- sticker- A JSON-serialized object with information about the added sticker. If exactly the same sticker had already been added to the set, then the set isn't changed.
- Returns:
- AddStickerToSet
 
- 
setStickerPositionInSetUse this method to move a sticker in a set created by the bot to a specific position.- Parameters:
- sticker- File identifier of the sticker
- position- New sticker position in the set, zero-based
- Returns:
- SetStickerPositionInSet
 
- 
deleteStickerFromSetUse this method to delete a sticker from a set created by the bot.- Parameters:
- sticker- File identifier of the sticker
- Returns:
- DeleteStickerFromSet
 
- 
setStickerEmojiListUse this method to change the list of emoji assigned to a regular or custom emoji sticker. The sticker must belong to a sticker set created by the bot.- Parameters:
- sticker- File identifier of the sticker
- emoji_list- A JSON-serialized list of 1-20 emoji associated with the sticker
- Returns:
- SetStickerEmojiList
 
- 
setStickerKeywordsUse this method to change search keywords assigned to a regular or custom emoji sticker. The sticker must belong to a sticker set created by the bot- Parameters:
- sticker- File identifier of the sticker
- keywords- A JSON-serialized list of 0-20 search keywords for the sticker with total length of up to 64 characters
- Returns:
- SetStickerKeywords
 
- 
setStickerMaskPositionUse this method to change the mask position of a mask sticker. The sticker must belong to a sticker set that was created by the bot.- Parameters:
- sticker- File identifier of the sticker
- Returns:
- SetStickerMaskPosition
 
- 
setStickerSetTitleUse this method to set the title of a created sticker set.- Parameters:
- name- Sticker set name
- title- Sticker set title, 1-64 characters
- Returns:
- SetStickerSetTitle
 
- 
replaceStickerInSetpublic ReplaceStickerInSet replaceStickerInSet(long user_id, String name, String old_sticker, InputSticker sticker) Use this method to replace an existing sticker in a sticker set with a new one. The method is equivalent to callingdeleteStickerFromSet(java.lang.String), thenaddStickerToSet(long, java.lang.String, io.github.natanimn.telebof.types.input.InputSticker), thensetStickerPositionInSet(java.lang.String, int).- Parameters:
- user_id- User identifier of the sticker set owner
- name- Sticker set name
- old_sticker- File identifier of the replaced sticker
- sticker- A JSON-serialized object with information about the added sticker. If exactly the same sticker had already been added to the set, then the set remains unchanged.
- Returns:
- ReplaceStickerInSet
 
- 
setStickerSetThumbnailpublic SetStickerSetThumbnail setStickerSetThumbnail(String name, long user_id, File thumbnail, StickerFormat format) Use this method to set the thumbnail of a regular or mask sticker set. The format of the thumbnail file must match the format of the stickers in the set.- Parameters:
- name- Sticker set name
- user_id- User identifier of the sticker set owner
- thumbnail- A .WEBP or .PNG image with the thumbnail, must be up to 128 kilobytes in size and have a width and height of exactly 100px, or a .TGS animation with a thumbnail up to 32 kilobytes in size. animation-requirements for animated sticker technical requirements), or a .WEBM video with the thumbnail up to 32 kilobytes in size; see for video sticker technical requirements. Pass a file_id as a String to send a file that already exists on the Telegram servers, or pass an HTTP URL as a String for Telegram to get a file from the Internet
- format- Format of the thumbnail, must be one of- StickerFormat.STATICfor a .WEBP or .PNG image,- StickerFormat.ANIMATEDfor a .TGS animation, or- StickerFormat.VIDEOfor a .WEBM video
- Returns:
- SetStickerSetThumbnail
 
- 
setStickerSetThumbnailpublic SetStickerSetThumbnail setStickerSetThumbnail(String name, long user_id, String thumbnail, StickerFormat format) Use this method to set the thumbnail of a regular or mask sticker set. The format of the thumbnail file must match the format of the stickers in the set.- Parameters:
- name- Sticker set name
- user_id- User identifier of the sticker set owner
- thumbnail- A .WEBP or .PNG image with the thumbnail, must be up to 128 kilobytes in size and have a width and height of exactly 100px, or a .TGS animation with a thumbnail up to 32 kilobytes in size. animation-requirements for animated sticker technical requirements), or a .WEBM video with the thumbnail up to 32 kilobytes in size; see for video sticker technical requirements. Upload using- File
- format- Format of the thumbnail, must be one of- StickerFormat.STATICfor a .WEBP or .PNG image,- StickerFormat.ANIMATEDfor a .TGS animation, or- StickerFormat.VIDEOfor a .WEBM video
- Returns:
- SetStickerSetThumbnail
 
- 
setCustomEmojiStickerSetThumbnailUse this method to set the thumbnail of a custom emoji sticker set.- Parameters:
- name- Sticker set name
- Returns:
- SetCustomEmojiStickerSetThumbnail
 
- 
deleteStickerSetUse this method to delete a sticker set that was created by the bot.- Parameters:
- name- Sticker set name
- Returns:
- DeleteStickerSet
 
- 
getBusinessConnectionUse this method to get information about the connection of the bot with a business account.- Parameters:
- business_connection_id- Unique identifier of the business connection
- Returns:
- GetBusinessConnection
 
- 
answerInlineQueryUse this method to send answers to an inline query. No more than 50 results per query are allowed.- Parameters:
- inline_query_id- Unique identifier for the answered query
- results- A JSON-serialized array of results for the inline query
- Returns:
- AnswerInlineQuery
 
- 
savePreparedInlineMessageStores a message that can be sent by a user of a Mini App. Returns aPreparedInlineMessageobject.- Parameters:
- user_id- Unique identifier of the target user that can use the prepared message
- result-- InlineQueryResultobject describing the message to be sent
- Returns:
- SavePreparedInlineMessage
 
- 
answerWebAppQueryUse this method to set the result of an interaction with a Web App and send a corresponding message on behalf of the user to the chat from which the query originated.- Parameters:
- web_app_query_id- Unique identifier for the query to be answered
- result- A JSON-serialized object describing the message to be sent
- Returns:
- AnswerWebAppQuery
 
- 
sendInvoicepublic SendInvoice sendInvoice(Object chat_id, String title, String description, String payload, String currency, LabeledPrice[] prices) Use this method to send invoices.- Parameters:
- chat_id- Unique identifier for the target chat or username of the target channel (in the format @channelusername)
- title- Product name, 1-32 characters
- description- Product description, 1-255 characters
- payload- Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use it for your internal processes.
- currency- Three-letter ISO 4217 currency code, see more on currencies. Pass “XTR” for payments in Telegram Stars.
- prices- Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in Telegram Stars.
- Returns:
- SendInvoice
 
- 
createInvoiceLinkpublic CreateInvoiceLink createInvoiceLink(String title, String description, String payload, String currency, LabeledPrice[] prices) Use this method to create a link for an invoice.- Parameters:
- title- Product name, 1-32 characters
- description- Product description, 1-255 characters
- payload- Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use it for your internal processes.
- currency- Three-letter ISO 4217 currency code. Pass “XTR” for payments in Telegram Stars.
- prices- Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in Telegram Stars.
- Returns:
- CreateInvoiceLink
 
- 
answerShippingQueryIf 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.- Parameters:
- shipping_query_id- Unique identifier for the query to be answered
- ok- Pass 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)
- Returns:
- AnswerShippingQuery
 
- 
answerPreCheckoutQueryOnce 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.- Parameters:
- pre_checkout_query_id- Unique identifier for the query to be answered
- 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.
- Returns:
- AnswerPreCheckoutQuery
 
- 
setPassportDataErrorsInforms a user that some of the Telegram Passport elements they provided contains errors. The user will not be able to re-submit their Passport to you until the errors are fixed (the contents of the field for which you returned the error must change).
 
 Use this if the data submitted by the user doesn't satisfy the standards your service requires for any reason. For example, if a birthday date seems invalid, a submitted document is blurry, a scan shows evidence of tampering, etc. Supply some details in the error message to make sure the user knows how to correct the issues.- Parameters:
- user_id- User identifier
- errors- A JSON-serialized array describing the errors
- Returns:
- SetPassportDataErrors
 
- 
sendGame
- 
setGameScoreUse this method to set the score of the specified user in a game message. On success, the Message is returned. Returns an error, if the new score is not greater than the user's current score in the chat and force is False.- Parameters:
- chat_id- Required if inline_message_id is not specified. Unique identifier for the target chat
- user_id- User identifier
- score- New score, must be non-negative
- message_id- Required if inline_message_id is not specified. Identifier of the sent message
- Returns:
- SetGameScore
 
- 
setGameScoreUse this method to set the score of the specified user in a game message. On success, True is returned. Returns an error, if the new score is not greater than the user's current score in the chat and force is False.- Parameters:
- inline_message_id- Required if chat_id and message_id are not specified. Identifier of the inline message
- user_id- User identifier
- score- New score, must be non-negative
- Returns:
- SetGameScore
 
- 
getAvailableGiftsReturns the list of gifts that can be sent by the bot to users and channel chats. Requires no parameters. Returns aGiftsobject.- Returns:
- GetAvailableGifts
 
- 
getMyName
- 
setMyName
- 
getMyDescriptionUse this method to get the current bot description for the given user language.- Returns:
- GetMyDescription
 
- 
setMyDescriptionUse this method to change the bot's description, which is shown in the chat with the bot if the chat is empty.- Returns:
- SetMyDescription
 
- 
getGameHighScoresUse this method to get data for high score tables. Will return the score of the specified user and several of their neighbors in a game.
 
 This method will currently return scores for the target user, plus two of their closest neighbors on each side. Will also return the top three users if the user and their neighbors are not among them. Please note that this behavior is subject to change.- Parameters:
- chat_id- Required if inline_message_id is not specified. Unique identifier for the target chat
- user_id- Target user id
- message_id- Required if inline_message_id is not specified. Identifier of the sent message
- Returns:
- GetGameHighScores
 
- 
getGameHighScoresUse this method to get data for high score tables. Will return the score of the specified user and several of their neighbors in a game.
 
 This method will currently return scores for the target user, plus two of their closest neighbors on each side. Will also return the top three users if the user and their neighbors are not among them. Please note that this behavior is subject to change.- Parameters:
- inline_message_id- Required if chat_id and message_id are not specified. Identifier of the inline message
- user_id- Target user id
- Returns:
- GetGameHighScores
 
- 
setStateUse this method to set new state in group/supergroup chat for a user- Parameters:
- chat_id- Unique identifier for the target chat
- user_id- Target user id
- name- state name
 
- 
setStateUse this method to set new state in private chat for a user- Parameters:
- user_id- Target user id
- name- state name
 
- 
clearStatepublic void clearState(long chat_id, long user_id) Use this method to clear an existing state when it is no longer needed in a group/supergroup chat for a user.- Parameters:
- chat_id- Unique identifier for the target chat
- user_id- Target user id
 
- 
clearStatepublic void clearState(long user_id) Use this method to clear an existing state when it is no longer needed in a private chat for a user.- Parameters:
- user_id- Target user id
 
- 
getStateData
- 
getStateData
- 
getUpdatesUse this method to receive incoming updates using long polling- Returns:
- GetUpdates
 
 
-