Skip to content

GramIO API Reference / @gramio/contexts/dist

@gramio/contexts/dist

Enumerations

EnumerationDescription
ChatTypeEnum of ChatType property
EntityTypeEnum of EntityType property
PollTypeEnum of PollType property

Classes

ClassDescription
AcceptedGiftTypesThis object describes the types of gifts that can be gifted to a user or a chat.
AnimationAttachmentThis object represents an animation file (GIF or H.264/MPEG-4 AVC video without sound).
AttachmentSimple attachment
AudioAttachmentThis object represents an audio file to be treated as music by the Telegram clients.
BackgroundFillFreeformGradientThe background is a freeform gradient that rotates after every message in the chat.
BackgroundFillGradientThe background is a gradient fill.
BackgroundFillSolidThe background is filled using the selected color.
BackgroundTypeChatThemeThe background is taken directly from a built-in chat theme.
BackgroundTypeFillThe background is automatically filled based on the selected colors.
BackgroundTypePatternThe background is a PNG or TGV (gzipped subset of SVG with MIME type “application/x-tgwallpattern”) pattern to be combined with the background fill chosen by the user.
BackgroundTypeWallpaperThe background is a wallpaper in the JPEG format.
BirthdateDescribes the birthdate of a user.
BoostAddedContextThis object represents a service message about a forum topic closed in the chat. Currently holds no information.
BotCommandThis object represents a bot command
BotDescriptionThis object represents the bot's description.
BotShortDescriptionThis object represents the bot's short description.
BusinessBotRightsRepresents the rights of a business bot.
BusinessConnectionDescribes the connection of the bot with a business account.
BusinessConnectionContextThis object Describes the connection of the bot with a business account.
BusinessIntroContains information about the start page settings of a Telegram Business account.
BusinessLocationContains information about the location of a Telegram Business account.
BusinessMessagesDeletedDescribes the connection of the bot with a business account.
BusinessMessagesDeletedContextThis object represents a boost added to a chat or changed.
BusinessOpeningHoursDocumentation
BusinessOpeningHoursIntervalDescribes an interval of time during which a business is open.
CallbackGameA placeholder, currently holds no information.
CallbackQueryThis object represents an incoming callback query from a callback button in an inline keyboard. If the button that originated the query was attached to a message sent by the bot, the field message will be present. If the button was attached to a message sent via the bot (in inline mode), the field inline_message_id will be present. Exactly one of the fields data or game_short_name will be present.
CallbackQueryContextCalled when callback_query event occurs
ChatThis object represents a chat.
ChatActionMixinMain base context
ChatAdministratorRightsRepresents the rights of an administrator in a chat.
ChatBackgroundThis object represents a chat background.
ChatBackgroundSetContextThis object represents a service message about chat background set.
ChatBoostThis object contains information about a chat boost.
ChatBoostAddedThis object represents a service message about a user boosting a chat.
ChatBoostContextThis object represents a boost added to a chat or changed.
ChatBoostRemovedThis object represents a boost added to a chat or changed.
ChatBoostSourceGiftCodeThe boost was obtained by the creation of Telegram Premium gift codes to boost a chat. Each such code boosts the chat 4 times for the duration of the corresponding Telegram Premium subscription.
ChatBoostSourceGiveawayThe boost was obtained by the creation of a Telegram Premium giveaway. This boosts the chat 4 times for the duration of the corresponding Telegram Premium subscription.
ChatBoostSourcePremiumThe boost was obtained by subscribing to Telegram Premium or by gifting a Telegram Premium subscription to another user.
ChatBoostUpdatedThis object represents a boost added to a chat or changed.
ChatControlMixinThis object represents a mixin that is responsible for all the chat management methods
ChatFullInfoThis object contains full information about a chat.
ChatInviteControlMixinThis object represents a mixin that works with all *ChatInviteLink methods
ChatInviteLinkRepresents an invite link for a chat.
ChatJoinRequestRepresents a join request sent to a chat.
ChatJoinRequestContextRepresents a join request sent to a chat.
ChatLocationRepresents a location to which a chat is connected.
ChatMemberThis object contains information about one member of a chat. Currently, the following 6 types of chat members are supported: - ChatMemberOwner - ChatMemberAdministrator - ChatMemberMember - ChatMemberRestricted - ChatMemberLeft - ChatMemberBanned
ChatMemberContextThis object represents changes in the status of a chat member.
ChatMemberControlMixinThis object represents a mixin that is able to control member's rights
ChatMemberUpdatedThis object represents changes in the status of a chat member.
ChatOwnerChangedDescribes a service message about an ownership change in the chat.
ChatOwnerChangedContextThis object represents a service message about an ownership change in the chat.
ChatOwnerLeftDescribes a service message about the chat owner leaving the chat.
ChatOwnerLeftContextThis object represents a service message about the chat owner leaving the chat.
ChatPermissionsDescribes actions that a non-administrator user is allowed to take in a chat.
ChatPhotoThis object represents a chat photo.
ChatSenderControlMixinThis object is a mixin that does all the chat-sender stuff, right?
ChatSharedThis object contains information about the chat whose identifier was shared with the bot using a KeyboardButtonRequestChat button.
ChatSharedContextThis object contains information about the chat whose identifier was shared with the bot using a KeyboardButtonRequestChat button.
ChecklistDescribes a checklist.
ChecklistTaskDescribes a task in a checklist.
ChecklistTasksAddedDescribes a service message about tasks added to a checklist.
ChecklistTasksAddedContextThis object represents a service message about checklist tasks added.
ChecklistTasksDoneDescribes a service message about checklist tasks marked as done or not done.
ChecklistTasksDoneContextThis object represents a service message about checklist tasks done.
ChosenInlineResultRepresents a result of an inline query that was chosen by the user and sent to their chat partner.
ChosenInlineResultContextThe result of an inline query that was chosen by a user and sent to their chat partner
CloneMixinThis object represents a mixin which has clone(options?) method
ContactThis object represents a phone contact.
ContactAttachmentThis object represents a phone contact.
ContextMain base context
DeleteChatPhotoContextService message: the chat photo was deleted
DiceThis object represents an animated emoji that displays a random value.
DirectMessagePriceChangedDescribes a service message about a change in the price of direct messages sent to a channel chat.
DirectMessagePriceChangedContextThis object represents a service message about direct message price changed.
DirectMessagesTopicDescribes a topic of a direct messages chat.
DocumentAttachmentThis object represents a general file (as opposed to photos, voice messages and audio files).
DownloadMixinThis object represents a mixin that can be used to download media files
EncryptedCredentialsContains data required for decrypting and authenticatin EncryptedPassportElement. See the Telegram Passport Documentation for a complete description of the data decryption and authentication processes.
EncryptedPassportElementContains information about documents or other Telegram Passport elements shared with the bot by the user.
ExternalReplyInfoThis object contains information about a message that is being replied to, which may come from another chat or forum topic.
FileThis object represents a file ready to be downloaded. The file can be downloaded via the link https://api.telegram.org/file/bot<token>/<file_path>. 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.
FileAttachmentAttachment with fileId and fileUniqueId properties
ForumMixinThis object represents a mixin that's used in all topic-related updates
ForumTopicClosedThis object represents a service message about a forum topic closed in the chat. Currently holds no information.
ForumTopicClosedContextThis object represents a service message about a forum topic closed in the chat. Currently holds no information.
ForumTopicCreatedThis object represents a service message about a new forum topic created in the chat.
ForumTopicCreatedContextThis object represents a service message about a new forum topic created in the chat.
ForumTopicEditedThis object represents a service message about an edited forum topic.
ForumTopicEditedContextThis object represents a service message about an edited forum topic.
ForumTopicReopenedThis object represents a service message about an edited forum topic.
ForumTopicReopenedContextThis object represents a service message about a forum topic reopened in the chat. Currently holds no information.
GameThis object represents a game.
GeneralForumTopicHiddenThis object represents a service message about General forum topic hidden in the chat. Currently holds no information.
GeneralForumTopicHiddenContextThis object represents a service message about General forum topic hidden in the chat. Currently holds no information.
GeneralForumTopicUnhiddenThis object represents a service message about General forum topic unhidden in the chat. Currently holds no information.
GeneralForumTopicUnhiddenContextThis object represents a service message about General forum topic unhidden in the chat. Currently holds no information.
GiftDescribes a service message about a regular gift that was sent or received.
GiftBackgroundThis object describes the background of a gift.
GiftContextThis object contains information about the chat whose identifier was shared with the bot using a KeyboardButtonRequestChat button.
GiftInfoDescribes a service message about a regular gift that was sent or received.
GiftUpgradeSentContextThis object represents a service message about an upgrade of a gift that was purchased after the gift was sent.
GiveawayThis object represents a message about a scheduled giveaway.
GiveawayCompletedThis object represents a service message about the completion of a giveaway without public winners.
GiveawayCompletedContextThis object represents a service message about the creation of a scheduled giveaway. Currently holds no information.
GiveawayCreatedThis object represents a service message about the creation of a scheduled giveaway. Currently holds no information.
GiveawayCreatedContextThis object represents a service message about the creation of a scheduled giveaway.
GiveawayWinnersThis object represents a message about the completion of a giveaway with public winners.
GiveawayWinnersContextThis object represents a message about the completion of a giveaway with public winners.
GroupChatCreatedContextservice message: the group has been created
InaccessibleMessageThis object describes a message that was deleted or is otherwise inaccessible to the bot.
InlineKeyboardButtonThis object represents one button of an inline keyboard. You must use exactly one of the optional fields.
InlineKeyboardMarkupThis object represents an inline keyboard that appears right next to the message it belongs to.
InlineQueryThis object represents an incoming inline query. When the user sends an empty query, your bot could return some default or trending results.
InlineQueryContextThis object represents an incoming inline query. When the user sends an empty query, your bot could return some default or trending results.
InlineQueryResultLocationRepresents a location on a map. By default, the location will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the location.
InputChecklistDescribes a checklist to create.
InputChecklistTaskDescribes a task to add to a checklist.
InputLocationMessageContentRepresents the content of a location message to be sent as the result of an inline query.
InputPollOptionThis object contains information about one answer option in a poll to send.
InvoiceThis object contains basic information about an invoice.
InvoiceContextMessage is an invoice for a payment, information about the invoice. More about payments »
LeftChatMemberContextA member was removed from the group, information about them (this member may be the bot itself)
LinkPreviewOptionsDescribes the options used for link preview generation.
LocationThis object represents a point on the map.
LocationAttachmentThis object represents a point on the map.
LocationContextThis object represents a point on the map.
LoginUrlThis object represents a parameter of the inline keyboard button used to automatically authorize a user.
MaskPositionThis object describes the position on faces where a mask should be placed by default.
MenuButtonThis object describes the bot's menu button in a private chat.
MessageThis object represents a message.
MessageAutoDeleteTimerChangedThis object represents a service message about a change in auto-delete timer settings
MessageAutoDeleteTimerChangedContextThis object represents a service message about a change in auto-delete timer settings.
MessageContextCalled when message event occurs
MessageEntityThis object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc.
MessageIdThis object represents a unique message identifier.
MessageOriginChannelThe message was originally sent to a channel chat.
MessageOriginChatThe message was originally sent on behalf of a chat to a group chat.
MessageOriginHiddenUserThe message was originally sent by an unknown user.
MessageOriginUserThe message was originally sent by a known user.
MessageReactionContextThis object represents a change of a reaction on a message performed by a user.
MessageReactionCountContextThis object represents reaction changes on a message with anonymous reactions.
MessageReactionCountUpdatedThis object represents reaction changes on a message with anonymous reactions.
MessageReactionUpdatedThis object represents a change of a reaction on a message performed by a user.
MigrateFromChatIdContextThe group has been migrated to a supergroup with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.
MigrateToChatIdContextThe group has been migrated to a supergroup with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.
NewChatMembersContextNew members that were added to the group or supergroup and information about them (the bot itself may be one of these members)
NewChatPhotoContextA chat photo was change to this value
NewChatTitleContextA chat title was changed to this value
NodeMixinThis object represents a mixin which has id field and can invoke id-dependent methods
OrderInfoThis object represents information about an order.
PaidMediaInfoDescribes the paid media added to a message.
PaidMediaPhotoThe paid media is a photo.
PaidMediaPreviewThe paid media isn't available before the payment.
PaidMediaPurchasedContextThis object contains information about a paid media purchase.
PaidMediaVideoThe paid media is a video.
PaidMessagePriceChangedContextDescribes a service message about a change in the price of paid messages within a chat.
PassportDataContains information about Telegram Passport data shared with the bot by the user.
PassportDataContextDescribes Telegram Passport data shared with the bot by the user.
PassportFileThis object represents a file uploaded to Telegram Passport. Currently all Telegram Passport files are in JPEG format when decrypted and don't exceed 10MB.
PhotoAttachmentThis object represents a photo file with it's sizes
PhotoSizeThis object represents one size of a photo or a file / sticker thumbnail
PinnedMessageContextSpecified message was pinned. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply.
PinsMixinThis object represents a mixin that ensures you have methods to pin/unpin messages in the chat
PollThis object contains information about a poll.
PollAnswerThis object represents an answer of a user in a non-anonymous poll.
PollAnswerContextThis object represents an answer of a user in a non-anonymous poll.
PollAttachmentThis object contains information about a poll.
PollContextThis object contains information about a poll.
PollOptionThis object contains information about one answer option in a poll.
PreCheckoutQueryThis object contains information about an incoming pre-checkout query.
PreCheckoutQueryContextThis object contains information about an incoming pre-checkout query.
ProximityAlertTriggeredThis object represents the content of a service message, sent whenever a user in the chat triggers a proximity alert set by another user.
ProximityAlertTriggeredContextThis object represents the content of a service message, sent whenever a user in the chat triggers a proximity alert set by another user.
ReactionCountRepresents a reaction added to a message along with the number of times it was added.
ReactionTypeCustomEmojiThe reaction is based on a custom emoji.
ReactionTypeEmojiThe reaction is based on an emoji.
ReactionTypePaidThe reaction is paid.
RefundedPaymentThis object contains basic information about a refunded payment.
RefundedPaymentContextThis object contains basic information about a successful payment.
RemovedChatBoostContextThis object represents a boost removed from a chat.
SendMixinThis object represents a mixin which can invoke chatId/senderId-dependent methods
SentWebAppMessageContains information about an inline message sent by a Web App on behalf of a user.
SharedUserThis object contains information about the user whose identifier was shared with the bot using a KeyboardButtonRequestUser button.
ShippingAddressThis object represents a shipping address.
ShippingQueryThis object contains information about an incoming shipping query.
ShippingQueryContextThis object contains information about an incoming shipping query.
StickerAttachmentThis object represents a sticker.
StickerSetThis object represents a sticker set.
StoryThis object represents a story.
StoryAttachmentThis object represents a story.
SuccessfulPaymentThis object contains basic information about a successful payment.
SuccessfulPaymentContextThis object contains basic information about a successful payment.
SuggestedPostApprovalFailedDescribes a service message about the failed approval of a suggested post.
SuggestedPostApprovalFailedContextThis object represents a service message about the failed approval of a suggested post.
SuggestedPostApprovedDescribes a service message about the approval of a suggested post.
SuggestedPostApprovedContextThis object represents a service message about the approval of a suggested post.
SuggestedPostDeclinedDescribes a service message about the rejection of a suggested post.
SuggestedPostDeclinedContextThis object represents a service message about the rejection of a suggested post.
SuggestedPostInfoContains information about a suggested post.
SuggestedPostPaidDescribes a service message about a successful payment for a suggested post.
SuggestedPostPaidContextThis object represents a service message about a successful payment for a suggested post.
SuggestedPostPriceDescribes price of a suggested post.
SuggestedPostRefundedDescribes a service message about a payment refund for a suggested post.
SuggestedPostRefundedContextThis object represents a service message about a payment refund for a suggested post.
TargetMixinThis object represents a mixin which has sender data (e.g. senderId, from etc.)
TextQuoteThis object contains information about the quoted part of a message that is replied to by the given message.
UniqueGiftThis object describes a unique gift that was upgraded from a regular gift.
UniqueGiftBackdropThis object describes the colors of the backdrop of a unique gift.
UniqueGiftBackdropColorsDescribes a service message about a regular gift that was sent or received.
UniqueGiftColorsThis object contains information about the color scheme for a user's name, message replies and link previews based on a unique gift.
UniqueGiftContextThis object contains information about the chat whose identifier was shared with the bot using a KeyboardButtonRequestChat button.
UniqueGiftInfoDescribes a service message about a unique gift that was sent or received.
UniqueGiftModelDescribes a service message about a regular gift that was sent or received.
UniqueGiftSymbolDescribes a service message about a regular gift that was sent or received.
UpdateThis object represents an incoming update.
UserThis object represents a Telegram user or bot.
UserProfileAudiosThis object represents the audios displayed on a user's profile.
UserProfilePhotosThis object represent a user's profile pictures.
UserRatingThis object describes the rating of a user based on their Telegram Star spendings.
UsersSharedThis object contains information about the user whose identifier was shared with the bot using a KeyboardButtonRequestUser button.
UsersSharedContextThis object contains information about the users whose identifiers were shared with the bot using a KeyboardButtonRequestUsers button.
VenueThis object represents a venue.
VenueAttachmentThis object represents a venue.
VideoAttachmentThis object represents a video file.
VideoChatEndedThis object represents a service message about a video chat ended in the chat.
VideoChatEndedContextThis object represents a service message about a video chat ended in the chat.
VideoChatParticipantsInvitedThis object represents a service message about new members invited to a video chat.
VideoChatParticipantsInvitedContextThis object represents a service message about new members invited to a video chat.
VideoChatScheduledThis object represents a service message about a video chat scheduled in the chat
VideoChatScheduledContextThis object represents a service message about a video chat scheduled in the chat.
VideoChatStartedThis object represents a service message about a video chat started in the chat. Currently holds no information.
VideoChatStartedContextThis object represents a service message about a video chat started in the chat.
VideoNoteAttachmentThis object represents a video message.
VideoQualityThis object represents a video file of a specific quality.
VoiceAttachmentThis object represents a voice note.
WebAppDataContains data sent from a Web App to the bot.
WebAppDataContextDescribes data sent from a Web App to the bot.
WebAppInfoContains information about a Web App.
WriteAccessAllowedThis object represents a service message about a user allowing a bot added to the attachment menu to write messages. Currently holds no information.
WriteAccessAllowedContextThis object represents a service message about a user allowing a bot to write messages after adding it to the attachment menu, launching a Web App from a link, or accepting an explicit request from a Web App sent by the method requestWriteAccess.

