ContextAwareMethods extension

Extension methods for enhanced Context functionality.

on

Methods

answerCallbackQuery({String? text, bool showAlert = false, String? url, int cacheTime = 0}) Future<bool>

Available on Context, provided by the ContextAwareMethods extension

Answers the callback query in the current update.
answerInlineQuery(List<InlineQueryResult> results, {int? cacheTime, bool? isPersonal, String? nextOffset, InlineQueryResultsButton? button}) Future<bool>

Available on Context, provided by the ContextAwareMethods extension

Answers the inline query in the current update.
banAuthor({DateTime? untilDate, bool? revokeMessages}) Future<bool>

Available on Context, provided by the ContextAwareMethods extension

Bans the author of the message
banChatMember(int userId, {DateTime? untilDate, bool? revokeMessages}) Future<bool>

Available on Context, provided by the ContextAwareMethods extension

Bans a user from the current chat.
copyHere({int? messageThreadId, String? caption, ParseMode? parseMode, List<MessageEntity>? captionEntities, bool? disableNotification, bool? protectContent, ReplyMarkup? replyMarkup, ReplyParameters? replyParameters, bool? showCaptionAboveMedia, bool? allowPaidBroadcast, int? videoStartTimestamp, int? directMessagesTopicId, SuggestedPostParameters? suggestedPostParameters}) Future<MessageId>

Available on Context, provided by the ContextAwareMethods extension

Copies the current message to the same chat with modifications.
copyMessage(ID toChatId, {int? messageThreadId, String? caption, ParseMode? parseMode, List<MessageEntity>? captionEntities, bool? disableNotification, bool? protectContent, ReplyMarkup? replyMarkup, ReplyParameters? replyParameters, bool? showCaptionAboveMedia, bool? allowPaidBroadcast, int? videoStartTimestamp, int? directMessagesTopicId, SuggestedPostParameters? suggestedPostParameters}) Future<MessageId>

Available on Context, provided by the ContextAwareMethods extension

Copies the current message to another chat.
deleteMessage() Future<bool>

Available on Context, provided by the ContextAwareMethods extension

Deletes the current message.
editInlineMessageCaption({String? businessConnectionId, String? caption, ParseMode? parseMode, List<MessageEntity>? captionEntities, bool? showCaptionAboveMedia, InlineKeyboardMarkup? replyMarkup}) Future<bool>

Available on Context, provided by the ContextAwareMethods extension

Edits the current inline message's caption (from chosen inline result or callback query).
editInlineMessageMedia(InputMedia media, {String? businessConnectionId, InlineKeyboardMarkup? replyMarkup}) Future<bool>

Available on Context, provided by the ContextAwareMethods extension

Edits the current inline message's media (from chosen inline result or callback query).
editInlineMessageReplyMarkup({InlineKeyboardMarkup? replyMarkup, String? businessConnectionId}) Future<bool>

Available on Context, provided by the ContextAwareMethods extension

Edits the current inline messages's reply markup.
editInlineMessageText(String text, {String? businessConnectionId, ParseMode? parseMode, List<MessageEntity>? entities, LinkPreviewOptions? linkPreviewOptions, InlineKeyboardMarkup? replyMarkup}) Future<bool>

Available on Context, provided by the ContextAwareMethods extension

Edits the current inline message's text (from chosen inline result or callback query).
editMessageCaption({String? businessConnectionId, String? caption, ParseMode? parseMode, List<MessageEntity>? captionEntities, bool? showCaptionAboveMedia, InlineKeyboardMarkup? replyMarkup}) Future<Message>

Available on Context, provided by the ContextAwareMethods extension

Edits the current message's caption.
editMessageMedia(InputMedia media, {String? businessConnectionId, InlineKeyboardMarkup? replyMarkup}) Future<Message>

Available on Context, provided by the ContextAwareMethods extension

Edits the current message's media.
editMessageReplyMarkup({InlineKeyboardMarkup? replyMarkup, String? businessConnectionId}) Future<Message>

Available on Context, provided by the ContextAwareMethods extension

Edits the current message's reply markup.
editMessageText(String text, {String? businessConnectionId, ParseMode? parseMode, List<MessageEntity>? entities, LinkPreviewOptions? linkPreviewOptions, InlineKeyboardMarkup? replyMarkup}) Future<Message>

Available on Context, provided by the ContextAwareMethods extension

