export Class
Message ​
extends ​
BaseClass
<Message
, MessagePacket
>
implements ​
Omit
<MessagePacket
, "entities"
| "caption_entities"
>
Constructor ​
new Message( client, packet )
Parameter | Type | Description |
---|---|---|
client | Client | |
packet | MessagePacket |
Properties ​
get chat : Chat
​
get command : boolean
​
get entities : MessageEntitiesStore
​
get from : Chat
| User
​
get id : number
​
get language_code : undefined
| string
​
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
​
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
​
link_preview_options? : LinkPreviewOptions
​
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
​
paid_media? : PaidMediaInfo
​
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 ) ​
Parameter | Type | Description |
---|---|---|
chat_id | string | number | The chat to copy the message to. |
payload | CopyMessagePayload | Additional data for copying. |
Copies the message to a chat.
Returns:
Promise
<boolean
>
createCallbackCollector( options, filter ) ​
Parameter | Type | Description |
---|---|---|
options | CallbackCollectorOptions | The options for the collector, the filter is unoverridable. |
filter? | Function | Additional conditions to the filter. |
Creates a callback query collector to the chat of the message while filtering only relevant to the message.
Returns:
CallbackCollector
asyncdelete( ) ​
Deletes the message.
Returns:
Promise
<boolean
>
asyncedit( payload ) ​
Parameter | Type | Description |
---|---|---|
payload | MessageEditPayload | The content of what the message will contain. |
Edits the message.
Returns:
Promise
<boolean
|Message
>
asynceditCaption( payload ) ​
Parameter | Type | Description |
---|---|---|
payload | MessagecaptionEditPayload | The content of what the caption will contain. |
Edits the caption of the message.
Returns:
Promise
<boolean
|Message
>
asynceditMedia( payload ) ​
Parameter | Type | Description |
---|---|---|
payload | MessageMediaEditPayload | The content of what the media will contain. |
Edits the media of the message.
Returns:
Promise
<boolean
|Message
>
asynceditReplyMarkup( payload ) ​
Parameter | Type | Description |
---|---|---|
payload | MessageReplyMarkupEditPayload | The content of what the reply markup will contain. |
Edits only the reply markup of the message.
Returns:
Promise
<boolean
|Message
>
asyncforward( chat_id, payload ) ​
Parameter | Type | Description |
---|---|---|
chat_id | string | number | The chat to forward the message to. |
payload | ForwardPayload | Additional data for forwarding. |
Forwards the message to a chat.
Returns:
Promise
<boolean
>
asyncpin( disable_notification, business_connection_id ) ​
Parameter | Type | Description |
---|---|---|
disable_notification? | boolean | |
business_connection_id? | string |
Pins the message.
Returns:
Promise
<boolean
>
asyncreply( pointer, payload, form_data ) ​
Parameter | Type | Description |
---|---|---|
pointer | MessagePayloadMethod | The type or method of the message. |
payload | Partial <MessagePayload > | What the message will contain. |
form_data? | FormDataBuilder | FormData for uploading a media with the message. |
Replies a message to the current message.
Returns:
Promise
<boolean
|Message
>
asyncreplyInvoice( id ) ​
Parameter | Type | Description |
---|---|---|
id | string | The id of the invoice. |
Replies an invoice message that must be an invoice and not a link to the currenct message.
Returns:
Promise
<boolean
|Message
>
asyncreplyText( text ) ​
Parameter | Type | Description |
---|---|---|
text | string | What the text will contain. |
Replies a text message to the current message.
Returns:
Promise
<boolean
|Message
>
asyncsetReaction( reaction, is_big ) ​
Parameter | Type | Description |
---|---|---|
reaction | Reactions | The reactions. |
is_big? | boolean | Pass True to set the reaction with a big animation |
Sets the reaction of the message.
Returns:
Promise
<boolean
>
asyncunpin( business_connection_id ) ​
Parameter | Type | Description |
---|---|---|
business_connection_id | string |
Unpins the message.
Returns:
Promise
<boolean
>