Interfaces

InterfaceDescription
AttachmentsMappingMapping attachments type to their structures
BotLikeThe required object that the contexts are based on
DefaultAttachmentBase interface for attachment
StreamMessageOptionsOptions for SendMixin.streamMessage

Type Aliases

Type AliasDescription
AttachmentTypeUnion type of attachments type
ConstructorType helper constructor
ContextsMappingMapping events to their contexts
ContextTypeType util to get type of Context
CustomEventNameCustom Event Name
GetDerives-
JoinUnionType helper to join union type
MaybeArrayType helper to add array and non-array type
MessageContextWithRequiredFrom-
MessageDraftPieceA chunk of text for streaming via sendMessageDraft
MessageEventNameUnion type of MessageEvent names
OptionalMake some keys optional
RequireLike Required<T> but for specified keys of T
RequireValueLike Require<O, K> but it sets V as the value for K values
SoftStringPermits string but gives hints
tSendAnimationThis type represent SendAnimationParams and used by Contexts.MessageContext.sendMedia
tSendAudioThis type represent SendAudioParams and used by Contexts.MessageContext.sendMedia
tSendDocumentThis type represent SendDocumentParams and used by Contexts.MessageContext.sendMedia
tSendMethodsThis Union type represent a media that can be sended and used by Contexts.MessageContext.sendMedia
tSendPhotoThis type represent SendPhotoParams and used by Contexts.MessageContext.sendMedia
tSendStickerThis type represent SendStickerParams and used by Contexts.MessageContext.sendMedia
tSendVideoThis type represent SendVideoParams and used by Contexts.MessageContext.sendMedia
tSendVideoNoteThis type represent SendVideoNoteParams and used by Contexts.MessageContext.sendMedia
tSendVoiceThis type represent SendVoiceParams and used by Contexts.MessageContext.sendMedia
UpdateNameUnion type of Update names

