Skip to content

GramIO API Reference / @gramio/contexts/dist / PollOptionAddedContext

Class: PollOptionAddedContext<Bot> ​

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

This object represents a service message about an option added to a poll.

Extends ​

Type Parameters ​

Type Parameter
Bot extends BotLike

Constructors ​

Constructor ​

new PollOptionAddedContext<Bot>(options): PollOptionAddedContext<Bot>

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

Parameters ​

ParameterType
optionsPollOptionAddedContextOptions<Bot>

Returns ​

PollOptionAddedContext<Bot>

Overrides ​

Context.constructor


Constructor ​

new PollOptionAddedContext(...args): PollOptionAddedContext

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

Parameters ​

ParameterType
...argsany[]

Returns ​

PollOptionAddedContext

Overrides ​

Context<Bot>.constructor

Properties ​

PropertyModifierTypeDescriptionInherited fromDefined in
botpublicBot-Context.botcontexts/index.d.ts:5240
payloadpublicTelegramMessageThe raw data that is used for this ContextMessage.payloadcontexts/index.d.ts:7110
update?publicTelegramUpdate-Context.updatecontexts/index.d.ts:5242
updateId?publicnumber-Context.updateIdcontexts/index.d.ts:5241
updateTypeprotectedUpdateName-Context.updateTypecontexts/index.d.ts:5243

Accessors ​

[toStringTag] ​

Get Signature ​

get [toStringTag](): string

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

MDN

Returns ​

string

Inherited from ​

Context.[toStringTag]


animation ​

Get Signature ​

get animation(): AnimationAttachment

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

Message is an animation, information about the animation. For backward compatibility, when this field is set, the document field will also be set

Returns ​

AnimationAttachment

Inherited from ​

Message.animation


audio ​

Get Signature ​

get audio(): AudioAttachment

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

Message is an audio file, information about the file

Returns ​

AudioAttachment

Inherited from ​

Message.audio


authorSignature ​

Get Signature ​

get authorSignature(): string

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

Signature of the post author for messages in channels, or the custom title of an anonymous group administrator

Returns ​

string

Inherited from ​

Message.authorSignature


businessConnectionId ​

Get Signature ​

get businessConnectionId(): string

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

Unique identifier of the business connection from which the message was received. If non-empty, the message belongs to a chat of the corresponding business account that is independent from any potential bot chat which might share the same identifier.

Returns ​

string

Inherited from ​

Message.businessConnectionId


caption ​

Get Signature ​

get caption(): string

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

Caption for the animation, audio, document, photo, video or voice, 0-1024 characters

Returns ​

string

Inherited from ​

Message.caption


captionEntities ​

Get Signature ​

get captionEntities(): MessageEntity[]

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

For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption

Returns ​

MessageEntity[]

Inherited from ​

Message.captionEntities


channelChatCreated ​

Get Signature ​

get channelChatCreated(): true

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

Service message: the channel has been created. This field can't be received in a message coming through updates, because bot can't be a member of a channel when it is created. It can only be found in replyMessage if someone replies to a very first message in a channel.

Returns ​

true

Inherited from ​

Message.channelChatCreated


chat ​

Get Signature ​

get chat(): Chat

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

Conversation the message belongs to

Returns ​

Chat

Inherited from ​

Message.chat


chatBackgroundSet ​

Get Signature ​

get chatBackgroundSet(): ChatBackground

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

Service message: chat background set

Returns ​

ChatBackground

Inherited from ​

Message.chatBackgroundSet


chatBoostAdded ​

Get Signature ​

get chatBoostAdded(): ChatBoostAdded

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

Service message: chat boost added

Returns ​

ChatBoostAdded

Inherited from ​

Message.chatBoostAdded


chatId ​

Get Signature ​

get chatId(): number

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

Chat ID

Returns ​

number

Inherited from ​

TargetMixin.chatId


chatOwnerChanged ​

Get Signature ​

get chatOwnerChanged(): ChatOwnerChanged

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

Service message: chat owner has changed

Returns ​

ChatOwnerChanged

Inherited from ​

Message.chatOwnerChanged


chatOwnerLeft ​

Get Signature ​

get chatOwnerLeft(): ChatOwnerLeft

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

Service message: chat owner has left

Returns ​

ChatOwnerLeft

Inherited from ​

Message.chatOwnerLeft


chatShared ​

Get Signature ​

get chatShared(): ChatShared

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

Service message: a chat was shared with the bot

Returns ​

ChatShared

Inherited from ​

Message.chatShared


chatType ​

Get Signature ​

get chatType(): TelegramChatType

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

Chat type

Returns ​

TelegramChatType

Inherited from ​

TargetMixin.chatType


checklist ​

Get Signature ​

get checklist(): Checklist

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

Returns ​

Checklist

Inherited from ​

Message.checklist


checklistTasksAdded ​

Get Signature ​

get checklistTasksAdded(): ChecklistTasksAdded

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

Service message: checklist tasks added

Returns ​

ChecklistTasksAdded

Inherited from ​

Message.checklistTasksAdded


checklistTasksDone ​

Get Signature ​

get checklistTasksDone(): ChecklistTasksDone

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

Service message: checklist tasks done

Returns ​

ChecklistTasksDone

Inherited from ​

Message.checklistTasksDone


communityChatAdded ​

Get Signature ​

get communityChatAdded(): CommunityChatAdded

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

Service message: a chat was added to a community

Returns ​

CommunityChatAdded

Inherited from ​

Message.communityChatAdded


communityChatJoined ​

Get Signature ​

get communityChatJoined(): CommunityChatJoined

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

Service message: a chat joined a community

Returns ​

CommunityChatJoined

Inherited from ​

Message.communityChatJoined


communityChatRemoved ​

Get Signature ​

get communityChatRemoved(): CommunityChatRemoved

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

Service message: a chat was removed from a community

Returns ​

CommunityChatRemoved

Inherited from ​

Message.communityChatRemoved


connectedWebsite ​

Get Signature ​

get connectedWebsite(): string

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

The domain name of the website on which the user has logged in.

Returns ​

string

Inherited from ​

Message.connectedWebsite


contact ​

Get Signature ​

get contact(): Contact

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

Message is a shared contact, information about the contact

Returns ​

Contact

Inherited from ​

Message.contact


createdAt ​

Get Signature ​

get createdAt(): number

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

Date the message was sent in Unix time

Returns ​

number

Inherited from ​

Message.createdAt


deleteChatPhoto ​

Get Signature ​

get deleteChatPhoto(): true

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

Service message: the chat photo was deleted

Returns ​

true

Inherited from ​

Message.deleteChatPhoto


dice ​

Get Signature ​

get dice(): Dice

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

Message is a dice with random value from 1 to 6

Returns ​

Dice

Inherited from ​

Message.dice


directMessagePriceChanged ​

Get Signature ​

get directMessagePriceChanged(): DirectMessagePriceChanged

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

Service message: direct message price changed

Returns ​

DirectMessagePriceChanged

Inherited from ​

Message.directMessagePriceChanged


directMessagesTopic ​

Get Signature ​

get directMessagesTopic(): DirectMessagesTopic

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

Optional. Information about the direct messages chat topic that contains the message

Returns ​

DirectMessagesTopic

Inherited from ​

Message.directMessagesTopic


document ​

Get Signature ​

get document(): DocumentAttachment

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

Message is a general file, information about the file

Returns ​

DocumentAttachment

Inherited from ​

Message.document


effectId ​

Get Signature ​

get effectId(): string

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

Unique identifier of the message effect added to the message

Returns ​

string

Inherited from ​

Message.effectId


entities ​

Get Signature ​

get entities(): MessageEntity[]

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

For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text

Returns ​

MessageEntity[]

Inherited from ​

Message.entities


ephemeralMessageId ​

Get Signature ​

get ephemeralMessageId(): number

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

Unique message identifier of this ephemeral message inside the chat. Use it with editEphemeralMessage* / deleteEphemeralMessage and as ReplyParameters.ephemeral_message_id. Present only for ephemeral messages.

Returns ​

number

Inherited from ​

Message.ephemeralMessageId


externalReply ​

Get Signature ​

get externalReply(): ExternalReplyInfo

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

Information about the message that is being replied to, which may come from another chat or forum topic

Returns ​

ExternalReplyInfo

Inherited from ​

Message.externalReply


forumTopicClosed ​

Get Signature ​

get forumTopicClosed(): ForumTopicClosed

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

Service message: forum topic closed

Returns ​

ForumTopicClosed

Inherited from ​

Message.forumTopicClosed


forumTopicCreated ​

Get Signature ​

get forumTopicCreated(): ForumTopicCreated

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

Service message: forum topic created

Returns ​

ForumTopicCreated

Inherited from ​

Message.forumTopicCreated


forumTopicEdited ​

Get Signature ​

get forumTopicEdited(): ForumTopicEdited

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

Service message: forum topic edited

Returns ​

ForumTopicEdited

Inherited from ​

Message.forumTopicEdited


forumTopicReopened ​

Get Signature ​

get forumTopicReopened(): ForumTopicReopened

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

Service message: forum topic reopened

Returns ​

ForumTopicReopened

Inherited from ​

Message.forumTopicReopened


forwardOrigin ​

Get Signature ​

