Skip to content

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

Class: ChatMemberContext<Bot>

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

This object represents changes in the status of a chat member.

Documentation

Extends

Type Parameters

Type Parameter
Bot extends BotLike

Constructors

Constructor

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

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

Parameters

ParameterType
optionsChatMemberContextOptions<Bot>

Returns

ChatMemberContext<Bot>

Overrides

Context.constructor


Constructor

new ChatMemberContext(...args): ChatMemberContext

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

Parameters

ParameterType
...argsany[]

Returns

ChatMemberContext

Overrides

Context<Bot>.constructor

Properties

PropertyModifierTypeDescriptionInherited fromDefined in
botpublicBot-Context.botcontexts/index.d.ts:4856
isTopicMessagepublic() => boolean-SendMixin.isTopicMessagecontexts/index.d.ts:4993
payloadpublicTelegramChatMemberUpdatedThe raw data that is used for this ContextChatMemberUpdated.payloadcontexts/index.d.ts:5601
update?publicTelegramUpdate-Context.updatecontexts/index.d.ts:4858
updateId?publicnumber-Context.updateIdcontexts/index.d.ts:4857
updateTypeprotectedUpdateName-Context.updateTypecontexts/index.d.ts:4859

Accessors

[toStringTag]

Get Signature

get [toStringTag](): string

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

MDN

Returns

string

Inherited from

Context.[toStringTag]


businessConnectionId

Get Signature

get businessConnectionId(): string

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

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

TargetMixin.businessConnectionId


chat

Get Signature

get chat(): Chat

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

Chat the user belongs to

Returns

Chat

Inherited from

ChatMemberUpdated.chat


chatId

Get Signature

get chatId(): number

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

Chat ID

Returns

number

Inherited from

TargetMixin.chatId


chatType

Get Signature

get chatType(): TelegramChatType

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

Chat type

Returns

TelegramChatType

Inherited from

TargetMixin.chatType


date

Get Signature

get date(): number

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

Date the change was done in Unix time

Returns

number

Inherited from

ChatMemberUpdated.date


from

Get Signature

get from(): User

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

Performer of the action, which resulted in the change

Returns

User

Inherited from

ChatMemberUpdated.from


id

Get Signature

get id(): number

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

Returns

number

Inherited from

ChatControlMixin.id


Get Signature

get inviteLink(): ChatInviteLink

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

Optional. Chat invite link, which was used by the user to join the chat; for joining by invite link events only.

Returns

ChatInviteLink

Inherited from

ChatMemberUpdated.inviteLink


newChatMember

Get Signature

get newChatMember(): ChatMember

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

New information about the chat member

Returns

ChatMember

Inherited from

ChatMemberUpdated.newChatMember


oldChatMember

Get Signature

get oldChatMember(): ChatMember

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

Previous information about the chat member

Returns

ChatMember

Inherited from

ChatMemberUpdated.oldChatMember


senderBoostCount

Get Signature

get senderBoostCount(): number

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

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

Returns

number

Inherited from

TargetMixin.senderBoostCount


senderChat

Get Signature

get senderChat(): Chat

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

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

TargetMixin.senderChat


senderId

Get Signature

get senderId(): number

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

Sender's ID

Returns

number

Inherited from

TargetMixin.senderId


threadId

Get Signature

get threadId(): number

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

Returns

number

Inherited from

SendMixin.threadId


Get Signature

get viaChatFolderInviteLink(): boolean

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

Optional. True, if the user joined the chat via a chat folder invite link

Returns

boolean

Inherited from

ChatMemberUpdated.viaChatFolderInviteLink


viaJoinRequest

Get Signature

get viaJoinRequest(): boolean

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

Optional. True, if the user joined the chat after sending a direct join request and being approved by an administrator

Returns

boolean

Inherited from

ChatMemberUpdated.viaJoinRequest

Methods

clearReactions()

clearReactions(params?): Promise<true>

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

Clears reactions from the message

Parameters

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

Returns

Promise<true>

Inherited from

ChatControlMixin.clearReactions


clone()

clone(options?): ChatMemberContext

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

Parameters

ParameterType
options?ChatMemberContextOptions

Returns

ChatMemberContext

Inherited from

CloneMixin.clone


copy()

copy(params?): Promise<MessageId>

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

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

ChatControlMixin.copy


copyMessages()

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

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

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

ChatControlMixin.copyMessages


createActionController()

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

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

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:5175

Deletes current message

Parameters

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

Returns

Promise<true>

Inherited from

ChatControlMixin.delete


deleteChatStickerSet()

deleteChatStickerSet(params?): Promise<true>

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

Deletes group stickerset

Parameters

ParameterType
params?Optional<DeleteChatStickerSetParams, "chat_id">

Returns

Promise<true>

Inherited from

ChatControlMixin.deleteChatStickerSet