Variables

applyMixins()

const applyMixins: (derivedCtor, baseCtors) => void

Defined in: contexts/index.d.ts:6701

Helper for construct mixins

Parameters

ParameterType
derivedCtorany
baseCtorsany[]

Returns

void


backgroundFillMap

const backgroundFillMap: object

Defined in: contexts/index.d.ts:1023

This object describes the way a background is filled based on the selected colors. Currently, it can be one of

Documentation

Type Declaration

NameTypeDefined in
freeform_gradienttypeof BackgroundFillFreeformGradientcontexts/index.d.ts:1026
gradienttypeof BackgroundFillGradientcontexts/index.d.ts:1025
solidtypeof BackgroundFillSolidcontexts/index.d.ts:1024

backgroundTypeMap

const backgroundTypeMap: object

Defined in: contexts/index.d.ts:1151

This object describes the type of a background. Currently, it can be one of

Documentation

Type Declaration

NameTypeDefined in
chat_themetypeof BackgroundTypeChatThemecontexts/index.d.ts:1155
filltypeof BackgroundTypeFillcontexts/index.d.ts:1152
patterntypeof BackgroundTypePatterncontexts/index.d.ts:1154
wallpapertypeof BackgroundTypeWallpapercontexts/index.d.ts:1153

contextsMappings