get forwardOrigin(): MessageOriginUser | MessageOriginChat | MessageOriginChannel | MessageOriginHiddenUser

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

Information about the original message for forwarded messages

Returns ​

MessageOriginUser | MessageOriginChat | MessageOriginChannel | MessageOriginHiddenUser

Inherited from ​

Message.forwardOrigin


from ​

Get Signature ​

get from(): User

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

Sender, empty for messages sent to channels

Returns ​

User

Inherited from ​

Message.from


game ​

Get Signature ​

get game(): Game

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

Message is a game, information about the game

Returns ​

Game

Inherited from ​

Message.game


generalForumTopicHidden ​

Get Signature ​

get generalForumTopicHidden(): GeneralForumTopicHidden

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

Service message: the 'General' forum topic hidden

Returns ​

GeneralForumTopicHidden

Inherited from ​

Message.generalForumTopicHidden


generalForumTopicUnhidden ​

Get Signature ​

get generalForumTopicUnhidden(): GeneralForumTopicUnhidden

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

Service message: the 'General' forum topic unhidden

Returns ​

GeneralForumTopicUnhidden

Inherited from ​

Message.generalForumTopicUnhidden


gift ​

Get Signature ​

get gift(): GiftInfo

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

Service message: a gift was sent to the chat

Returns ​

GiftInfo

Inherited from ​

Message.gift


giftUpgradeSent ​

Get Signature ​

get giftUpgradeSent(): GiftInfo

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

Service message: upgrade of a gift was purchased after the gift was sent

Returns ​

GiftInfo

Inherited from ​

Message.giftUpgradeSent


giveaway ​

Get Signature ​

get giveaway(): Giveaway

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

The message is a scheduled giveaway message

Returns ​

Giveaway

Inherited from ​

Message.giveaway


giveawayCompleted ​

Get Signature ​

get giveawayCompleted(): GiveawayCompleted

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

Service message: a giveaway without public winners was completed

Returns ​

GiveawayCompleted

Inherited from ​

Message.giveawayCompleted


giveawayCreated ​

Get Signature ​

get giveawayCreated(): GiveawayCreated

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

Service message: a scheduled giveaway was created

Returns ​

GiveawayCreated

Inherited from ​

Message.giveawayCreated


giveawayWinners ​

Get Signature ​

get giveawayWinners(): GiveawayWinners

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

A giveaway with public winners was completed

Returns ​

GiveawayWinners

Inherited from ​

Message.giveawayWinners


groupChatCreated ​

Get Signature ​

get groupChatCreated(): true

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

Service message: the group has been created

Returns ​

true

Inherited from ​

Message.groupChatCreated


guestBotCallerChat ​

Get Signature ​

get guestBotCallerChat(): Chat

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

Optional. For a message sent by a guest bot, this is the chat whose original message triggered the bot's response

Returns ​

Chat

Inherited from ​

Message.guestBotCallerChat


guestBotCallerUser ​

Get Signature ​

get guestBotCallerUser(): User

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

Optional. For a message sent by a guest bot, this is the user whose original message triggered the bot's response

Returns ​

User

Inherited from ​

Message.guestBotCallerUser


guestQueryId ​

Get Signature ​

get guestQueryId(): string

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

Optional. The unique identifier for the guest query. Use this identifier with the method answerGuestQuery to send a response message. If non-empty, the message belongs to the chat where the guest bot was summoned, which may not coincide with other existing bot chats sharing the same identifier.

Returns ​

string

Inherited from ​

Message.guestQueryId


id ​

Get Signature ​

get id(): number

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

Unique message identifier inside this chat

Returns ​

number

Inherited from ​

Message.id


invoice ​

Get Signature ​

get invoice(): Invoice

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

Message is an invoice for a payment, information about the invoice

Returns ​

Invoice

Inherited from ​

Message.invoice


leftChatMember ​

Get Signature ​

get leftChatMember(): User

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

A member was removed from the group, information about them (this member may be the bot itself)

Returns ​

User

Inherited from ​

Message.leftChatMember


linkPreviewOptions ​

Get Signature ​

get linkPreviewOptions(): LinkPreviewOptions

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

Options used for link preview generation for the message, if it is a text message and link preview options were changed

Returns ​

LinkPreviewOptions

Inherited from ​

Message.linkPreviewOptions


livePhoto ​

Get Signature ​

get livePhoto(): LivePhotoAttachment

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

Message is a live photo, information about the live photo. For backward compatibility, when this field is set, the photo field will also be set

Returns ​

LivePhotoAttachment

Inherited from ​

Message.livePhoto


location ​

Get Signature ​

get location(): Location

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

Message is a shared location, information about the location

Returns ​

Location

Inherited from ​

Message.location


managedBotCreated ​

Get Signature ​

get managedBotCreated(): ManagedBotCreated

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

Service message: user created a bot that will be managed by the current bot

Returns ​

ManagedBotCreated

Inherited from ​

Message.managedBotCreated


mediaGroupId ​

Get Signature ​

get mediaGroupId(): string

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

The unique identifier of a media message group this message belongs to

Returns ​

string

Inherited from ​

Message.mediaGroupId


messageAutoDeleteTimerChanged ​

Get Signature ​

get messageAutoDeleteTimerChanged(): MessageAutoDeleteTimerChanged

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

Service message: auto-delete timer settings changed in the chat

Returns ​

MessageAutoDeleteTimerChanged

Inherited from ​

Message.messageAutoDeleteTimerChanged


migrateFromChatId ​

Get Signature ​

get migrateFromChatId(): number

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

The supergroup has been migrated from a group with the specified identifier. This number may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier.

Returns ​

number

Inherited from ​

Message.migrateFromChatId


migrateToChatId ​

Get Signature ​

get migrateToChatId(): number

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

The group has been migrated to a supergroup with the specified identifier. This number may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier.

Returns ​

number

Inherited from ​

Message.migrateToChatId


newChatMembers ​

Get Signature ​

get newChatMembers(): User[]

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

New members that were added to the group or supergroup and information about them (the bot itself may be one of these members)

Returns ​

User[]

Inherited from ​

Message.newChatMembers


newChatPhoto ​

Get Signature ​

get newChatPhoto(): PhotoSize[]

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

A chat photo was change to this value

Returns ​

PhotoSize[]

Inherited from ​

Message.newChatPhoto


newChatTitle ​

Get Signature ​

get newChatTitle(): string

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

A chat title was changed to this value

Returns ​

string

Inherited from ​

Message.newChatTitle


optionPersistentId ​

Get Signature ​

get optionPersistentId(): string

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

Unique identifier of the added option

Returns ​

string


optionText ​

Get Signature ​

get optionText(): string

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

Option text

Returns ​

string


optionTextEntities ​

Get Signature ​

get optionTextEntities(): MessageEntity[]

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

Optional. Special entities that appear in the optionText

Returns ​

MessageEntity[]


paidStarCount ​

Get Signature ​

get paidStarCount(): number

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

Optional. The number of Telegram Stars that were paid by the sender of the message to send it

Returns ​

number

Inherited from ​

Message.paidStarCount


passportData ​

Get Signature ​

get passportData(): PassportData

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

Telegram Passport data

Returns ​

PassportData

Inherited from ​

Message.passportData


photo ​

Get Signature ​

get photo(): PhotoSize[]

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

Message is a photo, available sizes of the photo

Returns ​

PhotoSize[]

Inherited from ​

Message.photo


pinnedMessage ​

Get Signature ​

get pinnedMessage(): Omit<Message, "replyMessage"> | InaccessibleMessage

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

Specified message was pinned. Note that the Message object in this field will not contain further replyMessage fields even if it is itself a reply.

Returns ​

Omit<Message, "replyMessage"> | InaccessibleMessage

Inherited from ​

Message.pinnedMessage


poll ​

Get Signature ​

get poll(): Poll

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

Message is a native poll, information about the poll

Returns ​

Poll

Inherited from ​

Message.poll


pollMessage ​

Get Signature ​

get pollMessage(): Omit<Message, "replyMessage"> | InaccessibleMessage

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

Optional. Message containing the poll to which the option was added, if known.

Returns ​

Omit<Message, "replyMessage"> | InaccessibleMessage


pollOptionAdded ​

Get Signature ​

get pollOptionAdded(): PollOptionAdded

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

Service message: answer option was added to a poll

Returns ​

PollOptionAdded

Inherited from ​

Message.pollOptionAdded


pollOptionDeleted ​

Get Signature ​

get pollOptionDeleted(): PollOptionDeleted

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

Service message: answer option was deleted from a poll

Returns ​

PollOptionDeleted

Inherited from ​

Message.pollOptionDeleted


proximityAlertTriggered ​

Get Signature ​

get proximityAlertTriggered(): ProximityAlertTriggered

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

Service message. A user in the chat triggered another user's proximity alert while sharing Live Location.

Returns ​

ProximityAlertTriggered

Inherited from ​

Message.proximityAlertTriggered


quote ​

Get Signature ​

get quote(): TextQuote

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

For replies that quote part of the original message, the quoted part of the message

Returns ​

TextQuote

Inherited from ​

Message.quote


receiverUser ​

Get Signature ​

get receiverUser(): User

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

The only user who can see this ephemeral message, along with the bot. Present only for ephemeral messages.

Returns ​

User

Inherited from ​

Message.receiverUser


