Skip to content

export Class

Message ​

extends ​

BaseClass<Message, MessagePacket>

implements ​

Omit<MessagePacket, "entities" | "caption_entities">

Constructor ​

ts
new Message( client, packet )
ParameterTypeDescription
clientClient
packetMessagePacket

Properties ​

get chat : Chat ​

get command : boolean ​

get entities : MessageEntitiesStore ​

get id : number ​

get manager : MessagesManager ​

get member : undefined | Message ​

get sender_chat : undefined | Chat ​

get topic : undefined | ForumTopic ​

get user : undefined | User ​

animation? : Animation ​

audio? : Audio ​

author_signature? : string ​

boost_added? : ChatBoostAdded ​

business_connection_id? : string ​

caption? : string ​

caption_entities? : MessageEntityPayload[] ​

channel_chat_created? : true ​

chat_background_set? : ChatBackground ​

chat_shared? : ChatShared ​

readonly client : Client ​

connected_website? : string ​

contact? : ContactPayload ​

date : number ​

delete_chat_photo? : true ​

dice? : DicePayload ​

document? : Document ​

edit_date? : number ​

edited? : boolean ​

effect_id? : string ​

external_reply? : ExternalReplyInfo ​

forum_topic_closed? : ForumTopicClosed ​

forum_topic_created? : ForumTopicCreated ​

forum_topic_edited? : ForumTopicEdited ​

forum_topic_reopened? : ForumTopicReopened ​

forward_origin? : MessageOrigin ​

from? : UserPacket ​

game? : GamePacket ​

general_forum_topic_hidden? : GeneralForumTopicHidden ​

general_forum_topic_unhidden? : GeneralForumTopicUnhidden ​

giveaway? : Giveaway ​

giveaway_completed? : GiveawayCompleted ​

giveaway_created? : GiveawayCreated ​

giveaway_winners? : GiveawayWinners ​

group_chat_created? : true ​

has_media_spoiler? : true ​

has_protected_content? : true ​

invoice? : InvoicePacket ​

is_automatic_forward? : true ​

is_from_offline? : true ​

is_topic_message? : true ​

left_chat_member? : UserPacket ​

location? : Location ​

media_group_id? : string ​

message_auto_delete_timer_changed? : MessageAutoDeleteTimerChanged ​

message_id : number ​

message_thread_id? : number ​

migrate_from_chat_id? : number ​

migrate_to_chat_id? : number ​

new_chat_members? : UserPacket[] ​

new_chat_photo? : PhotoSize[] ​

new_chat_title? : string ​

passport_data? : PassportData ​

photo? : PhotoSize[] ​

pinned_message? : InaccessibleMessage ​

poll? : PollPacket ​

proximity_alert_triggered? : ProximityAlertTriggered ​

quote? : TextQuote ​

reactions : MessageReactions ​

refunded_payment? : RefundedPaymentPacket ​

reply_markup? : InlineKeyboardMarkup ​

reply_to_message? : Message ​

reply_to_story? : StoryPacket ​

sender_boost_count? : number ​

sender_business_bot? : UserPacket ​

show_caption_above_media? : true ​

sticker? : Sticker ​

story? : StoryPacket ​

successful_payment? : SuccessfulPayment ​

supergroup_chat_created? : true ​

text? : string ​

users_shared? : UsersShared ​

venue? : VenuePayload ​

via_bot? : UserPacket ​

video? : Video ​

video_chat_ended? : VideoChatEnded ​

video_chat_participants_invited? : VideoChatParticipantsInvited ​

video_chat_scheduled? : VideoChatScheduled ​

video_chat_started? : VideoChatStarted ​

video_note? : VideoNote ​

voice? : Voice ​

web_app_data? : WebAppData ​

write_access_allowed? : WriteAccessAllowed ​

Methods ​

asynccopy( chat_id, payload ) ​

Copies the message to a chat.

ParameterTypeDescription
chat_idstring | numberThe chat to copy the message to.
payloadCopyMessagePayloadAdditional data for copying.

Returns: Promise<boolean>

createCallbackCollector( options ) ​

ParameterTypeDescription
optionsCallbackCollectorOptions

Returns: CallbackCollector

asyncdelete( ) ​

Deletes the message.

Returns: Promise<boolean>

asyncedit( payload ) ​

Edits the message.

ParameterTypeDescription
payloadMessageEditPayloadThe content of what the message will contain.

Returns: Promise<boolean | Message>

asynceditCaption( payload ) ​

Edits the caption of the message.

ParameterTypeDescription
payloadMessagecaptionEditPayloadThe content of what the caption will contain.

Returns: Promise<boolean | Message>

asynceditMedia( payload ) ​

Edits the media of the message.

ParameterTypeDescription
payloadMessageMediaEditPayloadThe content of what the media will contain.

Returns: Promise<boolean | Message>

asynceditReplyMarkup( payload ) ​

Edits only the reply markup of the message.

ParameterTypeDescription
payloadMessageReplyMarkupEditPayloadThe content of what the reply markup will contain.

Returns: Promise<boolean | Message>

asyncforward( chat_id, payload ) ​

Forwards the message to a chat.

ParameterTypeDescription
chat_idstring | numberThe chat to forward the message to.
payloadForwardPayloadAdditional data for forwarding.

Returns: Promise<boolean>

asyncpin( disable_notification, business_connection_id ) ​

Pins the message.

ParameterTypeDescription
disable_notification?boolean
business_connection_id?string

Returns: Promise<boolean>

asyncreply( pointer, payload, form_data ) ​

Replies a message to the current message.

ParameterTypeDescription
pointerMessagePayloadMethodThe type or method of the message.
payloadPartial<MessagePayload>What the message will contain.
form_data?FormDataBuilderFormData for uploading a media with the message.

Returns: Promise<boolean | Message>

asyncreplyInvoice( id ) ​

Replies an invoice message to the currenct message. Uses auxiliaries.

ParameterTypeDescription
idstringThe id of the invoice.

Returns: Promise<boolean | Message>

asyncreplyText( text ) ​

Replies a text message to the current message.

ParameterTypeDescription
textstringWhat the text will contain.

Returns: Promise<boolean | Message>

asyncsetReaction( reaction, is_big ) ​

Sets the reaction of the message.

ParameterTypeDescription
reactionReactionsThe reactions.
is_big?booleanPass True to set the reaction with a big animation

Returns: Promise<boolean>

asyncunpin( business_connection_id ) ​

Unpins the message.

ParameterTypeDescription
business_connection_idstring

Returns: Promise<boolean>