deleteMessages()

deleteMessages(ids): Promise<true>

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

Deletes messages in current chat

Parameters

ParameterType
idsnumber[]

Returns

Promise<true>

Inherited from

ChatControlMixin.deleteMessages


editCaption()

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

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

Edits current message caption. An alias for editMessageCaption

Parameters

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

Returns

Promise<true | MessageContext<Bot>>

Inherited from

ChatControlMixin.editCaption


editChecklist()

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

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

Parameters

ParameterType
checklistTelegramInputChecklist
params?Partial<EditMessageChecklistParams>

Returns

Promise<MessageContext<Bot>>

Inherited from

ChatControlMixin.editChecklist


editLiveLocation()

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

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

Edits current message live location. An alias for editMessageLiveLocation

Parameters

ParameterType
paramsEditMessageLiveLocationParams

Returns

Promise<true | MessageContext<Bot>>

Inherited from

ChatControlMixin.editLiveLocation


editMedia()

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

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

Edits current message media. An alias for editMessageMedia

Parameters

ParameterType
mediaTelegramInputMedia
params?Partial<EditMessageMediaParams>

Returns

Promise<true | MessageContext<Bot>>

Inherited from

ChatControlMixin.editMedia


editMessageCaption()

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

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

Edits current message caption

Parameters

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

Returns

Promise<true | MessageContext<Bot>>

Inherited from

ChatControlMixin.editMessageCaption


editMessageLiveLocation()

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

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

Edits current message live location

Parameters

ParameterType
paramsEditMessageLiveLocationParams

Returns

Promise<true | MessageContext<Bot>>

Inherited from

ChatControlMixin.editMessageLiveLocation


editMessageMedia()

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

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

Edits current message media

Parameters

ParameterType
mediaTelegramInputMedia
params?Partial<EditMessageMediaParams>

Returns

Promise<true | MessageContext<Bot>>

Inherited from

ChatControlMixin.editMessageMedia


editMessageReplyMarkup()

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

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

Edits current message reply markup

Parameters

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

Returns

Promise<true | MessageContext<Bot>>

Inherited from

ChatControlMixin.editMessageReplyMarkup


editMessageText()

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

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

Edits current message text

Parameters

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

Returns

Promise<true | MessageContext<Bot>>

Inherited from

ChatControlMixin.editMessageText


editReplyMarkup()

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

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

Edits current message reply markup. An alias for editMessageReplyMarkup

Parameters

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

Returns

Promise<true | MessageContext<Bot>>

Inherited from

ChatControlMixin.editReplyMarkup


editText()

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

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

Edits current message text. An alias for editMessageText

Parameters

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

Returns

Promise<true | MessageContext<Bot>>

Inherited from

ChatControlMixin.editText


forward()

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

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

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

ChatControlMixin.forward


forwardMessages()

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

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

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

ChatControlMixin.forwardMessages


getChatBoosts()

getChatBoosts(userId): Promise<TelegramUserChatBoosts>

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

Returns chat boosts by the user

Parameters

ParameterType
userIdnumber

Returns

Promise<TelegramUserChatBoosts>

Inherited from

SendMixin.getChatBoosts


hasFrom()

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

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

Checks if the instance has from and senderId properties

Returns

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

Inherited from

TargetMixin.hasFrom


hasInviteLink(): this is Require<ChatMemberContext<Bot>, "inviteLink">

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

Does this update have invite_link property?

Returns

this is Require<ChatMemberContext<Bot>, "inviteLink">


hasSenderChat()

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

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

Checks if the instance has senderChat property

Returns

this is Require<ChatMemberContext<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:4865

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


isChannel()

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

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

Is this chat a channel?

Returns

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

Inherited from

TargetMixin.isChannel


isGroup()

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

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

Is this chat a group?

Returns

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

Inherited from

TargetMixin.isGroup


isPM()

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

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

Is this chat a private one?

Returns

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

Inherited from

TargetMixin.isPM


isSupergroup()

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

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

Is this chat a supergroup?

Returns

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

Inherited from

TargetMixin.isSupergroup


quoteWithAnimation()

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

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

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" | "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

ChatControlMixin.quoteWithAnimation


quoteWithAudio()

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

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

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" | "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

ChatControlMixin.quoteWithAudio


quoteWithContact()

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

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

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" | "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

ChatControlMixin.quoteWithContact


quoteWithDice()

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

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

Replies to current message with a quote and a dice

Parameters

ParameterType
paramsobject & object & Partial<SendDiceParams> & object

Returns

Promise<MessageContext<Bot>>

Inherited from

ChatControlMixin.quoteWithDice


quoteWithDocument()

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

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

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" | "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

ChatControlMixin.quoteWithDocument


quoteWithInvoice()

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

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

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

ChatControlMixin.quoteWithInvoice


quoteWithLocation()

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

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