replyMarkup ​

Get Signature ​

get replyMarkup(): InlineKeyboardMarkup

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

Inline keyboard attached to the message.

login_url buttons are represented as ordinary url buttons.

Returns ​

InlineKeyboardMarkup

Inherited from ​

Message.replyMarkup


replyMessage ​

Get Signature ​

get replyMessage(): Omit<Message, "replyMessage">

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

For replies, the original message

Returns ​

Omit<Message, "replyMessage">

Inherited from ​

Message.replyMessage


replyStory ​

Get Signature ​

get replyStory(): Story

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

For replies to a story, the original story

Returns ​

Story

Inherited from ​

Message.replyStory


replyToChecklistTaskId ​

Get Signature ​

get replyToChecklistTaskId(): number

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

Optional. Identifier of the specific checklist task that is being replied to

Returns ​

number

Inherited from ​

Message.replyToChecklistTaskId


replyToPollOptionId ​

Get Signature ​

get replyToPollOptionId(): string

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

Optional. Persistent identifier of the specific poll option that is being replied to

Returns ​

string

Inherited from ​

Message.replyToPollOptionId


richMessage ​

Get Signature ​

get richMessage(): RichMessage

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

Message is a rich formatted message

Returns ​

RichMessage

Inherited from ​

Message.richMessage


senderBoostCount ​

Get Signature ​

get senderBoostCount(): number

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

If the sender of the message boosted the chat, the number of boosts added by the user

Returns ​

number

Inherited from ​

Message.senderBoostCount


senderBusinessBot ​

Get Signature ​

get senderBusinessBot(): User

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

The bot that actually sent the message on behalf of the business account. Available only for outgoing messages sent on behalf of the connected business account.

Returns ​

User

Inherited from ​

Message.senderBusinessBot


senderChat ​

Get Signature ​

get senderChat(): Chat

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

Sender of the message, sent on behalf of a chat. The channel itself for channel messages. The supergroup itself for messages from anonymous group administrators. The linked channel for messages automatically forwarded to the discussion group

Returns ​

Chat

Inherited from ​

Message.senderChat


senderId ​

Get Signature ​

get senderId(): number

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

Sender's ID

Returns ​

number

Inherited from ​

TargetMixin.senderId


senderTag ​

Get Signature ​

get senderTag(): string

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

Tag or custom title of the sender of the message; for supergroups only

Returns ​

string

Inherited from ​

Message.senderTag


sticker ​

Get Signature ​

get sticker(): StickerAttachment

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

Message is a sticker, information about the sticker

Returns ​

StickerAttachment

Inherited from ​

Message.sticker


story ​

Get Signature ​

get story(): StoryAttachment

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

Message is a forwarded story

Returns ​

StoryAttachment

Inherited from ​

Message.story


successfulPayment ​

Get Signature ​

get successfulPayment(): SuccessfulPayment

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

Message is a service message about a successful payment, information about the payment.

Returns ​

SuccessfulPayment

Inherited from ​

Message.successfulPayment


suggestedPostApprovalFailed ​

Get Signature ​

get suggestedPostApprovalFailed(): SuggestedPostApprovalFailed

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

Service message: approval of a suggested post has failed

Returns ​

SuggestedPostApprovalFailed

Inherited from ​

Message.suggestedPostApprovalFailed


suggestedPostApproved ​

Get Signature ​

get suggestedPostApproved(): SuggestedPostApproved

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

Service message: a suggested post was approved

Returns ​

SuggestedPostApproved

Inherited from ​

Message.suggestedPostApproved


suggestedPostDeclined ​

Get Signature ​

get suggestedPostDeclined(): SuggestedPostDeclined

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

Service message: a suggested post was declined

Returns ​

SuggestedPostDeclined

Inherited from ​

Message.suggestedPostDeclined


suggestedPostInfo ​

Get Signature ​

get suggestedPostInfo(): SuggestedPostInfo

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

Optional. Information about suggested post parameters if the message is a suggested post

Returns ​

SuggestedPostInfo

Inherited from ​

Message.suggestedPostInfo


suggestedPostPaid ​

Get Signature ​

get suggestedPostPaid(): SuggestedPostPaid

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

Service message: payment for a suggested post was received

Returns ​

SuggestedPostPaid

Inherited from ​

Message.suggestedPostPaid


suggestedPostRefunded ​

Get Signature ​

get suggestedPostRefunded(): SuggestedPostRefunded

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

Service message: payment for a suggested post was refunded

Returns ​

SuggestedPostRefunded

Inherited from ​

Message.suggestedPostRefunded


supergroupChatCreated ​

Get Signature ​

get supergroupChatCreated(): true

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

Service message: the supergroup has been created. This field can't be received in a message coming through updates, because bot can't be a member of a supergroup when it is created. It can only be found in replyMessage if someone replies to a very first message in a directly created supergroup.

Returns ​

true

Inherited from ​

Message.supergroupChatCreated


text ​

Get Signature ​

get text(): string

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

For text messages, the actual UTF-8 text of the message, 0-4096 characters.

Falls back to the flattened rich message text when the message has no plain text, so text-based handlers keep working on rich messages.

Returns ​

string

Inherited from ​

Message.text


threadId ​

Get Signature ​

get threadId(): number

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

Unique identifier of a message thread to which the message belongs; for supergroups only

Returns ​

number

Inherited from ​

Message.threadId


uniqueGift ​

Get Signature ​

get uniqueGift(): UniqueGiftInfo

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

Service message: a unique gift was sent to the chat

Returns ​

UniqueGiftInfo

Inherited from ​

Message.uniqueGift


updatedAt ​

Get Signature ​

get updatedAt(): number

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

Date the message was last edited in Unix time

Returns ​

number

Inherited from ​

Message.updatedAt


usersShared ​

Get Signature ​

get usersShared(): UsersShared

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

Service message: a user was shared with the bot

Returns ​

UsersShared

Inherited from ​

Message.usersShared


venue ​

Get Signature ​

get venue(): Venue

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

Message is a venue, information about the venue. For backward compatibility, when this field is set, the location field will also be set

Returns ​

Venue

Inherited from ​

Message.venue


viaBot ​

Get Signature ​

get viaBot(): User

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

Bot through which the message was sent

Returns ​

User

Inherited from ​

Message.viaBot


video ​

Get Signature ​

get video(): VideoAttachment

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

Message is a video, information about the video

Returns ​

VideoAttachment

Inherited from ​

Message.video


videoChatEnded ​

Get Signature ​

get videoChatEnded(): VideoChatEnded

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

Service message: video chat ended

Returns ​

VideoChatEnded

Inherited from ​

Message.videoChatEnded


videoChatParticipantsInvited ​

Get Signature ​

get videoChatParticipantsInvited(): VideoChatParticipantsInvited

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

Service message: new participants invited to a video chat

Returns ​

VideoChatParticipantsInvited

Inherited from ​

Message.videoChatParticipantsInvited


videoChatScheduled ​

Get Signature ​

get videoChatScheduled(): VideoChatScheduled

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

Service message: video chat scheduled

Returns ​

VideoChatScheduled

Inherited from ​

Message.videoChatScheduled


videoChatStarted ​

Get Signature ​

get videoChatStarted(): VideoChatStarted

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

Service message: video chat started

Returns ​

VideoChatStarted

Inherited from ​

Message.videoChatStarted


videoNote ​

Get Signature ​

get videoNote(): VideoNoteAttachment

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

Message is a video note, information about the video message

Returns ​

VideoNoteAttachment

Inherited from ​

Message.videoNote


voice ​

Get Signature ​

get voice(): VoiceAttachment

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

Message is a voice message, information about the file

Returns ​

VoiceAttachment

Inherited from ​

Message.voice


webAppData ​

Get Signature ​

get webAppData(): WebAppData

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

Service message: data sent by a Web App

Returns ​

WebAppData

Inherited from ​

Message.webAppData


writeAccessAllowed ​

Get Signature ​

get writeAccessAllowed(): WriteAccessAllowed

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

Service message: the user allowed the bot added to the attachment menu to write messages

Returns ​

WriteAccessAllowed

Inherited from ​

Message.writeAccessAllowed

Methods ​

clearReactions() ​

clearReactions(params?): Promise<true>

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

Clears reactions from the message

Parameters ​

ParameterType
params?Optional<SetMessageReactionParams, "chat_id" | "message_id">

Returns ​

Promise<true>

Inherited from ​

NodeMixin.clearReactions


clone() ​

clone(options?): PollOptionAddedContext

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

Parameters ​

ParameterType
options?PollOptionAddedContextOptions

Returns ​

PollOptionAddedContext

Inherited from ​

CloneMixin.clone


copy() ​

copy(params?): Promise<MessageId>

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

Copies current message [into other chat if chatId is provided]

Parameters ​

ParameterType
params?Optional<CopyMessageParams, "chat_id" | "message_id" | "from_chat_id">

Returns ​

Promise<MessageId>

Inherited from ​

NodeMixin.copy


copyMessages() ​

copyMessages(chatId, ids, params?): Promise<MessageId[]>

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

Copies messages from current chat and sends to another

Parameters ​

ParameterType
chatIdstring | number
idsnumber[]
params?Optional<CopyMessagesParams, "chat_id" | "message_ids" | "from_chat_id">

