Message
classA message in a chat.
Declaration
declare class Message extends Base<T.Message> Properties
get replyToMessage(): Message | undefined;The message this message replies to, if any.
Methods
copy(chatId: number | string, options?: Without<CopyMessageParams, 'from_chat_id' | 'message_id'>): Promise<T.MessageId>;| Parameter | Type |
|---|---|
| chatId | number | string |
| options? | Without<CopyMessageParams, 'from_chat_id' | 'message_id'> |
Returns Promise<T.MessageId>
Copy this message to another chat (sent as a new message, not a forward).
edit(text: string, options?: Without<EditMessageTextParams, 'text' | 'message_id'>): Promise<Message | boolean>;| Parameter | Type |
|---|---|
| text | string |
| options? | Without<EditMessageTextParams, 'text' | 'message_id'> |
Returns Promise<Message | boolean>
Edit the text of this message (must be a message the bot sent).
forward(chatId: number | string, options?: Without<ForwardMessageParams, 'from_chat_id' | 'message_id'>): Promise<Message>;| Parameter | Type |
|---|---|
| chatId | number | string |
| options? | Without<ForwardMessageParams, 'from_chat_id' | 'message_id'> |
Returns Promise<Message>
Forward this message to another chat.
react(reaction: string | T.ReactionType[]): Promise<boolean>;| Parameter | Type |
|---|---|
| reaction | string | T.ReactionType[] |
Returns Promise<boolean>
Set the bot's reaction to this message (pass a single emoji, or an array of reactions).
reply(text: string, options?: Without<SendMessageParams, 'text'>): Promise<Message>;| Parameter | Type |
|---|---|
| text | string |
| options? | Without<SendMessageParams, 'text'> |
Returns Promise<Message>
Reply to this message in the same chat.