Replies to current message with a quote and a location

Parameters

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

Returns

Promise<MessageContext<Bot>>

Inherited from

ChatControlMixin.quoteWithLocation


quoteWithMediaGroup()

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

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

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

ChatControlMixin.quoteWithMediaGroup


quoteWithPhoto()

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

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

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" | "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

ChatControlMixin.quoteWithPhoto


quoteWithPoll()

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

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

Replies to current message with a quote and a poll

Parameters

ParameterType
paramsobject & Pick<SendPollParams, "question" | "options" | "type" | "explanation" | "description" | "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" | "correct_option_ids" | "explanation_parse_mode" | "explanation_entities" | "open_period" | "close_date" | "is_closed" | "description_parse_mode" | "description_entities"> & object & object

Returns

Promise<MessageContext<Bot>>

Inherited from

ChatControlMixin.quoteWithPoll


quoteWithSticker()

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

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

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" | "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

ChatControlMixin.quoteWithSticker


quoteWithVenue()

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

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

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" | "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

ChatControlMixin.quoteWithVenue


quoteWithVideo()

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

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

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" | "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

ChatControlMixin.quoteWithVideo


quoteWithVideoNote()

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

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

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" | "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

ChatControlMixin.quoteWithVideoNote


quoteWithVoice()

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

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

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" | "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

ChatControlMixin.quoteWithVoice


react()

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

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

Reacts to a message

Parameters

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

Returns

Promise<true>

Inherited from

ChatControlMixin.react


removeChatPhoto()

removeChatPhoto(params?): Promise<true>

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

Deletes a chat photo

Parameters

ParameterType
params?Optional<DeleteChatPhotoParams, "chat_id">

Returns

Promise<true>

Inherited from

ChatControlMixin.removeChatPhoto


reply()

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

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

Replies to current message

Parameters

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

Returns

Promise<MessageContext<Bot>>

Inherited from

ChatControlMixin.reply


replyWithAnimation()

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

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

Replies to current message with animation

Parameters

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

Returns

Promise<MessageContext<Bot>>

Inherited from

ChatControlMixin.replyWithAnimation


replyWithAudio()

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

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

Replies to current message with audio

Parameters

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

Returns

Promise<MessageContext<Bot>>

Inherited from

ChatControlMixin.replyWithAudio


replyWithContact()

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

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

Replies to current message with contact

Parameters

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

Returns

Promise<MessageContext<Bot>>

Inherited from

ChatControlMixin.replyWithContact


replyWithDice()

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

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

Replies to current message with a dice

Parameters

ParameterType
emojiSendDiceEmoji
params?WithPartialReplyParameters<Partial<SendDiceParams>>

Returns

Promise<MessageContext<Bot>>

Inherited from

ChatControlMixin.replyWithDice


replyWithDocument()

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

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

Replies to current message with document

Parameters

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

Returns

Promise<MessageContext<Bot>>

Inherited from

ChatControlMixin.replyWithDocument


replyWithInvoice()

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

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

Replies to current message with invoice

Parameters

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

Returns

Promise<MessageContext<Bot>>

Inherited from

ChatControlMixin.replyWithInvoice


replyWithLocation()

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

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

Replies to current message with location

Parameters

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

Returns

Promise<MessageContext<Bot>>

Inherited from

ChatControlMixin.replyWithLocation


replyWithMediaGroup()

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

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

Replies to current message with media group

Parameters

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

Returns

Promise<MessageContext<Bot>[]>

Inherited from

ChatControlMixin.replyWithMediaGroup


replyWithPhoto()

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

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

Replies to current message with photo

Parameters

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

Returns

Promise<MessageContext<Bot>>

Inherited from

ChatControlMixin.replyWithPhoto


replyWithPoll()

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

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

Replies to current message with poll

Parameters

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

Returns

Promise<MessageContext<Bot>>

Inherited from

ChatControlMixin.replyWithPoll


replyWithQuote()

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

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

Replies to current message with a quote

Parameters

ParameterType
paramsobject & object & Pick<SendMessageParams, "entities" | "business_connection_id" | "message_thread_id" | "direct_messages_topic_id" | "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

ChatControlMixin.replyWithQuote


replyWithSticker()

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

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

Replies to current message with sticker

Parameters

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

Returns

Promise<MessageContext<Bot>>

Inherited from

ChatControlMixin.replyWithSticker


replyWithVenue()

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

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

Replies to current message with venue

Parameters

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

Returns

Promise<MessageContext<Bot>>

Inherited from

ChatControlMixin.replyWithVenue


replyWithVideo()

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

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

Replies to current message with video

Parameters

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

Returns

Promise<MessageContext<Bot>>

Inherited from

ChatControlMixin.replyWithVideo


replyWithVideoNote()

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

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

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

ChatControlMixin.replyWithVideoNote


replyWithVoice()

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

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