Returns ​

Promise<MessageId[]>

Inherited from ​

NodeMixin.copyMessages


createActionController() ​

createActionController(action, params?): ChatActionController<Bot>

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

Parameters ​

ParameterType
actionSendChatActionAction
params?Pick<SendChatActionParams, "business_connection_id" | "message_thread_id"> & object & CreateActionControllerParams

Returns ​

ChatActionController<Bot>

Deprecated ​

Creates a controller that when start()ed executes sendChatAction(action) every interval milliseconds until stop()ped

Inherited from ​

ChatActionMixin.createActionController


delete() ​

delete(params?): Promise<true>

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

Deletes current message

Parameters ​

ParameterType
params?Optional<DeleteMessageParams, "chat_id" | "message_id">

Returns ​

Promise<true>

Inherited from ​

NodeMixin.delete


deleteAllReactions() ​

deleteAllReactions(params?): Promise<true>

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

Removes up to 10000 recent reactions in current chat added by a given user or chat

Parameters ​

ParameterType
params?Optional<DeleteAllMessageReactionsParams, "chat_id">

Returns ​

Promise<true>

Inherited from ​

NodeMixin.deleteAllReactions


deleteMessages() ​

deleteMessages(ids): Promise<true>

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

Deletes messages in current chat

Parameters ​

ParameterType
idsnumber[]

Returns ​

Promise<true>

Inherited from ​

NodeMixin.deleteMessages


deleteReaction() ​

deleteReaction(params?): Promise<true>

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

Removes a reaction from current message

Parameters ​

ParameterType
params?Optional<DeleteMessageReactionParams, "chat_id" | "message_id">

Returns ​

Promise<true>

Inherited from ​

NodeMixin.deleteReaction


editCaption() ​

editCaption(caption, params?): Promise<true | MessageContext<Bot>>

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

Edits current message caption. An alias for editMessageCaption

Parameters ​

ParameterType
captionNonNullable<string | { toString: string; }>
params?Partial<EditMessageCaptionParams>

Returns ​

Promise<true | MessageContext<Bot>>

Inherited from ​

NodeMixin.editCaption


editChecklist() ​

editChecklist(checklist, params?): Promise<MessageContext<Bot>>

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

Parameters ​

ParameterType
checklistTelegramInputChecklist
params?Partial<EditMessageChecklistParams>

Returns ​

Promise<MessageContext<Bot>>

Inherited from ​

NodeMixin.editChecklist


editLiveLocation() ​

editLiveLocation(params): Promise<true | MessageContext<Bot>>

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

Edits current message live location. An alias for editMessageLiveLocation

Parameters ​

ParameterType
paramsEditMessageLiveLocationParams

Returns ​

Promise<true | MessageContext<Bot>>

Inherited from ​

NodeMixin.editLiveLocation


editMedia() ​

editMedia(media, params?): Promise<true | MessageContext<Bot>>

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

Edits current message media. An alias for editMessageMedia

Parameters ​

ParameterType
mediaTelegramInputMedia
params?Partial<EditMessageMediaParams>

Returns ​

Promise<true | MessageContext<Bot>>

Inherited from ​

NodeMixin.editMedia


editMessageCaption() ​

editMessageCaption(caption, params?): Promise<true | MessageContext<Bot>>

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

Edits current message caption

Parameters ​

ParameterType
captionNonNullable<string | { toString: string; }>
params?Partial<EditMessageCaptionParams>

Returns ​

Promise<true | MessageContext<Bot>>

Inherited from ​

NodeMixin.editMessageCaption


editMessageLiveLocation() ​

editMessageLiveLocation(params): Promise<true | MessageContext<Bot>>

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

Edits current message live location

Parameters ​

ParameterType
paramsEditMessageLiveLocationParams

Returns ​

Promise<true | MessageContext<Bot>>

Inherited from ​

NodeMixin.editMessageLiveLocation


editMessageMedia() ​

editMessageMedia(media, params?): Promise<true | MessageContext<Bot>>

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

Edits current message media

Parameters ​

ParameterType
mediaTelegramInputMedia
params?Partial<EditMessageMediaParams>

Returns ​

Promise<true | MessageContext<Bot>>

Inherited from ​

NodeMixin.editMessageMedia


editMessageReplyMarkup() ​

editMessageReplyMarkup(replyMarkup, params?): Promise<true | MessageContext<Bot>>

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

Edits current message reply markup

Parameters ​

ParameterType
replyMarkupTelegramInlineKeyboardMarkup | { toJSON: TelegramInlineKeyboardMarkup; }
params?Partial<EditMessageReplyMarkupParams>

Returns ​

Promise<true | MessageContext<Bot>>

Inherited from ​

NodeMixin.editMessageReplyMarkup


editMessageText() ​

editMessageText(text, params?): Promise<true | MessageContext<Bot>>

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

Edits current message text

Parameters ​

ParameterType
textstring | { toString: string; } | RichStringLike
params?Partial<EditMessageTextParams>

Returns ​

Promise<true | MessageContext<Bot>>

Inherited from ​

NodeMixin.editMessageText


editReplyMarkup() ​

editReplyMarkup(replyMarkup, params?): Promise<true | MessageContext<Bot>>

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

Edits current message reply markup. An alias for editMessageReplyMarkup

Parameters ​

ParameterType
replyMarkupTelegramInlineKeyboardMarkup | { toJSON: TelegramInlineKeyboardMarkup; }
params?Partial<EditMessageReplyMarkupParams>

Returns ​

Promise<true | MessageContext<Bot>>

Inherited from ​

NodeMixin.editReplyMarkup


editText() ​

editText(text, params?): Promise<true | MessageContext<Bot>>

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

Edits current message text. An alias for editMessageText

Parameters ​

ParameterType
textstring | { toString: string; } | RichStringLike
params?Partial<EditMessageTextParams>

Returns ​

Promise<true | MessageContext<Bot>>

Inherited from ​

NodeMixin.editText


forward() ​

forward(params?): Promise<MessageContext<Bot>>

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

Forwards current message [into other chat if chatId is provided]

Parameters ​

ParameterType
params?Optional<ForwardMessageParams, "chat_id" | "message_id" | "from_chat_id">

Returns ​

Promise<MessageContext<Bot>>

Inherited from ​

NodeMixin.forward


forwardMessages() ​

forwardMessages(chatId, ids, params?): Promise<MessageId[]>

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

Forwards messages from current chat to another

Parameters ​

ParameterType
chatIdstring | number
idsnumber[]
params?Optional<ForwardMessagesParams, "chat_id" | "message_ids" | "from_chat_id">

Returns ​

Promise<MessageId[]>

Inherited from ​

NodeMixin.forwardMessages


getChatBoosts() ​

getChatBoosts(userId): Promise<TelegramUserChatBoosts>

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

Returns chat boosts by the user

Parameters ​

ParameterType
userIdnumber

Returns ​

Promise<TelegramUserChatBoosts>

Inherited from ​

SendMixin.getChatBoosts


hasFrom() ​

hasFrom(): this is Require<PollOptionAddedContext<Bot>, "from" | "senderId">

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

Checks if the instance has from and senderId properties

Returns ​

this is Require<PollOptionAddedContext<Bot>, "from" | "senderId">

Inherited from ​

TargetMixin.hasFrom


hasMediaSpoiler() ​

hasMediaSpoiler(): true

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

true, if the message media is covered by a spoiler animation

Returns ​

true

Inherited from ​

Message.hasMediaSpoiler


hasProtectedContent() ​

hasProtectedContent(): true

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

true, if the message can't be forwarded

Returns ​

true

Inherited from ​

Message.hasProtectedContent


hasSenderChat() ​

hasSenderChat(): this is Require<PollOptionAddedContext<Bot>, "senderChat">

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

Checks if the instance has senderChat property

Returns ​

this is Require<PollOptionAddedContext<Bot>, "senderChat">

Inherited from ​

TargetMixin.hasSenderChat


is() ​

is<T>(rawTypes): this is InstanceType<ContextsMapping<Bot>[T]> & GetDerives<Bot, T> & (IsAny<Bot["__Derives"]> extends true ? {} : Bot["__Derives"] extends {} ? Bot["__Derives"]["global"] & Bot["__Derives"][T] : {})

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

Type Parameters ​

Type Parameter
T extends UpdateName

Parameters ​

ParameterType
rawTypesMaybeArray<SoftString<T>>

Returns ​

this is InstanceType<ContextsMapping<Bot>[T]> & GetDerives<Bot, T> & (IsAny<Bot["__Derives"]> extends true ? {} : Bot["__Derives"] extends {} ? Bot["__Derives"]["global"] & Bot["__Derives"][T] : {})

Inherited from ​

Context.is


isAutomaticForward() ​

isAutomaticForward(): true

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

true, if the message is a channel post that was automatically forwarded to the connected discussion group

Returns ​

true

Inherited from ​

Message.isAutomaticForward


isChannel() ​

isChannel(): this is RequireValue<PollOptionAddedContext<Bot>, "chatType", Channel>

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

Is this chat a channel?

Returns ​

this is RequireValue<PollOptionAddedContext<Bot>, "chatType", Channel>

Inherited from ​

TargetMixin.isChannel


isFromOffline() ​

isFromOffline(): true

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