const contextsMappings: object

Defined in: contexts/index.d.ts:6728

Mapping UpdateNames to their contexts

Type Declaration

NameTypeDefined in
boost_addedtypeof BoostAddedContextcontexts/index.d.ts:6761
business_connectiontypeof BusinessConnectionContextcontexts/index.d.ts:6748
business_messagetypeof MessageContextcontexts/index.d.ts:6745
callback_querytypeof CallbackQueryContextcontexts/index.d.ts:6729
channel_posttypeof MessageContextcontexts/index.d.ts:6742
chat_background_settypeof ChatBackgroundSetContextcontexts/index.d.ts:6762
chat_boosttypeof ChatBoostContextcontexts/index.d.ts:6797
chat_join_requesttypeof ChatJoinRequestContextcontexts/index.d.ts:6730
chat_membertypeof ChatMemberContextcontexts/index.d.ts:6731
chat_owner_changedtypeof ChatOwnerChangedContextcontexts/index.d.ts:6786
chat_owner_lefttypeof ChatOwnerLeftContextcontexts/index.d.ts:6785
chat_sharedtypeof ChatSharedContextcontexts/index.d.ts:6781
checklist_tasks_addedtypeof ChecklistTasksAddedContextcontexts/index.d.ts:6764
checklist_tasks_donetypeof ChecklistTasksDoneContextcontexts/index.d.ts:6763
chosen_inline_resulttypeof ChosenInlineResultContextcontexts/index.d.ts:6733
delete_chat_phototypeof DeleteChatPhotoContextcontexts/index.d.ts:6734
deleted_business_messagestypeof BusinessMessagesDeletedContextcontexts/index.d.ts:6747
direct_message_price_changedtypeof DirectMessagePriceChangedContextcontexts/index.d.ts:6765
edited_business_messagetypeof MessageContextcontexts/index.d.ts:6746
edited_channel_posttypeof MessageContextcontexts/index.d.ts:6744
edited_messagetypeof MessageContextcontexts/index.d.ts:6743
forum_topic_closedtypeof ForumTopicClosedContextcontexts/index.d.ts:6773
forum_topic_createdtypeof ForumTopicCreatedContextcontexts/index.d.ts:6771
forum_topic_editedtypeof ForumTopicEditedContextcontexts/index.d.ts:6772
forum_topic_reopenedtypeof ForumTopicReopenedContextcontexts/index.d.ts:6774
general_forum_topic_hiddentypeof GeneralForumTopicHiddenContextcontexts/index.d.ts:6775
general_forum_topic_unhiddentypeof GeneralForumTopicUnhiddenContextcontexts/index.d.ts:6776
gifttypeof GiftContextcontexts/index.d.ts:6782
gift_upgrade_senttypeof GiftUpgradeSentContextcontexts/index.d.ts:6783
giveaway_completedtypeof GiveawayCompletedContextcontexts/index.d.ts:6800
giveaway_createdtypeof GiveawayCreatedContextcontexts/index.d.ts:6799
giveaway_winnerstypeof GiveawayWinnersContextcontexts/index.d.ts:6801
group_chat_createdtypeof GroupChatCreatedContextcontexts/index.d.ts:6735
inline_querytypeof InlineQueryContextcontexts/index.d.ts:6736
invoicetypeof InvoiceContextcontexts/index.d.ts:6737
left_chat_membertypeof LeftChatMemberContextcontexts/index.d.ts:6738
locationtypeof LocationContextcontexts/index.d.ts:6739
messagetypeof MessageContextcontexts/index.d.ts:6741
message_auto_delete_timer_changedtypeof MessageAutoDeleteTimerChangedContextcontexts/index.d.ts:6740
message_reactiontypeof MessageReactionContextcontexts/index.d.ts:6795
message_reaction_counttypeof MessageReactionCountContextcontexts/index.d.ts:6796
migrate_from_chat_idtypeof MigrateFromChatIdContextcontexts/index.d.ts:6749
migrate_to_chat_idtypeof MigrateToChatIdContextcontexts/index.d.ts:6750
my_chat_membertypeof ChatMemberContextcontexts/index.d.ts:6732
new_chat_memberstypeof NewChatMembersContextcontexts/index.d.ts:6751
new_chat_phototypeof NewChatPhotoContextcontexts/index.d.ts:6752
new_chat_titletypeof NewChatTitleContextcontexts/index.d.ts:6753
paid_message_price_changedtypeof PaidMessagePriceChangedContextcontexts/index.d.ts:6787
passport_datatypeof PassportDataContextcontexts/index.d.ts:6754
pinned_messagetypeof PinnedMessageContextcontexts/index.d.ts:6755
polltypeof PollContextcontexts/index.d.ts:6757
poll_answertypeof PollAnswerContextcontexts/index.d.ts:6756
pre_checkout_querytypeof PreCheckoutQueryContextcontexts/index.d.ts:6758
proximity_alert_triggeredtypeof ProximityAlertTriggeredContextcontexts/index.d.ts:6759
purchased_paid_mediatypeof PaidMediaPurchasedContextcontexts/index.d.ts:6794
refunded_paymenttypeof RefundedPaymentContextcontexts/index.d.ts:6779
removed_chat_boosttypeof RemovedChatBoostContextcontexts/index.d.ts:6798
service_messagetypeof MessageContextcontexts/index.d.ts:6793
shipping_querytypeof ShippingQueryContextcontexts/index.d.ts:6777
successful_paymenttypeof SuccessfulPaymentContextcontexts/index.d.ts:6778
suggested_post_approval_failedtypeof SuggestedPostApprovalFailedContextcontexts/index.d.ts:6767
suggested_post_approvedtypeof SuggestedPostApprovedContextcontexts/index.d.ts:6766
suggested_post_declinedtypeof SuggestedPostDeclinedContextcontexts/index.d.ts:6768
suggested_post_paidtypeof SuggestedPostPaidContextcontexts/index.d.ts:6769
suggested_post_refundedtypeof SuggestedPostRefundedContextcontexts/index.d.ts:6770
unique_gifttypeof UniqueGiftContextcontexts/index.d.ts:6784
users_sharedtypeof UsersSharedContextcontexts/index.d.ts:6780
video_chat_endedtypeof VideoChatEndedContextcontexts/index.d.ts:6788
video_chat_participants_invitedtypeof VideoChatParticipantsInvitedContextcontexts/index.d.ts:6789
video_chat_scheduledtypeof VideoChatScheduledContextcontexts/index.d.ts:6790
video_chat_startedtypeof VideoChatStartedContextcontexts/index.d.ts:6791
web_app_datatypeof WebAppDataContextcontexts/index.d.ts:6792
write_access_allowedtypeof WriteAccessAllowedContextcontexts/index.d.ts:6760

