TGAPIMethods mixin

Telegram Methods

Mixin applications

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
token String
Setup token to be used for API calls
no getter

Methods

addStickerToSet(String userId, String name, InputSticker sticker) Future<bool>
Use this method to add a new sticker to a set created by the bot.
answerCallbackQuery(String callbackQueryId, {String? text, bool? showAlert, String? url, int? cacheTime}) Future<bool>
Use this method to send answers to callback queries sent from inline keyboards.
answerInlineQuery(String inlineQueryId, List<InlineQueryResult> results, {int? cacheTime, bool? isPersonal, String? nextOffset, InlineQueryResultsButton? button}) Future<bool>
Use this method to send answers to an inline query.
answerPreCheckoutQuery(String preCheckoutQueryId, bool ok, String errorMessage) Future<bool>
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 shippingQueryId, bool ok, List<ShippingOption>? shippingOptions, String errorMessage) Future<bool>
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 webAppQueryId, InlineQueryResult? result) Future<SentWebAppMessage>
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(ChatID chatId, int userId) Future<bool>
Use this method to approve a chat join request.
banChatMember(ChatID chatId, int userId, {int? untilDate, bool? revokeMessages}) Future<bool>
Use this method to ban a user in a group, a supergroup or a channel.
banChatSenderChat(ChatID chatId, int senderChatId) Future<bool>
Use this method to ban a channel chat in a supergroup or a channel.
close() Future<bool>
Use 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.
closeClient() → void
Close the http client
closeForumTopic(ChatID chatId, int messageThreadId) Future<bool>
Use 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. Returns True on success.
closeGeneralForumTopic(ChatID chatId) Future<bool>
Use this method to close an open 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. Returns True on success.
copyMessage(ChatID chatId, ChatID fromChatId, int messageId, {int? messageThreadId, String? caption, ParseMode? parseMode, List<MessageEntity>? captionEntities, bool? disableNotification, bool? protectContent, int? replyToMessageId, bool? allowSendingWithoutReply, ReplyMarkup? replyMarkup}) Future<MessageId>
Use this method to copy messages of any kind.
Use this method to create an additional invite link for a chat.
createForumTopic(ChatID chatId, String name, {int? iconColor, String? iconCustomEmojiId}) Future<ForumTopic>
Use this method to create a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. Returns information about the created topic as a ForumTopic object.
Use this method to create a link for an invoice.
createNewStickerSet(String userId, String name, String title, String emojis, List<InputSticker> stickers, String stickerFormat, {String? stickerType, bool? needsRepainting}) Future<bool>
Use this method to create a new sticker set owned by a user.
declineChatJoinRequest(ChatID chatId, int userId) Future<bool>
Use this method to decline a chat join request.
deleteChatPhoto(ChatID chatId) Future<bool>
Use this method to delete a chat photo.
deleteChatStickerSet(ChatID chatId) Future<bool>
Use this method to delete a group sticker set from a supergroup.
deleteForumTopic(ChatID chatId, int messageThreadId) Future<bool>
Use 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. Returns True on success.
deleteMessage(ChatID chatId, int messageId) Future<bool>
Use this method to delete a message, including service messages, with the following limitations:
deleteMyCommands({BotCommandScope? scope, String? languageCode}) Future<bool>
Use this method to delete the list of the bot's commands for the given scope and user language.
deleteStickerFromSet(String sticker) Future<bool>
Use this method to delete a sticker from a set created by the bot.
deleteStickerSet(String name) Future<bool>
Use this method to delete a sticker set that was created by the bot.
deleteWebhook({bool? dropPendingUpdates}) Future<bool>
Use this method to remove webhook integration if you decide to switch back to getUpdates. Returns True on success.
download(String path) Future<Uint8List>
Download a file from path
Use this method to edit a non-primary invite link created by the bot.
editForumTopic(ChatID chatId, int messageThreadId, {String? name, String? iconCustomEmojiId}) Future<bool>
Use 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 can_manage_topics administrator rights, unless it is the creator of the topic. Returns True on success.
editGeneralForumTopic(ChatID chatId, String name) Future<bool>
Use this method to edit the name of the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have can_manage_topics administrator rights. Returns True on success.
editMessageCaption(ChatID? chatId, int? messageId, {String? caption, ParseMode? parseMode, List<MessageEntity>? captionEntities, ReplyMarkup? replyMarkup}) Future<Message>
Use this method to edit captions of messages.
editMessageCaptionInline(String? inlineMessageId, {String? caption, ParseMode? parseMode, List<MessageEntity>? captionEntities, ReplyMarkup? replyMarkup}) Future<bool>
Use this method to edit captions of messages.
editMessageLiveLocation(double latitude, double longitude, {ChatID? chatId, int? messageId, double? horizontalAccuracy, int? heading, int? proximityAlertRadius, ReplyMarkup? replyMarkup}) Future<Message>
Use this method to edit live location messages.
editMessageLiveLocationInline(double latitude, double longitude, {String? inlineMessageId, double? horizontalAccuracy, int? heading, int? proximityAlertRadius, ReplyMarkup? replyMarkup}) Future<bool>
Use this method to edit live location messages.
editMessageMedia(ChatID? chatId, int? messageId, InputMedia media, {ReplyMarkup? replyMarkup}) Future<Message>
Use this method to edit animation, audio, document, photo, or video messages.
editMessageMediaInline(String? inlineMessageId, InputMedia media, {ReplyMarkup? replyMarkup}) Future<bool>
Use this method to edit animation, audio, document, photo, or video messages.
editMessageReplyMarkup(ChatID? chatId, int? messageId, {ReplyMarkup? replyMarkup}) Future<Message>
Use this method to edit only the reply markup of messages.
editMessageReplyMarkupInline(String? inlineMessageId, {ReplyMarkup? replyMarkup}) Future<bool>
Use this method to edit only the reply markup of messages.
editMessageText(String text, ChatID? chatId, int? messageId, {ParseMode? parseMode, List<MessageEntity>? entities, bool? disableWebPagePreview, ReplyMarkup? replyMarkup}) Future<Message>
Use this method to edit text and game messages.
editMessageTextInline(String text, String? inlineMessageId, {ParseMode? parseMode, List<MessageEntity>? entities, bool? disableWebPagePreview, ReplyMarkup? replyMarkup}) Future<bool>
Use this method to edit text and game messages.
Use this method to generate a new primary invite link for a chat; any previously generated primary link is revoked.
forwardMessage(ChatID chatId, ChatID fromChatId, int messageId, {int? messageThreadId, bool? disableNotification, bool? protectContent}) Future<Message>
Use this method to forward messages of any kind. Service messages can't be forwarded.
getChat(ChatID chatId) Future<Chat>
Use this method to get up to date information about the chat (current name of the user for one-on-one conversations, current username of a user, group or channel, etc.).
getChatAdministrators(ChatID chatId) Future<List<ChatMember>>
Use this method to get a list of administrators in a chat.
getChatMember(ChatID chatId, int userId) Future<ChatMember>
Use this method to get information about a member of a chat.
getChatMemberCount(ChatID chatId) Future<int>
Use this method to get the number of members in a chat.
getChatMenuButton({ChatID? chatId}) Future<MenuButton>
Use this method to get the current value of the bot's menu button in a private chat, or the default menu button.
getCustomEmojiStickers(List<String> customEmojiIds) Future<List<Sticker>>
Use this method to get information about custom emoji stickers by their identifiers. Returns an Array of Sticker objects
getFile(String fileId) Future<File>
Use this method to get basic info about a file and prepare it for downloading.
getForumTopicIconStickers() Future<List<Sticker>>
Use this method to get custom emoji stickers, which can be used as a forum topic icon by any user. Requires no parameters. Returns an Array of Sticker objects.
getGameHighScores(int userId, {ChatID? chatId, int? messageId}) Future<List<GameHighScore>>
Use 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.
getGameHighScoresInline(int userId, {String? inlineMessageId}) Future<List<GameHighScore>>
Use 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. Returns an Array of GameHighScore objects.
getMe() Future<User>
A simple method for testing your bot's auth token.
getMyCommands({BotCommandScope? scope, String? languageCode}) Future<List<BotCommand>>
Use this method to get the current list of the bot's commands for the given scope and user language.
getMyDefaultAdministratorRights({bool? forChannels}) Future<ChatAdministratorRights>
Use this method to get the current default administrator rights of the bot.
getMyDescription({String? languageCode}) Future<BotDescription>
Use this method to get the current bot description for the given user language.
getMyName({String? languageCode}) Future<BotName>
Use this method to get the current bot name for the given user language.
getMyShortDescription({String? languageCode}) Future<BotDescription>
Use this method to get the current bot short description for the given user language.
getStickerSet(String name) Future<StickerSet>
Use this method to get a sticker set.
getUpdates({int? timeout, int? offset, int? limit, List<UpdateType>? allowedUpdates}) Future<List<Update>>
Use this method to receive incoming updates using long polling.
getUserProfilePhotos(ChatID chatId, {int? offset, int? limit}) Future<UserProfilePhotos>
Use this method to get a list of profile pictures for a user.
hideGeneralForumTopic(ChatID chatId) Future<bool>
Use this method to hide the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. The topic will be automatically closed if it was open. Returns True on success.
leaveChat(ChatID chatId) Future<bool>
Use this method for your bot to leave a group, supergroup or channel.
logOut() Future<bool>
Use 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.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pinChatMessage(ChatID chatId, int messageId, {bool? disableNotification}) Future<bool>
Use this method to add a message to the list of pinned messages in a chat.
promoteChatMember(ChatID chatId, int userId, {bool? isAnonymous, bool? canManageChat, bool? canDeleteMessages, bool? canManageVideoChats, bool? canRestrictMembers, bool? canPromoteMembers, bool? canChangeInfo, bool? canInviteUsers, bool? canPostMessages, bool? canEditMessages, bool? canPinMessages, bool? canPostStories, bool? canEditStories, bool? canDeleteStories, bool? canManageTopics}) Future<bool>
Use this method to promote or demote a user in a supergroup or a channel.
reopenForumTopic(ChatID chatId, int messageThreadId) Future<bool>
Use 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. Returns True on success.
reopenGeneralForumTopic(ChatID chatId) Future<bool>
Use this method to reopen a closed 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. The topic will be automatically unhidden if it was hidden. Returns True on success.
restrictChatMember(ChatID chatId, int userId, ChatPermissions permissions, {bool? useIndependentChatPermissions, int? untilDate}) Future<bool>
Use this method to restrict a user in a supergroup. The bot must be an administrator in the supergroup for this to work and must have the appropriate admin rights.
Use this method to revoke an invite link created by the bot.
sendAnimation(ChatID chatId, HttpFile animation, {int? messageThreadId, int? duration, int? width, int? height, HttpFile? thumbnail, String? caption, ParseMode? parseMode, List<MessageEntity>? captionEntities, bool? hasSpoiler, bool? disableNotification, bool? protectContent, int? replyToMessageId, bool? allowSendingWithoutReply, ReplyMarkup? replyMarkup}) Future<Message>
Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound).
sendAudio(ChatID chatId, HttpFile audio, {int? messageThreadId, String? caption, ParseMode? parseMode, List<MessageEntity>? captionEntities, int? duration, String? performer, String? title, HttpFile? thumbnail, bool? disableNotification, bool? protectContent, int? replyToMessageId, bool? allowSendingWithoutReply, ReplyMarkup? replyMarkup}) Future<Message>
Use this method to send audio files, if you want Telegram clients to display them in the music player.
sendChatAction(ChatID chatId, ChatAction action, {int? messageThreadId}) Future<bool>
Use this method when you need to tell the user that something is happening on the bot's side.
sendContact(ChatID chatId, String phoneNumber, String? firstName, {int? messageThreadId, String? lastName, String? vcard, bool? disableNotification, bool? protectContent, int? replyToMessageId, bool? allowSendingWithoutReply, ReplyMarkup? replyMarkup}) Future<Message>
Use this method to send phone contacts.
sendDice(ChatID chatId, {int? messageThreadId, Emoji? emoji, bool? disableNotification, bool? protectContent, int? replyToMessageId, bool? allowSendingWithoutReply, ReplyMarkup? replyMarkup}) Future<Message>
Use this method to send an animated emoji that will display a random value.
sendDocument(ChatID chatId, HttpFile document, {int? messageThreadId, HttpFile? thumbnail, String? caption, ParseMode? parseMode, List<MessageEntity>? captionEntities, bool? disableNotification, bool? protectContent, int? replyToMessageId, bool? allowSendingWithoutReply, ReplyMarkup? replyMarkup, bool? disableContentTypeDetection}) Future<Message>
Use this method to send general files.
sendGame(ChatID chatId, String gameShortName, {int? messageThreadId, bool? disableNotification, bool? protectContent, int? replyToMessageId, bool? allowSendingWithoutReply, InlineKeyboardMarkup? replyMarkup}) Future<Message>
Use this method to send a game.
sendInvoice(ChatID chatId, String title, String description, String payload, String providerToken, String startParameter, String currency, List<LabeledPrice> prices, {int? messageThreadId, String? providerData, String? photoUrl, int? photoSize, int? photoWidth, int? photoHeight, bool? needName, bool? needPhoneNumber, bool? needEmail, bool? needShippingAddress, bool? sendPhoneNumberToProvider, bool? sendEmailToProvider, bool? isFlexible, bool? disableNotification, bool? protectContent, int? replyToMessageId, bool? allowSendingWithoutReply, InlineKeyboardMarkup? replyMarkup}) Future<Message>
Use this method to send invoices.
sendLocation(ChatID chatId, double latitude, double longitude, {int? messageThreadId, double? horizontalAccuracy, int? livePeriod, int? heading, int? proximityAlertRadius, bool? disableNotification, bool? protectContent, int? replyToMessageId, bool? allowSendingWithoutReply, ReplyMarkup? replyMarkup}) Future<Message>
Use this method to send point on the map.
sendMediaGroup(ChatID chatId, List<InputMedia> media, {int? messageThreadId, bool? disableNotification, bool? protectContent, bool? allowSendingWithoutReply, int? replyToMessageId}) Future<List<Message>>
Use this method to send a group of photos, videos,documents or audios as an album.
sendMessage(ChatID chatId, String text, {int? messageThreadId, ParseMode? parseMode, List<MessageEntity>? entities, bool? disableWebPagePreview, bool? disableNotification, bool? protectContent, int? replyToMessageId, bool? allowSendingWithoutReply, ReplyMarkup? replyMarkup}) Future<Message>
Use this method to send text messages.
sendPhoto(ChatID chatId, HttpFile photo, {int? messageThreadId, String? caption, ParseMode? parseMode, List<MessageEntity>? captionEntities, bool? hasSpoiler, bool? disableNotification, bool? protectContent, int? replyToMessageId, bool? allowSendingWithoutReply, ReplyMarkup? replyMarkup}) Future<Message>
Use this method to send photos.
sendPoll(ChatID chatId, String question, List<String> options, {int? messageThreadId, bool? isAnonymous, String? type, bool? allowsMultipleAnswers, int? correctOptionId, String? explanation, String? explanationParseMode, List<MessageEntity>? explanationEntities, int? openPeriod, int? closeDate, bool? isClosed, bool? disableNotification, bool? protectContent, int? replyToMessageId, bool? allowSendingWithoutReply, ReplyMarkup? replyMarkup}) Future<Message>
Use this method to send a native poll.
sendSticker(ChatID chatId, HttpFile sticker, {int? messageThreadId, String? emoji, bool? disableNotification, bool? protectContent, int? replyToMessageId, bool? allowSendingWithoutReply, ReplyMarkup? replyMarkup}) Future<Message>
Use this method to send static .WEBP, animated .TGS, or video .WEBM stickers.
sendVenue(ChatID chatId, double latitude, double longitude, String title, String address, {int? messageThreadId, String? foursquareId, String? foursquareType, String? googlePlaceId, String? googlePlaceType, bool? disableNotification, bool? protectContent, int? replyToMessageId, bool? allowSendingWithoutReply, ReplyMarkup? replyMarkup}) Future<Message>
Use this method to send information about a venue.
sendVideo(ChatID chatId, HttpFile video, {int? messageThreadId, int? duration, int? width, int? height, HttpFile? thumbnail, String? caption, ParseMode? parseMode, List<MessageEntity>? captionEntities, bool? hasSpoiler, bool? supportsStreaming, bool? disableNotification, bool? protectContent, int? replyToMessageId, bool? allowSendingWithoutReply, ReplyMarkup? replyMarkup}) Future<Message>
Use this method to send video files, Telegram clients support mp4 videos (other formats may be sent as Document).
sendVideoNote(ChatID chatId, HttpFile videoNote, {int? messageThreadId, int? duration, int? length, HttpFile? thumbnail, bool? disableNotification, bool? protectContent, int? replyToMessageId, bool? allowSendingWithoutReply, ReplyMarkup? replyMarkup}) Future<Message>
Use this method to send video messages.
sendVoice(ChatID chatId, HttpFile voice, {int? messageThreadId, String? caption, ParseMode? parseMode, List<MessageEntity>? captionEntities, int? duration, bool? disableNotification, bool? protectContent, int? replyToMessageId, bool? allowSendingWithoutReply, ReplyMarkup? replyMarkup}) Future<Message>
Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message.
setChatAdministratorCustomTitle(ChatID chatId, int userId, String customTitle) Future<bool>
Use this method to set a custom title for an administrator in a supergroup promoted by the bot.
setChatDescription(ChatID chatId, String description) Future<bool>
Use this method to change the description of a group, a supergroup or a channel.
setChatMenuButton({ChatID? chatId, MenuButton? menuButton}) Future<bool>
Use this method to change the bot's menu button in a private chat, or the default menu button.
setChatPermissions(ChatID chatId, ChatPermissions permissions, {bool? useIndependentChatPermissions}) Future<bool>
Use this method to set default chat permissions for all members.
setChatPhoto(ChatID chatId, HttpFile photo) Future<bool>
Use this method to set a new profile photo for the chat.
setChatStickerSet(ChatID chatId, String stickerSetName) Future<bool>
Use this method to set a new group sticker set for a supergroup.
setChatTitle(ChatID chatId, String title) Future<bool>
Use this method to change the title of a chat.
setCustomEmojiStickerSetThumbnail(String name, {String? customEmojiId}) Future<bool>
Use this method to set the thumbnail of a custom emoji sticker set.
setGameScore(int userId, int score, {bool? force, bool? disableEditMessage, ChatID? chatId, int? messageId}) Future<Message>
Use this method to set the score of the specified user in a game message.
setGameScoreInline(int userId, int score, {bool? force, bool? disableEditMessage, String? inlineMessageId}) Future<bool>
Use this method to set the score of the specified user in a game message.
setMyCommands(List<BotCommand> botCommands, {BotCommandScope? scope, String? languageCode}) Future<bool>
Use this method to change the list of the bot's commands. See https://core.telegram.org/bots#commands for more details about bot commands.
setMyDefaultAdministratorRights({ChatAdministratorRights? rights, bool? forChannels}) Future<bool>
Use this method to change the default administrator rights requested by the bot when it's added as an administrator to groups or channels.
setMyDescription({String? description, String? languageCode}) Future<bool>
Use this method to change the bot's description, which is shown in the chat with the bot if the chat is empty.
setMyName({String? name, String? languageCode}) Future<bool>
Use this method to change the bot's name.
setMyShortDescription({String? shortDescription, String? languageCode}) Future<bool>
Use this method to change the bot's short description, which is shown on the bot's profile page and is sent together with the link when users share the bot.
setStickerEmojiList(String sticker, List<String> emojiList) Future<bool>
Use 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.
setStickerKeywords(String sticker, List<String> keywords) Future<bool>
Use 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.
setStickerMaskPosition(String sticker, {MaskPosition? maskPosition}) Future<bool>
Use 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.
setStickerPositionInSet(String sticker, int position) Future<bool>
Use this method to move a sticker in a set created by the bot to a specific position.
setStickerSetThumbnail(String name, String userId, {HttpFile? thumbnail}) Future<bool>
Use this method to set the thumbnail of a sticker set. Animated thumbnails can be set for animated sticker sets only. Video thumbnails can be set only for video sticker sets only.
setStickerSetTitle(String name, String title) Future<bool>
Use this method to set the title of a created sticker set.
stopMessageLiveLocation({ChatID? chatId, int? messageId, ReplyMarkup? replyMarkup}) Future<Message>
Use this method to stop updating a live location message before live_period expires.
stopMessageLiveLocationInline({String? inlineMessageId, ReplyMarkup? replyMarkup}) Future<bool>
Use this method to stop updating a live location message before live_period expires.
stopPoll(ChatID chatId, int messageId, {ReplyMarkup? replyMarkup}) Future<Poll>
Use this method to stop a poll which was sent by the bot.
toString() String
A string representation of this object.
inherited
unbanChatMember(ChatID chatId, int userId, {bool? onlyIfBanned}) Future<bool>
Use this method to unban a previously kicked user in a supergroup or channel. The user will not return to the group or channel automatically, but will be able to join via link, etc.
unbanChatSenderChat(ChatID chatId, int senderChatId) Future<bool>
Use this method to unban a previously banned channel chat in a supergroup or channel.
unhideGeneralForumTopic(ChatID chatId) Future<bool>
Use this method to unhide the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. Returns True on success.
unpinAllChatMessages(ChatID chatId) Future<bool>
Use this method to clear the list of pinned messages in a chat.
unpinAllForumTopicMessages(ChatID chatId, int messageThreadId) Future<bool>
Use 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. Returns True on success.
unpinAllGeneralForumTopicMessages(ChatID chatId) Future<bool>
unpinChatMessage(ChatID chatId, {int? messageId}) Future<bool>
Use this method to remove a message from the list of pinned messages in a chat.
uploadStickerFile(String userId, InputSticker sticker, String stickerFormat) Future<File>
Use this method to upload a .PNG file with a sticker for later use in createNewStickerSet and addStickerToSet methods (can be used multiple times).

Operators

operator ==(Object other) bool
The equality operator.
inherited