true, True, if the message was sent by an implicit action, for example, as an away or a greeting business message, or as a scheduled message

Returns ​

true

Inherited from ​

Message.isFromOffline


isGroup() ​

isGroup(): this is RequireValue<PollOptionAddedContext<Bot>, "chatType", Group>

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

Is this chat a group?

Returns ​

this is RequireValue<PollOptionAddedContext<Bot>, "chatType", Group>

Inherited from ​

TargetMixin.isGroup


isPaidPost() ​

isPaidPost(): true

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

Optional. True, if the message is a paid post

Returns ​

true

Inherited from ​

Message.isPaidPost


isPM() ​

isPM(): this is RequireValue<PollOptionAddedContext<Bot>, "chatType", Private>

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

Is this chat a private one?

Returns ​

this is RequireValue<PollOptionAddedContext<Bot>, "chatType", Private>

Inherited from ​

TargetMixin.isPM


isShowCaptionAboveMedia() ​

isShowCaptionAboveMedia(): boolean

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

True, if the caption must be shown above the message media

Returns ​

boolean

Inherited from ​

Message.isShowCaptionAboveMedia


isSupergroup() ​

isSupergroup(): this is RequireValue<PollOptionAddedContext<Bot>, "chatType", Supergroup>

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

Is this chat a supergroup?

Returns ​

this is RequireValue<PollOptionAddedContext<Bot>, "chatType", Supergroup>

Inherited from ​

TargetMixin.isSupergroup


isTopicMessage() ​

isTopicMessage(): boolean

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

true, if the message is sent to a forum topic

Returns ​

boolean

Inherited from ​

Message.isTopicMessage


pinChatMessage() ​

pinChatMessage(params?): Promise<true>

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

Adds message to the list of pinned messages

Parameters ​

ParameterType
params?Optional<PinChatMessageParams, "chat_id" | "message_id">

Returns ​

Promise<true>

Inherited from ​

PinsMixin.pinChatMessage


quoteWithAnimation() ​

quoteWithAnimation(params): Promise<MessageContext<Bot>>

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

Replies to current message with a quote and an animation

Parameters ​

ParameterType
paramsobject & object & Pick<SendAnimationParams, "caption" | "business_connection_id" | "message_thread_id" | "direct_messages_topic_id" | "ephemeral_message_parameters" | "parse_mode" | "disable_notification" | "protect_content" | "allow_paid_broadcast" | "message_effect_id" | "suggested_post_parameters" | "reply_parameters" | "reply_markup" | "caption_entities" | "show_caption_above_media" | "has_spoiler" | "thumbnail" | "duration" | "width" | "height"> & object & object

Returns ​

Promise<MessageContext<Bot>>

Inherited from ​

NodeMixin.quoteWithAnimation


quoteWithAudio() ​

quoteWithAudio(params): Promise<MessageContext<Bot>>

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

Replies to current message with a quote and an audio

Parameters ​

ParameterType
paramsobject & object & Pick<SendAudioParams, "caption" | "title" | "business_connection_id" | "message_thread_id" | "direct_messages_topic_id" | "ephemeral_message_parameters" | "parse_mode" | "disable_notification" | "protect_content" | "allow_paid_broadcast" | "message_effect_id" | "suggested_post_parameters" | "reply_parameters" | "reply_markup" | "caption_entities" | "thumbnail" | "duration" | "performer"> & object & object

Returns ​

Promise<MessageContext<Bot>>

Inherited from ​

NodeMixin.quoteWithAudio


quoteWithContact() ​

quoteWithContact(params): Promise<MessageContext<Bot>>

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

Replies to current message with a quote and a contact

Parameters ​

ParameterType
paramsobject & Pick<SendContactParams, "phone_number" | "business_connection_id" | "message_thread_id" | "direct_messages_topic_id" | "ephemeral_message_parameters" | "disable_notification" | "protect_content" | "allow_paid_broadcast" | "message_effect_id" | "suggested_post_parameters" | "reply_parameters" | "reply_markup" | "first_name" | "last_name" | "vcard"> & object & object

Returns ​

Promise<MessageContext<Bot>>

Inherited from ​

NodeMixin.quoteWithContact


quoteWithDice() ​

quoteWithDice(params): Promise<MessageContext<Bot>>

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

Replies to current message with a quote and a dice

Parameters ​

ParameterType
paramsobject & object & Partial<SendDiceParams> & object

Returns ​

Promise<MessageContext<Bot>>

Inherited from ​

NodeMixin.quoteWithDice


quoteWithDocument() ​

quoteWithDocument(params): Promise<MessageContext<Bot>>

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

Replies to current message with a quote and a document

Parameters ​

ParameterType
paramsobject & object & Pick<SendDocumentParams, "caption" | "business_connection_id" | "message_thread_id" | "direct_messages_topic_id" | "ephemeral_message_parameters" | "parse_mode" | "disable_notification" | "protect_content" | "allow_paid_broadcast" | "message_effect_id" | "suggested_post_parameters" | "reply_parameters" | "reply_markup" | "caption_entities" | "thumbnail" | "disable_content_type_detection"> & object & object

Returns ​

Promise<MessageContext<Bot>>

Inherited from ​

NodeMixin.quoteWithDocument


quoteWithInvoice() ​

quoteWithInvoice(params): Promise<MessageContext<Bot>>

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

Replies to current message with a quote and an invoice

Parameters ​

ParameterType
paramsobject & Pick<SendInvoiceParams, "payload" | "currency" | "description" | "title" | "message_thread_id" | "direct_messages_topic_id" | "disable_notification" | "protect_content" | "allow_paid_broadcast" | "message_effect_id" | "suggested_post_parameters" | "reply_parameters" | "reply_markup" | "provider_token" | "prices" | "max_tip_amount" | "suggested_tip_amounts" | "start_parameter" | "provider_data" | "photo_url" | "photo_size" | "photo_width" | "photo_height" | "need_name" | "need_phone_number" | "need_email" | "need_shipping_address" | "send_phone_number_to_provider" | "send_email_to_provider" | "is_flexible"> & object & object

Returns ​

Promise<MessageContext<Bot>>

Inherited from ​

NodeMixin.quoteWithInvoice


quoteWithLocation() ​

quoteWithLocation(params): Promise<MessageContext<Bot>>

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

Replies to current message with a quote and a location

Parameters ​

ParameterType
paramsobject & object & Pick<SendLocationParams, "heading" | "business_connection_id" | "message_thread_id" | "direct_messages_topic_id" | "ephemeral_message_parameters" | "disable_notification" | "protect_content" | "allow_paid_broadcast" | "message_effect_id" | "suggested_post_parameters" | "reply_parameters" | "reply_markup" | "horizontal_accuracy" | "live_period" | "proximity_alert_radius"> & object & object

Returns ​

Promise<MessageContext<Bot>>

Inherited from ​

NodeMixin.quoteWithLocation


quoteWithMediaGroup() ​

quoteWithMediaGroup(params): Promise<MessageContext<Bot>[]>

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

Replies to current message with a quote and a media group

Parameters ​

ParameterType
paramsobject & object & Pick<SendMediaGroupParams, "business_connection_id" | "message_thread_id" | "direct_messages_topic_id" | "disable_notification" | "protect_content" | "allow_paid_broadcast" | "message_effect_id" | "reply_parameters"> & object & object

Returns ​

Promise<MessageContext<Bot>[]>

Inherited from ​

NodeMixin.quoteWithMediaGroup


quoteWithPhoto() ​

quoteWithPhoto(params): Promise<MessageContext<Bot>>

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

Replies to current message with a quote and a photo

Parameters ​

ParameterType
paramsobject & object & Pick<SendPhotoParams, "caption" | "business_connection_id" | "message_thread_id" | "direct_messages_topic_id" | "ephemeral_message_parameters" | "parse_mode" | "disable_notification" | "protect_content" | "allow_paid_broadcast" | "message_effect_id" | "suggested_post_parameters" | "reply_parameters" | "reply_markup" | "caption_entities" | "show_caption_above_media" | "has_spoiler"> & object & object

Returns ​

Promise<MessageContext<Bot>>

Inherited from ​

NodeMixin.quoteWithPhoto


quoteWithPoll() ​

quoteWithPoll(params): Promise<MessageContext<Bot>>

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

Replies to current message with a quote and a poll

Parameters ​

ParameterType
paramsobject & Pick<SendPollParams, "question" | "options" | "type" | "explanation" | "description" | "media" | "business_connection_id" | "message_thread_id" | "disable_notification" | "protect_content" | "allow_paid_broadcast" | "message_effect_id" | "reply_parameters" | "reply_markup" | "question_parse_mode" | "question_entities" | "is_anonymous" | "allows_multiple_answers" | "allows_revoting" | "shuffle_options" | "allow_adding_options" | "hide_results_until_closes" | "members_only" | "country_codes" | "correct_option_ids" | "explanation_parse_mode" | "explanation_entities" | "explanation_media" | "open_period" | "close_date" | "is_closed" | "description_parse_mode" | "description_entities"> & object & object

Returns ​

Promise<MessageContext<Bot>>

Inherited from ​

NodeMixin.quoteWithPoll


quoteWithSticker() ​

quoteWithSticker(params): Promise<MessageContext<Bot>>

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

Replies to current message with a quote and a sticker

Parameters ​