Example

typescript
contextMappings["message"] is MessageContext

EVENTS

const EVENTS: [keyof Message, MessageEventName][]

Defined in: contexts/index.d.ts:6711

Array of EVENTS


filterPayload()

const filterPayload: (payload) => Record<string, unknown>

Defined in: contexts/index.d.ts:6705

Helper for filter objects

Parameters

ParameterType
payloadRecord<string, any>

Returns

Record<string, unknown>


isParsable()

const isParsable: (source) => boolean

Defined in: contexts/index.d.ts:6707

Guard to check is string can be parsed via JSON.parse

Parameters

ParameterType
sourcestring

Returns

boolean


isPlainObject()

const isPlainObject: (object) => object is Record<string, any>

Defined in: contexts/index.d.ts:6703

Guard to check is it play object

Parameters

ParameterType
objectobject

Returns

object is Record<string, any>


paidMediaMap

const paidMediaMap: object

Defined in: contexts/index.d.ts:4354

This object describes paid media. Currently, it can be one of

Documentation

Type Declaration

NameTypeDefined in
phototypeof PaidMediaPhotocontexts/index.d.ts:4357
previewtypeof PaidMediaPreviewcontexts/index.d.ts:4355
videotypeof PaidMediaVideocontexts/index.d.ts:4356

SERVICE_MESSAGE_EVENTS

const SERVICE_MESSAGE_EVENTS: MessageEventName[]

Defined in: contexts/index.d.ts:6709

Array of SERVICE_MESSAGE_EVENTS

Functions

memoizeGetters()

memoizeGetters<T>(cls, fields): void

Defined in: contexts/index.d.ts:6699

Helper for getters memoization

Type Parameters

Type Parameter
T

Parameters

ParameterType
cls(...args) => T
fieldskeyof T[]

Returns

void


sleep()

sleep(ms): Promise<unknown>

Defined in: contexts/index.d.ts:5204

Parameters

ParameterType
msnumber

Returns

Promise<unknown>