Edits the current message's text.
forwardHere({bool? disableNotification, int? messageThreadId, bool? protectContent, int? videoStartTimestamp, int? directMessagesTopicId, SuggestedPostParameters? suggestedPostParameters}) Future<Message>

Available on Context, provided by the ContextAwareMethods extension

Forwards the current message to the same chat (useful for highlighting).
forwardMessage(ID toChatId, {bool? disableNotification, int? messageThreadId, bool? protectContent, int? videoStartTimestamp, int? directMessagesTopicId, SuggestedPostParameters? suggestedPostParameters}) Future<Message>

Available on Context, provided by the ContextAwareMethods extension

Forwards the current message to another chat.
getChat() Future<ChatFullInfo>

Available on Context, provided by the ContextAwareMethods extension

Gets information about the current chat.
getChatAdministrators() Future<List<ChatMember>>

Available on Context, provided by the ContextAwareMethods extension

Gets the list of administrators in the current chat.
getChatMember(int userId) Future<ChatMember>

Available on Context, provided by the ContextAwareMethods extension

Gets information about a specific chat member.
getChatMemberCount() Future<int>

Available on Context, provided by the ContextAwareMethods extension

Gets the member count of the current chat.
getEffectiveChatId() ID?

Available on Context, provided by the ContextAwareMethods extension

Gets the effective chat ID in the correct ID format.
getEffectiveUserId() int?

Available on Context, provided by the ContextAwareMethods extension

Gets the effective user ID (from callback query, inline query, or message).
getEntitiesOfType(MessageEntityType type) List<MessageEntity>

Available on Context, provided by the ContextAwareMethods extension

Gets all entities of a specific type from the message.
getMessageFile() Future<File?>

Available on Context, provided by the ContextAwareMethods extension

Gets file information for a file in the current message.
getReplyToMessage() Message?

Available on Context, provided by the ContextAwareMethods extension

Gets the message being replied to, if any.
getUserDisplayName() String

Available on Context, provided by the ContextAwareMethods extension

Gets the display name for the user (first name + last name or username).
getUserProfilePhotos({int? offset, int? limit}) Future<UserProfilePhotos>

Available on Context, provided by the ContextAwareMethods extension

Gets profile photos for the user who sent the current message.
hasEntity(MessageEntityType type) bool

Available on Context, provided by the ContextAwareMethods extension

Checks if the message contains any entities of a specific type.
hasMedia() bool

Available on Context, provided by the ContextAwareMethods extension

Checks if the message has any media content.
hasText(String text, {bool caseSensitive = false}) bool

Available on Context, provided by the ContextAwareMethods extension

Checks if the message contains a specific text.
hasUsername(String username) bool

Available on Context, provided by the ContextAwareMethods extension

Checks if the user has a specific username.
isFromBot() bool

Available on Context, provided by the ContextAwareMethods extension

Checks if the current user is a bot admin (user ID matches bot ID).
isFromChat(ChatID chatId) bool

Available on Context, provided by the ContextAwareMethods extension

Checks if the current chat is a specific chat.
isFromUser(int userId) bool

Available on Context, provided by the ContextAwareMethods extension

Checks if the current user is the sender of the message.
isReply() bool

Available on Context, provided by the ContextAwareMethods extension

Checks if the message is a reply to another message.
kickChatMember(int userId, {bool? revokeMessages}) Future<bool>

Available on Context, provided by the ContextAwareMethods extension

Kicks a user from the current chat.
leaveChat() Future<bool>

Available on Context, provided by the ContextAwareMethods extension

Leaves the current chat.
muteChatMember(int userId, {DateTime? untilDate, bool allowMedia = false, bool allowOther = false}) Future<bool>

Available on Context, provided by the ContextAwareMethods extension

Mutes a user in the current chat by restricting their ability to send messages.
pinMessage({bool? disableNotification}) Future<bool>

Available on Context, provided by the ContextAwareMethods extension

Pins the current message in the chat.
promoteAuthor({bool? isAnonymous, bool? canManageChat, bool? canPostMessages, bool? canEditMessages, bool? canDeleteMessages, bool? canManageVideoChats, bool? canRestrictMembers, bool? canPromoteMembers, bool? canChangeInfo, bool? canInviteUsers, bool? canPinMessages, bool? canManageTopics, bool? canPostStories, bool? canEditStories, bool? canDeleteStories, bool? canManageDirectMessages}) Future<bool>