ParameterType
paramsobject & object & Pick<SendStickerParams, "emoji" | "business_connection_id" | "message_thread_id" | "direct_messages_topic_id" | "ephemeral_message_parameters" | "disable_notification" | "protect_content" | "allow_paid_broadcast" | "message_effect_id" | "suggested_post_parameters" | "reply_parameters" | "reply_markup"> & object & object

Returns ​

Promise<MessageContext<Bot>>

Inherited from ​

NodeMixin.quoteWithSticker


quoteWithVenue() ​

quoteWithVenue(params): Promise<MessageContext<Bot>>

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

Replies to current message with a quote and a venue

Parameters ​

ParameterType
paramsobject & Pick<SendVenueParams, "title" | "address" | "business_connection_id" | "message_thread_id" | "direct_messages_topic_id" | "ephemeral_message_parameters" | "disable_notification" | "protect_content" | "allow_paid_broadcast" | "message_effect_id" | "suggested_post_parameters" | "reply_parameters" | "reply_markup" | "latitude" | "longitude" | "foursquare_id" | "foursquare_type" | "google_place_id" | "google_place_type"> & object & object

Returns ​

Promise<MessageContext<Bot>>

Inherited from ​

NodeMixin.quoteWithVenue


quoteWithVideo() ​

quoteWithVideo(params): Promise<MessageContext<Bot>>

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

Replies to current message with a quote and a video

Parameters ​

ParameterType
paramsobject & object & Pick<SendVideoParams, "caption" | "business_connection_id" | "message_thread_id" | "direct_messages_topic_id" | "ephemeral_message_parameters" | "parse_mode" | "disable_notification" | "protect_content" | "allow_paid_broadcast" | "message_effect_id" | "suggested_post_parameters" | "reply_parameters" | "reply_markup" | "caption_entities" | "show_caption_above_media" | "has_spoiler" | "thumbnail" | "duration" | "width" | "height" | "cover" | "start_timestamp" | "supports_streaming"> & object & object

Returns ​

Promise<MessageContext<Bot>>

Inherited from ​

NodeMixin.quoteWithVideo


quoteWithVideoNote() ​

quoteWithVideoNote(params): Promise<MessageContext<Bot>>

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

Replies to current message with a quote and a video note

Parameters ​

ParameterType
paramsobject & object & Pick<SendVideoNoteParams, "length" | "business_connection_id" | "message_thread_id" | "direct_messages_topic_id" | "ephemeral_message_parameters" | "disable_notification" | "protect_content" | "allow_paid_broadcast" | "message_effect_id" | "suggested_post_parameters" | "reply_parameters" | "reply_markup" | "thumbnail" | "duration"> & object & object

Returns ​

Promise<MessageContext<Bot>>

Inherited from ​

NodeMixin.quoteWithVideoNote


quoteWithVoice() ​

quoteWithVoice(params): Promise<MessageContext<Bot>>

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

Replies to current message with a quote and a voice

Parameters ​

ParameterType
paramsobject & object & Pick<SendVoiceParams, "caption" | "business_connection_id" | "message_thread_id" | "direct_messages_topic_id" | "ephemeral_message_parameters" | "parse_mode" | "disable_notification" | "protect_content" | "allow_paid_broadcast" | "message_effect_id" | "suggested_post_parameters" | "reply_parameters" | "reply_markup" | "caption_entities" | "duration"> & object & object

Returns ​

Promise<MessageContext<Bot>>

Inherited from ​

NodeMixin.quoteWithVoice


react() ​

react(rawReactions, params?): Promise<true>

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

Reacts to a message

Parameters ​

ParameterType
rawReactionsMaybeArray<TelegramReactionTypeEmojiEmoji | TelegramReactionType>
params?Optional<SetMessageReactionParams, "chat_id" | "message_id">

Returns ​

Promise<true>

Inherited from ​

NodeMixin.react


reply() ​

reply(text, params?): Promise<MessageContext<Bot>>

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

Replies to current message

Parameters ​

ParameterType
textstring | { toString: string; } | RichStringLike
params?WithPartialReplyParameters<Optional<SendMessageParams, "text" | "chat_id">>

Returns ​

Promise<MessageContext<Bot>>

Inherited from ​

NodeMixin.reply


replyWithAnimation() ​

replyWithAnimation(animation, params?): Promise<MessageContext<Bot>>

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

Replies to current message with animation

Parameters ​

ParameterType
animationstring | Blob
params?WithPartialReplyParameters<Optional<SendAnimationParams, "animation" | "chat_id">>

Returns ​

Promise<MessageContext<Bot>>

Inherited from ​

NodeMixin.replyWithAnimation


replyWithAudio() ​

replyWithAudio(audio, params?): Promise<MessageContext<Bot>>

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

Replies to current message with audio

Parameters ​

ParameterType
audiostring | Blob
params?WithPartialReplyParameters<Optional<SendAudioParams, "audio" | "chat_id">>

Returns ​

Promise<MessageContext<Bot>>

Inherited from ​

NodeMixin.replyWithAudio


replyWithContact() ​

replyWithContact(params): Promise<MessageContext<Bot>>

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

Replies to current message with contact

Parameters ​

ParameterType
paramsWithPartialReplyParameters<Optional<SendContactParams, "chat_id">>

Returns ​

Promise<MessageContext<Bot>>

Inherited from ​

NodeMixin.replyWithContact


replyWithDice() ​

replyWithDice(emoji, params?): Promise<MessageContext<Bot>>

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

Replies to current message with a dice

Parameters ​

ParameterType
emojiSendDiceEmoji
params?WithPartialReplyParameters<Partial<SendDiceParams>>

Returns ​

Promise<MessageContext<Bot>>

Inherited from ​

NodeMixin.replyWithDice


replyWithDocument() ​

replyWithDocument(document, params?): Promise<MessageContext<Bot>>

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

Replies to current message with document

Parameters ​

ParameterType
documentstring | Blob
params?WithPartialReplyParameters<Optional<SendDocumentParams, "document" | "chat_id">>

Returns ​

Promise<MessageContext<Bot>>

Inherited from ​

NodeMixin.replyWithDocument


replyWithInvoice() ​

replyWithInvoice(params): Promise<MessageContext<Bot>>

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

Replies to current message with invoice

Parameters ​

ParameterType
paramsWithPartialReplyParameters<Optional<SendInvoiceParams, "chat_id">>

Returns ​

Promise<MessageContext<Bot>>

Inherited from ​

NodeMixin.replyWithInvoice


replyWithLocation() ​

replyWithLocation(latitude, longitude, params?): Promise<MessageContext<Bot>>

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

Replies to current message with location

Parameters ​

ParameterType
latitudenumber
longitudenumber
params?WithPartialReplyParameters<Optional<SendLocationParams, "chat_id" | "latitude" | "longitude">>

Returns ​

Promise<MessageContext<Bot>>

Inherited from ​

NodeMixin.replyWithLocation


replyWithMediaGroup() ​

replyWithMediaGroup(mediaGroup, params?): Promise<MessageContext<Bot>[]>

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

Replies to current message with media group

Parameters ​

ParameterType
mediaGroup(TelegramInputMediaAudio | TelegramInputMediaDocument | TelegramInputMediaLivePhoto | TelegramInputMediaPhoto | TelegramInputMediaVideo)[]
params?WithPartialReplyParameters<Optional<SendMediaGroupParams, "media" | "chat_id">>

Returns ​

Promise<MessageContext<Bot>[]>

Inherited from ​

NodeMixin.replyWithMediaGroup


replyWithPhoto() ​

replyWithPhoto(photo, params?): Promise<MessageContext<Bot>>

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

Replies to current message with photo

Parameters ​

ParameterType
photostring | Blob
params?WithPartialReplyParameters<Optional<SendPhotoParams, "photo" | "chat_id">>

Returns ​

Promise<MessageContext<Bot>>

Inherited from ​

NodeMixin.replyWithPhoto


replyWithPoll() ​

replyWithPoll(params): Promise<MessageContext<Bot>>

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

Replies to current message with poll

Parameters ​

ParameterType
paramsWithPartialReplyParameters<Optional<SendPollParams, "chat_id">>

Returns ​

Promise<MessageContext<Bot>>

Inherited from ​

NodeMixin.replyWithPoll


replyWithQuote() ​

replyWithQuote(params): Promise<MessageContext<Bot>>

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

Replies to current message with a quote

Parameters ​

ParameterType
paramsobject & object & Pick<SendMessageParams, "entities" | "business_connection_id" | "message_thread_id" | "direct_messages_topic_id" | "ephemeral_message_parameters" | "parse_mode" | "link_preview_options" | "disable_notification" | "protect_content" | "allow_paid_broadcast" | "message_effect_id" | "suggested_post_parameters" | "reply_parameters" | "reply_markup"> & object & object

Returns ​

Promise<MessageContext<Bot>>

Inherited from ​

NodeMixin.replyWithQuote


replyWithSticker() ​

replyWithSticker(sticker, params?): Promise<MessageContext<Bot>>

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

Replies to current message with sticker

Parameters ​

ParameterType
stickerstring | Blob
params?WithPartialReplyParameters<Optional<SendStickerParams, "sticker" | "chat_id">>

Returns ​

Promise<MessageContext<Bot>>

Inherited from ​

