GramIO API Reference / @gramio/contexts/dist / ForumMixin
Class: ForumMixin<Bot>
Defined in: contexts/index.d.ts:5159
This object represents a mixin that's used in all topic-related updates
Extends
Extended by
ForumTopicClosedContextForumTopicCreatedContextForumTopicEditedContextForumTopicReopenedContextGeneralForumTopicHiddenContextGeneralForumTopicUnhiddenContextGiveawayCompletedContextGiveawayCreatedContextGiveawayWinnersContext
Type Parameters
| Type Parameter |
|---|
Bot extends BotLike |
Constructors
Constructor
new ForumMixin<
Bot>():ForumMixin<Bot>
Returns
ForumMixin<Bot>
Inherited from
Properties
| Property | Modifier | Type | Inherited from | Defined in |
|---|---|---|---|---|
bot | public | Bot | Context.bot | contexts/index.d.ts:4726 |
isTopicMessage | public | () => boolean | NodeMixin.isTopicMessage | contexts/index.d.ts:4863 |
update? | public | TelegramUpdate | Context.update | contexts/index.d.ts:4728 |
updateId? | public | number | Context.updateId | contexts/index.d.ts:4727 |
updateType | protected | UpdateName | Context.updateType | contexts/index.d.ts:4729 |
Accessors
[toStringTag]
Get Signature
get [toStringTag]():
string
Defined in: contexts/index.d.ts:4732
Returns
string
Inherited from
businessConnectionId
Get Signature
get businessConnectionId():
string
Defined in: contexts/index.d.ts:4860
Returns
string
Inherited from
NodeMixin.businessConnectionId
chatId
Get Signature
get chatId():
number
Defined in: contexts/index.d.ts:4859
Returns
number
Inherited from
id
Get Signature
get id():
number
Defined in: contexts/index.d.ts:4944
Returns
number
Inherited from
senderId
Get Signature
get senderId():
number
Defined in: contexts/index.d.ts:4861
Returns
number
Inherited from
threadId
Get Signature
get threadId():
number
Defined in: contexts/index.d.ts:5156
Returns
number
Inherited from
Methods
clearReactions()
clearReactions(
params?):Promise<true>
Defined in: contexts/index.d.ts:5088
Clears reactions from the message
Parameters
| Parameter | Type |
|---|---|
params? | Optional<SetMessageReactionParams, "chat_id" | "message_id"> |
Returns
Promise<true>
Inherited from
closeGeneralTopic()
closeGeneralTopic(
params?):Promise<true>
Defined in: contexts/index.d.ts:5173
Closes General topic
Parameters
| Parameter | Type |
|---|---|
params? | Optional<CloseGeneralForumTopicParams, "chat_id"> |
Returns
Promise<true>
closeTopic()
closeTopic(
params?):Promise<true>
Defined in: contexts/index.d.ts:5171
Closes topic
Parameters
| Parameter | Type |
|---|---|
params? | Optional<CloseForumTopicParams, "chat_id" | "message_thread_id"> |
Returns
Promise<true>
copy()
copy(
params?):Promise<MessageId>
Defined in: contexts/index.d.ts:5074
Copies current message [into other chat if chatId is provided]
Parameters
| Parameter | Type |
|---|---|
params? | Optional<CopyMessageParams, "chat_id" | "message_id" | "from_chat_id"> |
Returns
Promise<MessageId>
Inherited from
copyMessages()
copyMessages(
chatId,ids,params?):Promise<MessageId[]>
Defined in: contexts/index.d.ts:5076
Copies messages from current chat and sends to another
Parameters
| Parameter | Type |
|---|---|
chatId | string | number |
ids | number[] |
params? | Optional<CopyMessagesParams, "chat_id" | "message_ids" | "from_chat_id"> |
Returns
Promise<MessageId[]>
Inherited from
createTopic()
createTopic(
name,params?):Promise<TelegramForumTopic>
Defined in: contexts/index.d.ts:5165
Creates a topic
Parameters
| Parameter | Type |
|---|---|
name | string |
params? | Optional<CreateForumTopicParams, "name" | "chat_id"> |
Returns
Promise<TelegramForumTopic>
delete()
delete(
params?):Promise<true>
Defined in: contexts/index.d.ts:5045
Deletes current message
Parameters
| Parameter | Type |
|---|---|
params? | Optional<DeleteMessageParams, "chat_id" | "message_id"> |
Returns
Promise<true>
Inherited from
deleteMessages()
deleteMessages(
ids):Promise<true>
Defined in: contexts/index.d.ts:5047
Deletes messages in current chat
Parameters
| Parameter | Type |
|---|---|
ids | number[] |
Returns
Promise<true>
Inherited from
deleteTopic()
deleteTopic(
params?):Promise<true>
Defined in: contexts/index.d.ts:5179
Deletes topic along with all its messages
Parameters
| Parameter | Type |
|---|---|
params? | Optional<DeleteForumTopicParams, "chat_id" | "message_thread_id"> |
Returns
Promise<true>
editCaption()
editCaption(
caption,params?):Promise<true|MessageContext<Bot>>
Defined in: contexts/index.d.ts:5063
Edits current message caption. An alias for editMessageCaption
Parameters
| Parameter | Type |
|---|---|
caption | NonNullable<string | { toString: string; }> |
params? | Partial<EditMessageCaptionParams> |
Returns
Promise<true | MessageContext<Bot>>
Inherited from
editChecklist()
editChecklist(
checklist,params?):Promise<MessageContext<Bot>>
Defined in: contexts/index.d.ts:5064
Parameters
| Parameter | Type |
|---|---|
checklist | TelegramInputChecklist |
params? | Partial<EditMessageChecklistParams> |
Returns
Promise<MessageContext<Bot>>
Inherited from
editGeneralTopic()
editGeneralTopic(
params):Promise<true>
Defined in: contexts/index.d.ts:5169
Edits General topic info
Parameters
| Parameter | Type |
|---|---|
params | Optional<EditGeneralForumTopicParams, "chat_id"> |
Returns
Promise<true>
editLiveLocation()
editLiveLocation(
params):Promise<true|MessageContext<Bot>>
Defined in: contexts/index.d.ts:5051
Edits current message live location. An alias for editMessageLiveLocation
Parameters
| Parameter | Type |
|---|---|
params | EditMessageLiveLocationParams |
Returns
Promise<true | MessageContext<Bot>>
Inherited from
editMedia()
editMedia(
media,params?):Promise<true|MessageContext<Bot>>
Defined in: contexts/index.d.ts:5068
Edits current message media. An alias for editMessageMedia
Parameters
| Parameter | Type |
|---|---|
media | TelegramInputMedia |
params? | Partial<EditMessageMediaParams> |
Returns
Promise<true | MessageContext<Bot>>
Inherited from
editMessageCaption()
editMessageCaption(
caption,params?):Promise<true|MessageContext<Bot>>
Defined in: contexts/index.d.ts:5061
Edits current message caption
Parameters
| Parameter | Type |
|---|---|
caption | NonNullable<string | { toString: string; }> |
params? | Partial<EditMessageCaptionParams> |
Returns
Promise<true | MessageContext<Bot>>
Inherited from
editMessageLiveLocation()
editMessageLiveLocation(
params):Promise<true|MessageContext<Bot>>
Defined in: contexts/index.d.ts:5049
Edits current message live location
Parameters
| Parameter | Type |
|---|---|
params | EditMessageLiveLocationParams |
Returns
Promise<true | MessageContext<Bot>>
Inherited from
NodeMixin.editMessageLiveLocation
editMessageMedia()
editMessageMedia(
media,params?):Promise<true|MessageContext<Bot>>
Defined in: contexts/index.d.ts:5066
Edits current message media
Parameters
| Parameter | Type |
|---|---|
media | TelegramInputMedia |
params? | Partial<EditMessageMediaParams> |
Returns
Promise<true | MessageContext<Bot>>
Inherited from
editMessageReplyMarkup()
editMessageReplyMarkup(
replyMarkup,params?):Promise<true|MessageContext<Bot>>
Defined in: contexts/index.d.ts:5070
Edits current message reply markup
Parameters
| Parameter | Type |
|---|---|
replyMarkup | TelegramInlineKeyboardMarkup | { 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:5057
Edits current message text
Parameters
| Parameter | Type |
|---|---|
text | string | { toString: string; } |
params? | Partial<EditMessageTextParams> |
Returns
Promise<true | MessageContext<Bot>>
Inherited from
editReplyMarkup()
editReplyMarkup(
replyMarkup,params?):Promise<true|MessageContext<Bot>>
Defined in: contexts/index.d.ts:5072
Edits current message reply markup. An alias for editMessageReplyMarkup
Parameters
| Parameter | Type |
|---|---|
replyMarkup | TelegramInlineKeyboardMarkup | { toJSON: TelegramInlineKeyboardMarkup; } |
params? | Partial<EditMessageReplyMarkupParams> |
Returns
Promise<true | MessageContext<Bot>>
Inherited from
editText()
editText(
text,params?):Promise<true|MessageContext<Bot>>
Defined in: contexts/index.d.ts:5059
Edits current message text. An alias for editMessageText
Parameters
| Parameter | Type |
|---|---|
text | string | { toString: string; } |
params? | Partial<EditMessageTextParams> |
Returns
Promise<true | MessageContext<Bot>>
Inherited from
editTopic()
editTopic(
params):Promise<true>
Defined in: contexts/index.d.ts:5167
Edits topic info
Parameters
| Parameter | Type |
|---|---|
params | Optional<EditForumTopicParams, "chat_id" | "message_thread_id"> |
Returns
Promise<true>
forward()
forward(
params?):Promise<MessageContext<Bot>>
Defined in: contexts/index.d.ts:5078
Forwards current message [into other chat if chatId is provided]
Parameters
| Parameter | Type |
|---|---|
params? | Optional<ForwardMessageParams, "chat_id" | "message_id" | "from_chat_id"> |
Returns
Promise<MessageContext<Bot>>
Inherited from
forwardMessages()
forwardMessages(
chatId,ids,params?):Promise<MessageId[]>
Defined in: contexts/index.d.ts:5080
Forwards messages from current chat to another
Parameters
| Parameter | Type |
|---|---|
chatId | string | number |
ids | number[] |
params? | Optional<ForwardMessagesParams, "chat_id" | "message_ids" | "from_chat_id"> |
Returns
Promise<MessageId[]>
Inherited from
getChatBoosts()
getChatBoosts(
userId):Promise<TelegramUserChatBoosts>
Defined in: contexts/index.d.ts:4938
Returns chat boosts by the user
Parameters
| Parameter | Type |
|---|---|
userId | number |
Returns
Promise<TelegramUserChatBoosts>
Inherited from
getTopicIcons()
getTopicIcons():
Promise<TelegramSticker[]>
Defined in: contexts/index.d.ts:5163
Returns custom emoji stickers, which can be used as a forum topic icon by any user
Returns
Promise<TelegramSticker[]>
hideGeneralTopic()
hideGeneralTopic(
params?):Promise<true>
Defined in: contexts/index.d.ts:5185
Hides General topic
Parameters
| Parameter | Type |
|---|---|
params? | Optional<HideGeneralForumTopicParams, "chat_id"> |
Returns
Promise<true>
is()
is<
T>(rawTypes):this is InstanceType<ContextsMapping<Bot>[T]> & Bot["__Derives"]["global"] & Bot["__Derives"][T] & (Bot["__Derives"] extends {} ? Bot["__Derives"]["global"] & Bot["__Derives"][T] : {})
Defined in: contexts/index.d.ts:4735
Type Parameters
| Type Parameter |
|---|
T extends UpdateName |
Parameters
| Parameter | Type |
|---|---|
rawTypes | MaybeArray<SoftString<T>> |
Returns
this is InstanceType<ContextsMapping<Bot>[T]> & Bot["__Derives"]["global"] & Bot["__Derives"][T] & (Bot["__Derives"] extends {} ? Bot["__Derives"]["global"] & Bot["__Derives"][T] : {})
Inherited from
isGeneralTopic()
isGeneralTopic():
this is RequireValue<ForumMixin<Bot>, "threadId", undefined>
Defined in: contexts/index.d.ts:5161
Checks whether this topic is actually a 'General' one
Returns
this is RequireValue<ForumMixin<Bot>, "threadId", undefined>
quoteWithAnimation()
quoteWithAnimation(
params):Promise<MessageContext<Bot>>
Defined in: contexts/index.d.ts:5008
Replies to current message with a quote and an animation
Parameters
| Parameter | Type |
|---|---|
params | object & 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
quoteWithAudio()
quoteWithAudio(
params):Promise<MessageContext<Bot>>
Defined in: contexts/index.d.ts:5000
Replies to current message with a quote and an audio
Parameters
| Parameter | Type |
|---|---|
params | object & 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
quoteWithContact()
quoteWithContact(
params):Promise<MessageContext<Bot>>
Defined in: contexts/index.d.ts:5033
Replies to current message with a quote and a contact
Parameters
| Parameter | Type |
|---|---|
params | object & 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
quoteWithDice()
quoteWithDice(
params):Promise<MessageContext<Bot>>
Defined in: contexts/index.d.ts:5041
Replies to current message with a quote and a dice
Parameters
| Parameter | Type |
|---|---|
params | object & object & Partial<SendDiceParams> & object |
Returns
Promise<MessageContext<Bot>>
Inherited from
quoteWithDocument()
quoteWithDocument(
params):Promise<MessageContext<Bot>>
Defined in: contexts/index.d.ts:4996
Replies to current message with a quote and a document
Parameters
| Parameter | Type |
|---|---|
params | object & 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
quoteWithInvoice()
quoteWithInvoice(
params):Promise<MessageContext<Bot>>
Defined in: contexts/index.d.ts:5029
Replies to current message with a quote and an invoice
Parameters
| Parameter | Type |
|---|---|
params | object & Pick<SendInvoiceParams, "payload" | "currency" | "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" | "description" | "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
quoteWithLocation()
quoteWithLocation(
params):Promise<MessageContext<Bot>>
Defined in: contexts/index.d.ts:5024
Replies to current message with a quote and a location
Parameters
| Parameter | Type |
|---|---|
params | object & 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
quoteWithMediaGroup()
quoteWithMediaGroup(
params):Promise<MessageContext<Bot>[]>
Defined in: contexts/index.d.ts:5020
Replies to current message with a quote and a media group
Parameters
| Parameter | Type |
|---|---|
params | object & 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
quoteWithPhoto()
quoteWithPhoto(
params):Promise<MessageContext<Bot>>
Defined in: contexts/index.d.ts:4992
Replies to current message with a quote and a photo
Parameters
| Parameter | Type |
|---|---|
params | object & 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
quoteWithPoll()
quoteWithPoll(
params):Promise<MessageContext<Bot>>
Defined in: contexts/index.d.ts:5035
Replies to current message with a quote and a poll
Parameters
| Parameter | Type |
|---|---|
params | object & Pick<SendPollParams, "question" | "options" | "type" | "explanation" | "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" | "correct_option_id" | "explanation_parse_mode" | "explanation_entities" | "open_period" | "close_date" | "is_closed"> & object & object |
Returns
Promise<MessageContext<Bot>>
Inherited from
quoteWithSticker()
quoteWithSticker(
params):Promise<MessageContext<Bot>>
Defined in: contexts/index.d.ts:5037
Replies to current message with a quote and a sticker
Parameters
| Parameter | Type |
|---|---|
params | object & 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
quoteWithVenue()
quoteWithVenue(
params):Promise<MessageContext<Bot>>
Defined in: contexts/index.d.ts:5031
Replies to current message with a quote and a venue
Parameters
| Parameter | Type |
|---|---|
params | object & 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
quoteWithVideo()
quoteWithVideo(
params):Promise<MessageContext<Bot>>
Defined in: contexts/index.d.ts:5004
Replies to current message with a quote and a video
Parameters
| Parameter | Type |
|---|---|
params | object & 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
quoteWithVideoNote()
quoteWithVideoNote(
params):Promise<MessageContext<Bot>>
Defined in: contexts/index.d.ts:5012
Replies to current message with a quote and a video note
Parameters
| Parameter | Type |
|---|---|
params | object & 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
quoteWithVoice()
quoteWithVoice(
params):Promise<MessageContext<Bot>>
Defined in: contexts/index.d.ts:5016
Replies to current message with a quote and a voice
Parameters
| Parameter | Type |
|---|---|
params | object & 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
react()
react(
rawReactions,params?):Promise<true>
Defined in: contexts/index.d.ts:5086
Reacts to a message
Parameters
| Parameter | Type |
|---|---|
rawReactions | MaybeArray<TelegramReactionTypeEmojiEmoji | TelegramReactionType> |
params? | Optional<SetMessageReactionParams, "chat_id" | "message_id"> |
Returns
Promise<true>
Inherited from
reopenGeneralTopic()
reopenGeneralTopic(
params?):Promise<true>
Defined in: contexts/index.d.ts:5177
Reopens General topic
Parameters
| Parameter | Type |
|---|---|
params? | Optional<ReopenGeneralForumTopicParams, "chat_id"> |
Returns
Promise<true>
reopenTopic()
reopenTopic(
params?):Promise<true>
Defined in: contexts/index.d.ts:5175
Reopens topic
Parameters
| Parameter | Type |
|---|---|
params? | Optional<ReopenForumTopicParams, "chat_id" | "message_thread_id"> |
Returns
Promise<true>
reply()
reply(
text,params?):Promise<MessageContext<Bot>>
Defined in: contexts/index.d.ts:4956
Replies to current message
Parameters
| Parameter | Type |
|---|---|
text | string | { toString: string; } |
params? | WithPartialReplyParameters<Optional<SendMessageParams, "text" | "chat_id">> |
Returns
Promise<MessageContext<Bot>>
Inherited from
replyWithAnimation()
replyWithAnimation(
animation,params?):Promise<MessageContext<Bot>>
Defined in: contexts/index.d.ts:4966
Replies to current message with animation
Parameters
| Parameter | Type |
|---|---|
animation | string | Blob |
params? | WithPartialReplyParameters<Optional<SendAnimationParams, "animation" | "chat_id">> |
Returns
Promise<MessageContext<Bot>>
Inherited from
replyWithAudio()
replyWithAudio(
audio,params?):Promise<MessageContext<Bot>>
Defined in: contexts/index.d.ts:4962
Replies to current message with audio
Parameters
| Parameter | Type |
|---|---|
audio | string | Blob |
params? | WithPartialReplyParameters<Optional<SendAudioParams, "audio" | "chat_id">> |
Returns
Promise<MessageContext<Bot>>
Inherited from
replyWithContact()
replyWithContact(
params):Promise<MessageContext<Bot>>
Defined in: contexts/index.d.ts:4980
Replies to current message with contact
Parameters
| Parameter | Type |
|---|---|
params | WithPartialReplyParameters<Optional<SendContactParams, "chat_id">> |
Returns
Promise<MessageContext<Bot>>
Inherited from
replyWithDice()
replyWithDice(
emoji,params?):Promise<MessageContext<Bot>>
Defined in: contexts/index.d.ts:4986
Replies to current message with a dice
Parameters
| Parameter | Type |
|---|---|
emoji | SendDiceEmoji |
params? | WithPartialReplyParameters<Partial<SendDiceParams>> |
Returns
Promise<MessageContext<Bot>>
Inherited from
replyWithDocument()
replyWithDocument(
document,params?):Promise<MessageContext<Bot>>
Defined in: contexts/index.d.ts:4960
Replies to current message with document
Parameters
| Parameter | Type |
|---|---|
document | string | Blob |
params? | WithPartialReplyParameters<Optional<SendDocumentParams, "document" | "chat_id">> |
Returns
Promise<MessageContext<Bot>>
Inherited from
replyWithInvoice()
replyWithInvoice(
params):Promise<MessageContext<Bot>>
Defined in: contexts/index.d.ts:4976
Replies to current message with invoice
Parameters
| Parameter | Type |
|---|---|
params | WithPartialReplyParameters<Optional<SendInvoiceParams, "chat_id">> |
Returns
Promise<MessageContext<Bot>>
Inherited from
replyWithLocation()
replyWithLocation(
latitude,longitude,params?):Promise<MessageContext<Bot>>
Defined in: contexts/index.d.ts:4974
Replies to current message with location
Parameters
| Parameter | Type |
|---|---|
latitude | number |
longitude | number |
params? | WithPartialReplyParameters<Optional<SendLocationParams, "chat_id" | "latitude" | "longitude">> |
Returns
Promise<MessageContext<Bot>>
Inherited from
replyWithMediaGroup()
replyWithMediaGroup(
mediaGroup,params?):Promise<MessageContext<Bot>[]>
Defined in: contexts/index.d.ts:4972
Replies to current message with media group
Parameters
| Parameter | Type |
|---|---|
mediaGroup | (TelegramInputMediaAudio | TelegramInputMediaDocument | TelegramInputMediaPhoto | TelegramInputMediaVideo)[] |
params? | WithPartialReplyParameters<Optional<SendMediaGroupParams, "chat_id" | "media">> |
Returns
Promise<MessageContext<Bot>[]>
Inherited from
replyWithPhoto()
replyWithPhoto(
photo,params?):Promise<MessageContext<Bot>>
Defined in: contexts/index.d.ts:4958
Replies to current message with photo
Parameters
| Parameter | Type |
|---|---|
photo | string | Blob |
params? | WithPartialReplyParameters<Optional<SendPhotoParams, "photo" | "chat_id">> |
Returns
Promise<MessageContext<Bot>>
Inherited from
replyWithPoll()
replyWithPoll(
params):Promise<MessageContext<Bot>>
Defined in: contexts/index.d.ts:4982
Replies to current message with poll
Parameters
| Parameter | Type |
|---|---|
params | WithPartialReplyParameters<Optional<SendPollParams, "chat_id">> |
Returns
Promise<MessageContext<Bot>>
Inherited from
replyWithQuote()
replyWithQuote(
params):Promise<MessageContext<Bot>>
Defined in: contexts/index.d.ts:4988
Replies to current message with a quote
Parameters
| Parameter | Type |
|---|---|
params | object & 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
replyWithSticker()
replyWithSticker(
sticker,params?):Promise<MessageContext<Bot>>
Defined in: contexts/index.d.ts:4984
Replies to current message with sticker
Parameters
| Parameter | Type |
|---|---|
sticker | string | Blob |
params? | WithPartialReplyParameters<Optional<SendStickerParams, "sticker" | "chat_id">> |
Returns
Promise<MessageContext<Bot>>
Inherited from
replyWithVenue()
replyWithVenue(
params):Promise<MessageContext<Bot>>
Defined in: contexts/index.d.ts:4978
Replies to current message with venue
Parameters
| Parameter | Type |
|---|---|
params | WithPartialReplyParameters<Optional<SendVenueParams, "chat_id">> |
Returns
Promise<MessageContext<Bot>>
Inherited from
replyWithVideo()
replyWithVideo(
video,params?):Promise<MessageContext<Bot>>
Defined in: contexts/index.d.ts:4964
Replies to current message with video
Parameters
| Parameter | Type |
|---|---|
video | string | Blob |
params? | WithPartialReplyParameters<Optional<SendVideoParams, "video" | "chat_id">> |
Returns
Promise<MessageContext<Bot>>
Inherited from
replyWithVideoNote()
replyWithVideoNote(
videoNote,params?):Promise<MessageContext<Bot>>
Defined in: contexts/index.d.ts:4968
Replies to current message with video note
Parameters
| Parameter | Type |
|---|---|
videoNote | string | Blob |
params? | WithPartialReplyParameters<Optional<SendVideoNoteParams, "video_note" | "chat_id">> |
Returns
Promise<MessageContext<Bot>>
Inherited from
replyWithVoice()
replyWithVoice(
voice,params?):Promise<MessageContext<Bot>>
Defined in: contexts/index.d.ts:4970
Replies to current message with voice
Parameters
| Parameter | Type |
|---|---|
voice | string | Blob |
params? | WithPartialReplyParameters<Optional<SendVoiceParams, "voice" | "chat_id">> |
Returns
Promise<MessageContext<Bot>>
Inherited from
send()
send(
text,params?):Promise<MessageContext<Bot>>
Defined in: contexts/index.d.ts:4868
Sends message to current chat
Parameters
| Parameter | Type |
|---|---|
text | string | { toString: string; } |
params? | Optional<SendMessageParams, "text" | "chat_id"> |
Returns
Promise<MessageContext<Bot>>
Inherited from
sendAnimation()
sendAnimation(
animation,params?):Promise<MessageContext<Bot>>
Defined in: contexts/index.d.ts:4878
Sends animation to current chat
Parameters
| Parameter | Type |
|---|---|
animation | string | Blob |
params? | Optional<SendAnimationParams, "animation" | "chat_id"> |
Returns
Promise<MessageContext<Bot>>
Inherited from
sendAudio()
sendAudio(
audio,params?):Promise<MessageContext<Bot>>
Defined in: contexts/index.d.ts:4874
Sends audio to current chat
Parameters
| Parameter | Type |
|---|---|
audio | string | Blob |
params? | Optional<SendAudioParams, "audio" | "chat_id"> |
Returns
Promise<MessageContext<Bot>>
Inherited from
sendChatAction()
sendChatAction(
action,params?):Promise<true>
Defined in: contexts/index.d.ts:4902
Sends chat action to current chat
Parameters
| Parameter | Type |
|---|---|
action | SendChatActionAction |
params? | Optional<SendChatActionParams, "chat_id" | "action"> |
Returns
Promise<true>
Inherited from
sendChecklist()
sendChecklist(
params):Promise<MessageContext<Bot>>
Defined in: contexts/index.d.ts:4894
Sends checklist to current chat
Parameters
| Parameter | Type |
|---|---|
params | Optional<SendChecklistParams, "chat_id"> |
Returns
Promise<MessageContext<Bot>>
Inherited from
sendContact()
sendContact(
params):Promise<MessageContext<Bot>>
Defined in: contexts/index.d.ts:4890
Sends contact to current chat
Parameters
| Parameter | Type |
|---|---|
params | Optional<SendContactParams, "chat_id"> |
Returns
Promise<MessageContext<Bot>>
Inherited from
sendDice()
sendDice(
emoji,params?):Promise<MessageContext<Bot>>
Defined in: contexts/index.d.ts:4904
Sends dice
Parameters
| Parameter | Type |
|---|---|
emoji | SendDiceEmoji |
params? | Partial<SendDiceParams> |
Returns
Promise<MessageContext<Bot>>
Inherited from
sendDocument()
sendDocument(
document,params?):Promise<MessageContext<Bot>>
Defined in: contexts/index.d.ts:4872
Sends document to current chat
Parameters
| Parameter | Type |
|---|---|
document | string | Blob |
params? | Optional<SendDocumentParams, "document" | "chat_id"> |
Returns
Promise<MessageContext<Bot>>
Inherited from
sendInvoice()
sendInvoice(
params):Promise<MessageContext<Bot>>
Defined in: contexts/index.d.ts:4886
Sends invoice to current user
Parameters
| Parameter | Type |
|---|---|
params | Optional<SendInvoiceParams, "chat_id"> |
Returns
Promise<MessageContext<Bot>>
Inherited from
sendLocation()
sendLocation(
latitude,longitude,params?):Promise<MessageContext<Bot>>
Defined in: contexts/index.d.ts:4884
Sends location to current chat
Parameters
| Parameter | Type |
|---|---|
latitude | number |
longitude | number |
params? | Optional<SendLocationParams, "chat_id" | "latitude" | "longitude"> |
Returns
Promise<MessageContext<Bot>>
Inherited from
sendMedia()
sendMedia<
T>(query):ReturnType<Textends"animation"? (animation,params?) =>Promise<MessageContext<Bot>> :Textends"audio"? (audio,params?) =>Promise<MessageContext<Bot>> :Textends"document"? (document,params?) =>Promise<MessageContext<Bot>> :Textends"photo"? (photo,params?) =>Promise<MessageContext<Bot>> :Textends"sticker"? (sticker,params?) =>Promise<MessageContext<Bot>> :Textends"video_note"? (videoNote,params?) =>Promise<MessageContext<Bot>> :Textends"video"? (video,params?) =>Promise<MessageContext<...>> :Textends"voice"? (voice,params?) =>Promise<...> : () =>never>
Defined in: contexts/index.d.ts:4921
Automatically uses correct media method to send media
Type Parameters
| Type Parameter |
|---|
T extends string |
Parameters
| Parameter | Type |
|---|---|
query | object & 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
context.sendMedia({
type: 'photo',
photo: MediaUpload.path('./image.png'),
caption: 'good image yes yes'
})Inherited from
sendMediaGroup()
sendMediaGroup(
mediaGroup,params?):Promise<MessageContext<Bot>[]>
Defined in: contexts/index.d.ts:4908
Sends media group to current chat
Parameters
| Parameter | Type |
|---|---|
mediaGroup | (TelegramInputMediaAudio | TelegramInputMediaDocument | TelegramInputMediaPhoto | TelegramInputMediaVideo)[] |
params? | Optional<SendMediaGroupParams, "chat_id" | "media"> |
Returns
Promise<MessageContext<Bot>[]>
Inherited from
sendMessageDraft()
sendMessageDraft(
params):Promise<true>
Defined in: contexts/index.d.ts:4900
Sends a message draft to the current private chat
Parameters
| Parameter | Type |
|---|---|
params | Optional<SendMessageDraftParams, "chat_id"> |
Returns
Promise<true>
Inherited from
sendPaidMedia()
sendPaidMedia(
paidMedia,starCount,params?):Promise<MessageContext<Bot>>
Defined in: contexts/index.d.ts:4906
Sends paid media to current chat
Parameters
| Parameter | Type |
|---|---|
paidMedia | TelegramInputPaidMedia[] |
starCount | number |
params? | Optional<SendPaidMediaParams, "chat_id" | "media" | "star_count"> |
Returns
Promise<MessageContext<Bot>>
Inherited from
sendPhoto()
sendPhoto(
photo,params?):Promise<MessageContext<Bot>>
Defined in: contexts/index.d.ts:4870
Sends photo to current chat
Parameters
| Parameter | Type |
|---|---|
photo | string | Blob |
params? | Optional<SendPhotoParams, "photo" | "chat_id"> |
Returns
Promise<MessageContext<Bot>>
Inherited from
sendPoll()
sendPoll(
params):Promise<MessageContext<Bot>>
Defined in: contexts/index.d.ts:4892
Sends poll to current chat
Parameters
| Parameter | Type |
|---|---|
params | Optional<SendPollParams, "chat_id"> |
Returns
Promise<MessageContext<Bot>>
Inherited from
sendSticker()
sendSticker(
sticker,params?):Promise<MessageContext<Bot>>
Defined in: contexts/index.d.ts:4896
Sends sticker
Parameters
| Parameter | Type |
|---|---|
sticker | string | Blob |
params? | Optional<SendStickerParams, "sticker" | "chat_id"> |
Returns
Promise<MessageContext<Bot>>
Inherited from
sendVenue()
sendVenue(
params):Promise<MessageContext<Bot>>
Defined in: contexts/index.d.ts:4888
Sends venue to current chat
Parameters
| Parameter | Type |
|---|---|
params | Optional<SendVenueParams, "chat_id"> |
Returns
Promise<MessageContext<Bot>>
Inherited from
sendVideo()
sendVideo(
video,params?):Promise<MessageContext<Bot>>
Defined in: contexts/index.d.ts:4876
Sends video to current chat
Parameters
| Parameter | Type |
|---|---|
video | string | Blob |
params? | Optional<SendVideoParams, "video" | "chat_id"> |
Returns
Promise<MessageContext<Bot>>
Inherited from
sendVideoNote()
sendVideoNote(
videoNote,params?):Promise<MessageContext<Bot>>
Defined in: contexts/index.d.ts:4880
Sends video note to current chat
Parameters
| Parameter | Type |
|---|---|
videoNote | string | Blob |
params? | Optional<SendVideoNoteParams, "video_note" | "chat_id"> |
Returns
Promise<MessageContext<Bot>>
Inherited from
sendVoice()
sendVoice(
voice,params?):Promise<MessageContext<Bot>>
Defined in: contexts/index.d.ts:4882
Sends voice to current chat
Parameters
| Parameter | Type |
|---|---|
voice | string | Blob |
params? | Optional<SendVoiceParams, "voice" | "chat_id"> |
Returns
Promise<MessageContext<Bot>>
Inherited from
setReaction()
setReaction(
reaction,params?):Promise<true>
Defined in: contexts/index.d.ts:5082
Sets a reaction on a message
Parameters
| Parameter | Type |
|---|---|
reaction | TelegramReactionTypeEmojiEmoji | TelegramReactionType |
params? | Optional<SetMessageReactionParams, "chat_id" | "message_id"> |
Returns
Promise<true>
Inherited from
setReactions()
setReactions(
rawReactions,params?):Promise<true>
Defined in: contexts/index.d.ts:5084
Sets multiple amount of reactions on a message
Parameters
| Parameter | Type |
|---|---|
rawReactions | (TelegramReactionTypeEmojiEmoji | TelegramReactionType)[] |
params? | Optional<SetMessageReactionParams, "chat_id" | "message_id"> |
Returns
Promise<true>
Inherited from
stopLiveLocation()
stopLiveLocation(
params?):Promise<true|MessageContext<Bot>>
Defined in: contexts/index.d.ts:5055
Stops current message live location. An alias for stopMessageLiveLocation
Parameters
| Parameter | Type |
|---|---|
params? | StopMessageLiveLocationParams |
Returns
Promise<true | MessageContext<Bot>>
Inherited from
stopMessageLiveLocation()
stopMessageLiveLocation(
params?):Promise<true|MessageContext<Bot>>
Defined in: contexts/index.d.ts:5053
Stops current message live location
Parameters
| Parameter | Type |
|---|---|
params? | StopMessageLiveLocationParams |
Returns
Promise<true | MessageContext<Bot>>
Inherited from
NodeMixin.stopMessageLiveLocation
stopPoll()
stopPoll(
messageId,params?):Promise<Poll>
Defined in: contexts/index.d.ts:4898
Stops poll in current chat
Parameters
| Parameter | Type |
|---|---|
messageId | number |
params? | Partial<StopPollParams> |
Returns
Promise<Poll>
Inherited from
streamMessage()
streamMessage(
stream,options?):Promise<MessageContext<Bot>[]>
Defined in: contexts/index.d.ts:4936
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
| Parameter | Type |
|---|---|
stream | Iterable<MessageDraftPiece, any, any> | AsyncIterable<MessageDraftPiece, any, any> |
options? | StreamMessageOptions |
Returns
Promise<MessageContext<Bot>[]>
Example
// Stream from an async generator (e.g., LLM output)
const messages = await context.streamMessage(llmStream);Inherited from
unhideGeneralTopic()
unhideGeneralTopic(
params?):Promise<true>
Defined in: contexts/index.d.ts:5187
Unhides General topic
Parameters
| Parameter | Type |
|---|---|
params? | Optional<UnhideGeneralForumTopicParams, "chat_id"> |
Returns
Promise<true>
unpinAllGeneralTopicMessages()
unpinAllGeneralTopicMessages(
params?):Promise<true>
Defined in: contexts/index.d.ts:5183
Clears the list of pinned messages in a General topic
Parameters
| Parameter | Type |
|---|---|
params? | Optional<UnpinAllGeneralForumTopicMessagesParams, "chat_id"> |
Returns
Promise<true>
unpinAllTopicMessages()
unpinAllTopicMessages(
params?):Promise<true>
Defined in: contexts/index.d.ts:5181
Clears the list of pinned messages
Parameters
| Parameter | Type |
|---|---|
params? | Optional<UnpinAllForumTopicMessagesParams, "chat_id" | "message_thread_id"> |
Returns
Promise<true>