Available on Context, provided by the ContextAwareMethods extension

Promotes the author of the message to administrator in the current chat.
promoteAuthorToContentManager() Future<bool>

Available on Context, provided by the ContextAwareMethods extension

Promotes the author to content manager with content-related permissions.
promoteAuthorToFullAdmin() Future<bool>

Available on Context, provided by the ContextAwareMethods extension

Promotes the author to full administrator with all permissions.
promoteAuthorToModerator() Future<bool>

Available on Context, provided by the ContextAwareMethods extension

Promotes the author to moderator with common moderation permissions.
promoteChatMember(int userId, {bool? isAnonymous, bool? canManageChat, bool? canPostMessages, bool? canEditMessages, bool? canDeleteMessages, bool? canManageVideoChats, bool? canRestrictMembers, bool? canPromoteMembers, bool? canChangeInfo, bool? canInviteUsers, bool? canPinMessages, bool? canManageTopics, bool? canPostStories, bool? canEditStories, bool? canDeleteStories, bool? canManageDirectMessages}) Future<bool>

Available on Context, provided by the ContextAwareMethods extension

Promotes a user to administrator in the current chat.
promoteToContentManager(int userId) Future<bool>

Available on Context, provided by the ContextAwareMethods extension

Promotes a user to content manager with content-related permissions.
promoteToFullAdmin(int userId) Future<bool>

Available on Context, provided by the ContextAwareMethods extension

Promotes a user to full administrator with all permissions.
promoteToModerator(int userId) Future<bool>

Available on Context, provided by the ContextAwareMethods extension

Promotes a user to moderator with common moderation permissions.
react(String reaction, {bool? isBig}) Future<bool>

Available on Context, provided by the ContextAwareMethods extension

Sets a normal reaction on the current message.
reactWithFire({bool? isBig}) Future<bool>

Available on Context, provided by the ContextAwareMethods extension

Adds a fire reaction to the current message.
reactWithHeart({bool? isBig}) Future<bool>

Available on Context, provided by the ContextAwareMethods extension

Adds a heart reaction to the current message.
reactWithThumbsUp({bool? isBig}) Future<bool>

Available on Context, provided by the ContextAwareMethods extension

Adds a thumbs up reaction to the current message.
readBusinessMessage() Future<bool>

Available on Context, provided by the ContextAwareMethods extension

Reads the current business message.
removeKeyboard() Future<Message>

Available on Context, provided by the ContextAwareMethods extension

Removes the current message's keyboard.
removeReactions() Future<bool>

Available on Context, provided by the ContextAwareMethods extension

Removes all reactions from the current message.
reply(String text, {int? messageThreadId, ParseMode? parseMode, List<MessageEntity>? entities, bool? disableNotification, bool? protectContent, ReplyMarkup? replyMarkup, ReplyParameters? replyParameters, LinkPreviewOptions? linkPreviewOptions, String? businessConnectionId, String? messageEffectId, bool? allowPaidBroadcast, int? directMessagesTopicId, SuggestedPostParameters? suggestedPostParameters}) Future<Message>

Available on Context, provided by the ContextAwareMethods extension

Replies to the current message with text.
replyWithAnimation(InputFile animation, {int? messageThreadId, int? duration, int? width, int? height, InputFile? thumbnail, String? caption, ParseMode? parseMode, List<MessageEntity>? captionEntities, bool? hasSpoiler, bool? disableNotification, bool? protectContent, ReplyMarkup? replyMarkup, ReplyParameters? replyParameters, String? businessConnectionId, String? messageEffectId, bool? showCaptionAboveMedia, bool? allowPaidBroadcast, int? directMessagesTopicId, SuggestedPostParameters? suggestedPostParameters}) Future<Message>

Available on Context, provided by the ContextAwareMethods extension

Sends an animation (GIF or H.264/MPEG-4 AVC video without sound) to the current chat.
replyWithAudio(InputFile audio, {int? messageThreadId, String? caption, ParseMode? parseMode, List<MessageEntity>? captionEntities, int? duration, String? performer, String? title, InputFile? thumbnail, bool? disableNotification, bool? protectContent, ReplyMarkup? replyMarkup, ReplyParameters? replyParameters, String? businessConnectionId, String? messageEffectId, bool? allowPaidBroadcast, int? directMessagesTopicId, SuggestedPostParameters? suggestedPostParameters}) Future<Message>

Available on Context, provided by the ContextAwareMethods extension