NodeMixin.replyWithSticker


replyWithVenue() ​

replyWithVenue(params): Promise<MessageContext<Bot>>

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

Replies to current message with venue

Parameters ​

ParameterType
paramsWithPartialReplyParameters<Optional<SendVenueParams, "chat_id">>

Returns ​

Promise<MessageContext<Bot>>

Inherited from ​

NodeMixin.replyWithVenue


replyWithVideo() ​

replyWithVideo(video, params?): Promise<MessageContext<Bot>>

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

Replies to current message with video

Parameters ​

ParameterType
videostring | Blob
params?WithPartialReplyParameters<Optional<SendVideoParams, "video" | "chat_id">>

Returns ​

Promise<MessageContext<Bot>>

Inherited from ​

NodeMixin.replyWithVideo


replyWithVideoNote() ​

replyWithVideoNote(videoNote, params?): Promise<MessageContext<Bot>>

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

Replies to current message with video note

Parameters ​

ParameterType
videoNotestring | Blob
params?WithPartialReplyParameters<Optional<SendVideoNoteParams, "video_note" | "chat_id">>

Returns ​

Promise<MessageContext<Bot>>

Inherited from ​

NodeMixin.replyWithVideoNote


replyWithVoice() ​

replyWithVoice(voice, params?): Promise<MessageContext<Bot>>

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

Replies to current message with voice

Parameters ​

ParameterType
voicestring | Blob
params?WithPartialReplyParameters<Optional<SendVoiceParams, "voice" | "chat_id">>

Returns ​

Promise<MessageContext<Bot>>

Inherited from ​

NodeMixin.replyWithVoice


send() ​

send(text, params?): Promise<MessageContext<Bot>>

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

Sends message to current chat.

Pass a branded @gramio/format rich value (Markdown RichString or a native structured block/message from @gramio/format/rich) and it is sent via sendRichMessage instead — bot.api.* stays 1:1; the method is chosen here.

Parameters ​

ParameterType
textstring | { toString: string; } | RichStringLike
params?Optional<SendMessageParams, "text" | "chat_id">

Returns ​

Promise<MessageContext<Bot>>

Inherited from ​

SendMixin.send


sendAnimation() ​

sendAnimation(animation, params?): Promise<MessageContext<Bot>>

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

Sends animation to current chat

Parameters ​

ParameterType
animationstring | Blob
params?Optional<SendAnimationParams, "animation" | "chat_id">

Returns ​

Promise<MessageContext<Bot>>

Inherited from ​

SendMixin.sendAnimation


sendAudio() ​

sendAudio(audio, params?): Promise<MessageContext<Bot>>

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

Sends audio to current chat

Parameters ​

ParameterType
audiostring | Blob
params?Optional<SendAudioParams, "audio" | "chat_id">

Returns ​

Promise<MessageContext<Bot>>

Inherited from ​

SendMixin.sendAudio


sendChatAction() ​

sendChatAction(action, params?): Promise<true>

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

Sends chat action to current chat

Parameters ​

ParameterType
actionSendChatActionAction
params?Optional<SendChatActionParams, "chat_id" | "action">

Returns ​

Promise<true>

Inherited from ​

SendMixin.sendChatAction


sendChecklist() ​

sendChecklist(params): Promise<MessageContext<Bot>>

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

Sends checklist to current chat

Parameters ​

ParameterType
paramsOptional<SendChecklistParams, "chat_id">

Returns ​

Promise<MessageContext<Bot>>

Inherited from ​

SendMixin.sendChecklist


sendContact() ​

sendContact(params): Promise<MessageContext<Bot>>

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

Sends contact to current chat

Parameters ​

ParameterType
paramsOptional<SendContactParams, "chat_id">

Returns ​

Promise<MessageContext<Bot>>

Inherited from ​

SendMixin.sendContact


sendDice() ​

sendDice(emoji, params?): Promise<MessageContext<Bot>>

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

Sends dice

Parameters ​

ParameterType
emojiSendDiceEmoji
params?Partial<SendDiceParams>

Returns ​

Promise<MessageContext<Bot>>

Inherited from ​

SendMixin.sendDice


sendDocument() ​

sendDocument(document, params?): Promise<MessageContext<Bot>>

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

Sends document to current chat

Parameters ​

ParameterType
documentstring | Blob
params?Optional<SendDocumentParams, "document" | "chat_id">

Returns ​

Promise<MessageContext<Bot>>

Inherited from ​

SendMixin.sendDocument


sendInvoice() ​

sendInvoice(params): Promise<MessageContext<Bot>>

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

Sends invoice to current user

Parameters ​

ParameterType
paramsOptional<SendInvoiceParams, "chat_id">

Returns ​

Promise<MessageContext<Bot>>

Inherited from ​

SendMixin.sendInvoice


sendLivePhoto() ​

sendLivePhoto(livePhoto, photo, params?): Promise<MessageContext<Bot>>

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

Sends live photo to current chat

Parameters ​

ParameterType
livePhotostring | Blob
photostring | Blob
params?Optional<SendLivePhotoParams, "photo" | "live_photo" | "chat_id">

Returns ​

Promise<MessageContext<Bot>>

Inherited from ​

SendMixin.sendLivePhoto


sendLocation() ​

sendLocation(latitude, longitude, params?): Promise<MessageContext<Bot>>

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

Sends location to current chat

Parameters ​

ParameterType
latitudenumber
longitudenumber
params?Optional<SendLocationParams, "chat_id" | "latitude" | "longitude">

Returns ​

Promise<MessageContext<Bot>>

Inherited from ​

SendMixin.sendLocation


sendMedia() ​

sendMedia<T>(query): ReturnType<T extends "animation" ? (animation, params?) => Promise<MessageContext<Bot>> : T extends "audio" ? (audio, params?) => Promise<MessageContext<Bot>> : T extends "document" ? (document, params?) => Promise<MessageContext<Bot>> : T extends "photo" ? (photo, params?) => Promise<MessageContext<Bot>> : T extends "sticker" ? (sticker, params?) => Promise<MessageContext<Bot>> : T extends "video_note" ? (videoNote, params?) => Promise<MessageContext<Bot>> : T extends "video" ? (video, params?) => Promise<MessageContext<...>> : T extends "voice" ? (voice, params?) => Promise<...> : () => never>

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

Automatically uses correct media method to send media

Type Parameters ​

Type Parameter
T extends string

Parameters ​

ParameterType
queryobject & tSendMethods

Returns ​

ReturnType<T extends "animation" ? (animation, params?) => Promise<MessageContext<Bot>> : T extends "audio" ? (audio, params?) => Promise<MessageContext<Bot>> : T extends "document" ? (document, params?) => Promise<MessageContext<Bot>> : T extends "photo" ? (photo, params?) => Promise<MessageContext<Bot>> : T extends "sticker" ? (sticker, params?) => Promise<MessageContext<Bot>> : T extends "video_note" ? (videoNote, params?) => Promise<MessageContext<Bot>> : T extends "video" ? (video, params?) => Promise<MessageContext<...>> : T extends "voice" ? (voice, params?) => Promise<...> : () => never>

Example ​

js
context.sendMedia({
  type: 'photo',
  photo: MediaUpload.path('./image.png'),
  caption: 'good image yes yes'
})

Inherited from ​

SendMixin.sendMedia


sendMediaGroup() ​

sendMediaGroup(mediaGroup, params?): Promise<MessageContext<Bot>[]>

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

Sends media group to current chat

Parameters ​

ParameterType
mediaGroup(TelegramInputMediaAudio | TelegramInputMediaDocument | TelegramInputMediaLivePhoto | TelegramInputMediaPhoto | TelegramInputMediaVideo)[]
params?Optional<SendMediaGroupParams, "media" | "chat_id">

Returns ​

Promise<MessageContext<Bot>[]>

Inherited from ​

SendMixin.sendMediaGroup


sendMessageDraft() ​

sendMessageDraft(params): Promise<true>

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

Sends a message draft to the current private chat

Parameters ​

ParameterType
paramsOptional<SendMessageDraftParams, "chat_id">

Returns ​

Promise<true>

Inherited from ​

SendMixin.sendMessageDraft


sendPaidMedia() ​

sendPaidMedia(paidMedia, starCount, params?): Promise<MessageContext<Bot>>

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

Sends paid media to current chat

Parameters ​

ParameterType
paidMediaTelegramInputPaidMedia[]
starCountnumber
params?Optional<SendPaidMediaParams, "media" | "chat_id" | "star_count">

Returns ​

Promise<MessageContext<Bot>>

Inherited from ​

SendMixin.sendPaidMedia


sendPhoto() ​

sendPhoto(photo, params?): Promise<MessageContext<Bot>>

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

Sends photo to current chat

Parameters ​

ParameterType
photostring | Blob
params?Optional<SendPhotoParams, "photo" | "chat_id">

Returns ​

Promise<MessageContext<Bot>>

Inherited from ​

SendMixin.sendPhoto


sendPoll() ​

sendPoll(params): Promise<MessageContext<Bot>>

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

Sends poll to current chat

Parameters ​

ParameterType
paramsOptional<SendPollParams, "chat_id">

Returns ​

Promise<MessageContext<Bot>>

Inherited from ​

SendMixin.sendPoll


sendRichMessage() ​