Replies to current message with voice

Parameters

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

Returns

Promise<MessageContext<Bot>>

Inherited from

ChatControlMixin.replyWithVoice


send()

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

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

Sends message to current chat

Parameters

ParameterType
textstring | { toString: string; }
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:5008

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:5004

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:5032

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:5024

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:5020

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:5034

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:5002

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:5016

Sends invoice to current user

Parameters

ParameterType
paramsOptional<SendInvoiceParams, "chat_id">

Returns

Promise<MessageContext<Bot>>

Inherited from

SendMixin.sendInvoice


sendLocation()

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

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

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:5051

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:5038

Sends media group to current chat

Parameters

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

Returns

Promise<MessageContext<Bot>[]>

Inherited from

SendMixin.sendMediaGroup


sendMessageDraft()

sendMessageDraft(params): Promise<true>

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

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:5036

Sends paid media to current chat

Parameters

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

Returns

Promise<MessageContext<Bot>>

Inherited from

SendMixin.sendPaidMedia


sendPhoto()

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

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

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:5022

Sends poll to current chat

Parameters

ParameterType
paramsOptional<SendPollParams, "chat_id">

Returns

Promise<MessageContext<Bot>>

Inherited from

SendMixin.sendPoll


sendSticker()

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

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

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:5018

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:5006

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:5010

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:5012

Sends voice to current chat

Parameters

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

Returns

Promise<MessageContext<Bot>>

Inherited from

SendMixin.sendVoice


setChatDefaultPermissions()

setChatDefaultPermissions(permissions, params?): Promise<true>

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

Sets default chat permissions

Parameters

ParameterType
permissionsTelegramChatPermissions
params?Optional<SetChatPermissionsParams, "chat_id" | "permissions">

Returns

Promise<true>

Inherited from

ChatControlMixin.setChatDefaultPermissions


setChatDescription()

setChatDescription(description, params?): Promise<true>

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

Changes chat description

Parameters

ParameterType
descriptionstring
params?Optional<SetChatDescriptionParams, "description" | "chat_id">

Returns

Promise<true>

Inherited from

ChatControlMixin.setChatDescription


setChatPhoto()

setChatPhoto(photo, params?): Promise<true>

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

Sets a new profile photo for the chat

Parameters

ParameterType
photoBlob
params?Optional<SetChatPhotoParams, "photo" | "chat_id">

Returns

Promise<true>

Inherited from

ChatControlMixin.setChatPhoto


setChatStickerSet()

setChatStickerSet(name, params?): Promise<true>

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

Sets new group stickerset

Parameters

ParameterType
namestring
params?Optional<SetChatStickerSetParams, "chat_id" | "sticker_set_name">

Returns

Promise<true>

Inherited from

ChatControlMixin.setChatStickerSet


setChatTitle()

setChatTitle(title, params?): Promise<true>

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

Changes chat title

Parameters

ParameterType
titlestring
params?Optional<SetChatTitleParams, "title" | "chat_id">

Returns

Promise<true>

Inherited from

ChatControlMixin.setChatTitle


setCustomTitle()

setCustomTitle(title, params?): Promise<true>

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

Sets a custom title

Parameters

ParameterType
titlestring
params?Optional<SetChatAdministratorCustomTitleParams, "chat_id" | "user_id">

Returns

Promise<true>

Inherited from

ChatControlMixin.setCustomTitle


setReaction()

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

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

Sets a reaction on a message

Parameters

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

Returns

Promise<true>

Inherited from

ChatControlMixin.setReaction


setReactions()

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

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

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

ChatControlMixin.setReactions


stopLiveLocation()

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

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

Stops current message live location. An alias for stopMessageLiveLocation

Parameters

ParameterType
params?StopMessageLiveLocationParams

Returns

Promise<true | MessageContext<Bot>>

Inherited from

ChatControlMixin.stopLiveLocation


stopMessageLiveLocation()

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

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

Stops current message live location

Parameters

ParameterType
params?StopMessageLiveLocationParams

Returns

Promise<true | MessageContext<Bot>>

Inherited from

ChatControlMixin.stopMessageLiveLocation


stopPoll()

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

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

Stops poll in current chat

Parameters

ParameterType
messageIdnumber
params?Partial<StopPollParams>

Returns

Promise<Poll>

Inherited from

SendMixin.stopPoll


streamMessage()

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

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

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

Accepts an Iterable or AsyncIterable of MessageDraftPiece (strings or objects with text+entities). Uses sendMessageDraft for live typing previews and sendMessage to finalize each 4096-char segment. Returns an array of sent MessageContext objects.

Parameters

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

Returns

Promise<MessageContext<Bot>[]>

Example

ts
// Stream from an async generator (e.g., LLM output)
const messages = await context.streamMessage(llmStream);

Inherited from

SendMixin.streamMessage