Sends an audio file to the current chat.
replyWithContact(String phoneNumber, String firstName, {int? messageThreadId, String? lastName, String? vcard, bool? disableNotification, bool? protectContent, ReplyMarkup? replyMarkup, ReplyParameters? replyParameters, String? businessConnectionId, String? messageEffectId, bool? allowPaidBroadcast, int? directMessagesTopicId, SuggestedPostParameters? suggestedPostParameters}) Future<Message>

Available on Context, provided by the ContextAwareMethods extension

Sends contact information to the current chat.
replyWithDice({DiceEmoji emoji = DiceEmoji.dice, int? messageThreadId, bool? disableNotification, bool? protectContent, ReplyMarkup? replyMarkup, ReplyParameters? replyParameters, String? businessConnectionId, String? messageEffectId, bool? allowPaidBroadcast, int? directMessagesTopicId, SuggestedPostParameters? suggestedPostParameters}) Future<Message>

Available on Context, provided by the ContextAwareMethods extension

Sends a dice animation to the current chat.
replyWithDocument(InputFile document, {int? messageThreadId, InputFile? thumbnail, String? caption, ParseMode? parseMode, List<MessageEntity>? captionEntities, bool? disableContentTypeDetection, bool? disableNotification, bool? protectContent, ReplyMarkup? replyMarkup, ReplyParameters? replyParameters, String? businessConnectionId, String? messageEffectId, bool? allowPaidBroadcast, int? directMessagesTopicId, SuggestedPostParameters? suggestedPostParameters}) Future<Message>

Available on Context, provided by the ContextAwareMethods extension

Sends a document to the current chat.
replyWithLocation(double latitude, double longitude, {int? messageThreadId, double? horizontalAccuracy, int? livePeriod, int? heading, int? proximityAlertRadius, bool? disableNotification, bool? protectContent, ReplyMarkup? replyMarkup, ReplyParameters? replyParameters, String? businessConnectionId, String? messageEffectId, bool? allowPaidBroadcast, int? directMessagesTopicId, SuggestedPostParameters? suggestedPostParameters}) Future<Message>

Available on Context, provided by the ContextAwareMethods extension

Sends a location to the current chat.
replyWithMediaGroup(List<InputMedia> media, {int? messageThreadId, bool? disableNotification, bool? protectContent, ReplyParameters? replyParameters, String? businessConnectionId, String? messageEffectId, bool? allowPaidBroadcast, int? directMessagesTopicId}) Future<List<Message>>

Available on Context, provided by the ContextAwareMethods extension

Sends a media group (2-10 items) to the current chat.
replyWithPhoto(InputFile photo, {int? messageThreadId, String? caption, ParseMode? parseMode, List<MessageEntity>? captionEntities, bool? disableNotification, bool? protectContent, ReplyMarkup? replyMarkup, bool? hasSpoiler, ReplyParameters? replyParameters, String? businessConnectionId, String? messageEffectId, bool? showCaptionAboveMedia, bool? allowPaidBroadcast, int? directMessagesTopicId, SuggestedPostParameters? suggestedPostParameters}) Future<Message>

Available on Context, provided by the ContextAwareMethods extension

Replies to the current message with a photo.
replyWithPoll(String question, List<InputPollOption> options, {int? messageThreadId, bool? isAnonymous, PollType type = PollType.regular, bool? allowsMultipleAnswers, int? correctOptionId, String? explanation, ParseMode? explanationParseMode, List<MessageEntity>? explanationEntities, int? openPeriod, DateTime? closeDate, bool? isClosed, bool? disableNotification, bool? protectContent, ReplyMarkup? replyMarkup, ReplyParameters? replyParameters, String? businessConnectionId, ParseMode? questionParseMode, List<MessageEntity>? questionEntities, String? messageEffectId, bool? allowPaidBroadcast}) Future<Message>

Available on Context, provided by the ContextAwareMethods extension

Sends a poll to the current chat.
replyWithSticker(InputFile sticker, {String? businessConnectionId, int? messageThreadId, String? emoji, bool? disableNotification, bool? protectContent, bool? allowPaidBroadcast, String? messageEffectId, ReplyParameters? replyParameters, ReplyMarkup? replyMarkup, int? directMessagesTopicId, SuggestedPostParameters? suggestedPostParameters}) Future<Message>

Available on Context, provided by the ContextAwareMethods extension