sendRichMessage(richMessage, params?): Promise<MessageContext<Bot>>

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

Sends rich message to current chat

Parameters ​

ParameterType
richMessageTelegramInputRichMessage
params?Optional<SendRichMessageParams, "chat_id" | "rich_message">

Returns ​

Promise<MessageContext<Bot>>

Inherited from ​

SendMixin.sendRichMessage


sendRichMessageDraft() ​

sendRichMessageDraft(richMessage, draftId, params?): Promise<true>

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

Streams a partial rich message draft to the current chat. The streamed draft is ephemeral and acts as a temporary 30-second preview — once the output is finalized, you must call sendRichMessage with the complete message to persist it.

Parameters ​

ParameterType
richMessageTelegramInputRichMessage
draftIdnumber
params?Optional<SendRichMessageDraftParams, "chat_id" | "rich_message" | "draft_id">

Returns ​

Promise<true>

Inherited from ​

SendMixin.sendRichMessageDraft


sendSticker() ​

sendSticker(sticker, params?): Promise<MessageContext<Bot>>

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

Sends sticker

Parameters ​

ParameterType
stickerstring | Blob
params?Optional<SendStickerParams, "sticker" | "chat_id">

Returns ​

Promise<MessageContext<Bot>>

Inherited from ​

SendMixin.sendSticker


sendVenue() ​

sendVenue(params): Promise<MessageContext<Bot>>

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

Sends venue to current chat

Parameters ​

ParameterType
paramsOptional<SendVenueParams, "chat_id">

Returns ​

Promise<MessageContext<Bot>>

Inherited from ​

SendMixin.sendVenue


sendVideo() ​

sendVideo(video, params?): Promise<MessageContext<Bot>>

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

Sends video to current chat

Parameters ​

ParameterType
videostring | Blob
params?Optional<SendVideoParams, "video" | "chat_id">

Returns ​

Promise<MessageContext<Bot>>

Inherited from ​

SendMixin.sendVideo


sendVideoNote() ​

sendVideoNote(videoNote, params?): Promise<MessageContext<Bot>>

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

Sends video note to current chat

Parameters ​

ParameterType
videoNotestring | Blob
params?Optional<SendVideoNoteParams, "video_note" | "chat_id">

Returns ​

Promise<MessageContext<Bot>>

Inherited from ​

SendMixin.sendVideoNote


sendVoice() ​

sendVoice(voice, params?): Promise<MessageContext<Bot>>

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

Sends voice to current chat

Parameters ​

ParameterType
voicestring | Blob
params?Optional<SendVoiceParams, "voice" | "chat_id">

Returns ​

Promise<MessageContext<Bot>>

Inherited from ​

SendMixin.sendVoice


setReaction() ​

setReaction(reaction, params?): Promise<true>

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

Sets a reaction on a message

Parameters ​

ParameterType
reactionTelegramReactionTypeEmojiEmoji | TelegramReactionType
params?Optional<SetMessageReactionParams, "chat_id" | "message_id">

Returns ​

Promise<true>

Inherited from ​

NodeMixin.setReaction


setReactions() ​

setReactions(rawReactions, params?): Promise<true>

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

Sets multiple amount of reactions on a message

Parameters ​

ParameterType
rawReactions(TelegramReactionTypeEmojiEmoji | TelegramReactionType)[]
params?Optional<SetMessageReactionParams, "chat_id" | "message_id">

Returns ​

Promise<true>

Inherited from ​

NodeMixin.setReactions


stopLiveLocation() ​

stopLiveLocation(params?): Promise<true | MessageContext<Bot>>

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

Stops current message live location. An alias for stopMessageLiveLocation

Parameters ​

ParameterType
params?StopMessageLiveLocationParams

Returns ​

Promise<true | MessageContext<Bot>>

Inherited from ​

NodeMixin.stopLiveLocation


stopMessageLiveLocation() ​

stopMessageLiveLocation(params?): Promise<true | MessageContext<Bot>>

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

Stops current message live location

Parameters ​

ParameterType
params?StopMessageLiveLocationParams

Returns ​

Promise<true | MessageContext<Bot>>

Inherited from ​

NodeMixin.stopMessageLiveLocation


stopPoll() ​

stopPoll(messageId, params?): Promise<Poll>

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

Stops poll in current chat

Parameters ​

ParameterType
messageIdnumber
params?Partial<StopPollParams>

Returns ​

Promise<Poll>

Inherited from ​

SendMixin.stopPoll


streamMessage() ​

Call Signature ​

streamMessage(options?): MessageDraft<Bot>

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

Streams message drafts to the current chat, finalizing each completed draft as a sent message.

Two forms (mirroring SendMixin.streamRichMessage):

  • Iterable — pass an Iterable/AsyncIterable of MessageDraftPiece; it's drained and the array of sent messages is returned.
  • Handle — call with no iterable to get a MessageDraft: append() pieces and finalize(), or use await using to finalize on scope exit.

Both use sendMessageDraft for live previews and sendMessage to finalize each 4096-char segment.

Parameters ​
ParameterType
options?StreamMessageOptions
Returns ​

MessageDraft<Bot>

Example ​
ts
// iterable form
const messages = await context.streamMessage(llmStream);

// handle form (auto-finalize)
await using draft = context.streamMessage();
for await (const token of llm) draft.append(token);
Inherited from ​

SendMixin.streamMessage

Call Signature ​

streamMessage(stream, options?): Promise<MessageContext<Bot>[]>

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

Streams message drafts to the current chat, finalizing each completed draft as a sent message.

Two forms (mirroring SendMixin.streamRichMessage):

  • Iterable — pass an Iterable/AsyncIterable of MessageDraftPiece; it's drained and the array of sent messages is returned.
  • Handle — call with no iterable to get a MessageDraft: append() pieces and finalize(), or use await using to finalize on scope exit.

Both use sendMessageDraft for live previews and sendMessage to finalize each 4096-char segment.

Parameters ​
ParameterType
streamIterable<MessageDraftPiece, any, any> | AsyncIterable<MessageDraftPiece, any, any>
options?StreamMessageOptions
Returns ​

Promise<MessageContext<Bot>[]>

Example ​
ts
// iterable form
const messages = await context.streamMessage(llmStream);

// handle form (auto-finalize)
await using draft = context.streamMessage();
for await (const token of llm) draft.append(token);
Inherited from ​

SendMixin.streamMessage


streamRichMessage() ​

Call Signature ​

streamRichMessage(options?): RichMessageDraft<Bot>

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

Stream a rich message to the current chat, draft-first.

The hard part of sendRichMessageDraft is the contract: the draft is an ephemeral ~30-second preview, and you must finalize it with sendRichMessage or the message vanishes. This helper owns that lifecycle (throttled previews, a single finalize), so you can't forget it.

Two forms:

  • Handle — const draft = ctx.streamRichMessage(); draft.append(chunk); … await draft.finalize(). With await using, finalize runs automatically on scope exit.
  • Iterable — pass an (async) iterable of chunks; it's drained, finalized, and the sent message is returned.

A chunk is a @gramio/format RichString or a raw rich-markdown string.

Parameters ​
ParameterType
options?StreamRichMessageOptions
Returns ​

RichMessageDraft<Bot>

Example ​
ts
// handle form (auto-finalize)
await using draft = ctx.streamRichMessage();
for await (const token of llm) draft.append(rich`${token}`);

// iterable form
const message = await ctx.streamRichMessage(llmStream);
Inherited from ​

SendMixin.streamRichMessage

Call Signature ​

streamRichMessage(stream, options?): Promise<MessageContext<Bot>>

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

Stream a rich message to the current chat, draft-first.

The hard part of sendRichMessageDraft is the contract: the draft is an ephemeral ~30-second preview, and you must finalize it with sendRichMessage or the message vanishes. This helper owns that lifecycle (throttled previews, a single finalize), so you can't forget it.

Two forms:

  • Handle — const draft = ctx.streamRichMessage(); draft.append(chunk); … await draft.finalize(). With await using, finalize runs automatically on scope exit.
  • Iterable — pass an (async) iterable of chunks; it's drained, finalized, and the sent message is returned.

A chunk is a @gramio/format RichString or a raw rich-markdown string.

Parameters ​
ParameterType
streamIterable<RichChunk, any, any> | AsyncIterable<RichChunk, any, any>
options?StreamRichMessageOptions
Returns ​

Promise<MessageContext<Bot>>

Example ​
ts
// handle form (auto-finalize)
await using draft = ctx.streamRichMessage();
for await (const token of llm) draft.append(rich`${token}`);

// iterable form
const message = await ctx.streamRichMessage(llmStream);
Inherited from ​

SendMixin.streamRichMessage


unpinAllChatMessages() ​

unpinAllChatMessages(params?): Promise<true>

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

Clears the list of pinned messages

Parameters ​

ParameterType
params?Optional<UnpinAllChatMessagesParams, "chat_id">

Returns ​

Promise<true>

Inherited from ​

PinsMixin.unpinAllChatMessages


unpinChatMessage() ​

unpinChatMessage(params?): Promise<true>

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

Removes message from the list of pinned messages

Parameters ​

ParameterType
params?Optional<UnpinChatMessageParams, "chat_id" | "message_id">

Returns ​

Promise<true>

Inherited from ​

PinsMixin.unpinChatMessage