Sends a sticker to the current chat.
replyWithVenue(double latitude, double longitude, String title, String address, {int? messageThreadId, String? foursquareId, String? foursquareType, String? googlePlaceId, String? googlePlaceType, bool? disableNotification, bool? protectContent, ReplyMarkup? replyMarkup, ReplyParameters? replyParameters, String? businessConnectionId, String? messageEffectId, bool? allowPaidBroadcast, int? directMessagesTopicId, SuggestedPostParameters? suggestedPostParameters}) Future<Message>

Available on Context, provided by the ContextAwareMethods extension

Sends venue information to the current chat.
replyWithVideo(InputFile video, {int? messageThreadId, int? duration, int? width, int? height, InputFile? thumbnail, String? caption, ParseMode? parseMode, List<MessageEntity>? captionEntities, bool? hasSpoiler, bool? supportsStreaming, bool? disableNotification, bool? protectContent, ReplyMarkup? replyMarkup, ReplyParameters? replyParameters, String? businessConnectionId, String? messageEffectId, bool? showCaptionAboveMedia, bool? allowPaidBroadcast, InputFile? cover, int? startTimestamp, int? directMessagesTopicId, SuggestedPostParameters? suggestedPostParameters}) Future<Message>

Available on Context, provided by the ContextAwareMethods extension

Sends a video to the current chat.
replyWithVideoNote(InputFile videoNote, {int? messageThreadId, int? duration, int? length, InputFile? thumbnail, bool? disableNotification, bool? protectContent, ReplyMarkup? replyMarkup, ReplyParameters? replyParameters, String? businessConnectionId, String? messageEffectId, bool? allowPaidBroadcast, int? directMessagesTopicId, SuggestedPostParameters? suggestedPostParameters}) Future<Message>

Available on Context, provided by the ContextAwareMethods extension

Sends a video note (rounded square MPEG4 video) to the current chat.
replyWithVoice(InputFile voice, {int? messageThreadId, String? caption, ParseMode? parseMode, List<MessageEntity>? captionEntities, int? duration, bool? disableNotification, bool? protectContent, ReplyMarkup? replyMarkup, ReplyParameters? replyParameters, String? businessConnectionId, String? messageEffectId, bool? allowPaidBroadcast, int? directMessagesTopicId, SuggestedPostParameters? suggestedPostParameters}) Future<Message>

Available on Context, provided by the ContextAwareMethods extension

Sends a voice message to the current chat.
restrictChatMember(int userId, ChatPermissions permissions, {DateTime? untilDate, bool? useIndependentChatPermissions}) Future<bool>

Available on Context, provided by the ContextAwareMethods extension

Restricts a user in the current chat.
sendChatAction(ChatAction action, {int? messageThreadId, String? businessConnectionId}) Future<bool>

Available on Context, provided by the ContextAwareMethods extension

Sends a chat action to the current chat.
sendTyping() Future<bool>

Available on Context, provided by the ContextAwareMethods extension

Sends "typing" action to the current chat.
sendUploadDocument() Future<bool>

Available on Context, provided by the ContextAwareMethods extension

Sends "upload document" action to the current chat.
sendUploadPhoto() Future<bool>

Available on Context, provided by the ContextAwareMethods extension

Sends "upload photo" action to the current chat.
setReaction(List<ReactionType>? reaction, {bool? isBig}) Future<bool>

Available on Context, provided by the ContextAwareMethods extension

Sets a reaction on the current message.
unbanChatMember(int userId, {bool? onlyIfBanned}) Future<bool>

Available on Context, provided by the ContextAwareMethods extension

Unbans a previously banned user in the current chat.
unmuteChatMember(int userId) Future<bool>

Available on Context, provided by the ContextAwareMethods extension

Unmutes a user in the current chat by restoring their default permissions.
unpinMessage({String? businessConnectionId}) Future<bool>

Available on Context, provided by the ContextAwareMethods extension

Unpins the current message in the chat.
withTyping<T>(Future<T> operation()) Future<T>

Available on Context, provided by the ContextAwareMethods extension

Shows typing indicator and executes a function.
withUploadDocument<T>(Future<T> operation()) Future<T>

Available on Context, provided by the ContextAwareMethods extension

Shows upload document indicator and executes a function.
withUploadPhoto<T>(Future<T> operation()) Future<T>

Available on Context, provided by the ContextAwareMethods extension

Shows upload photo indicator and executes a function.