forwardMessage()
Use this method to forward messages of any kind. Service messages and messages with protected content can't be forwarded. On success, the sent Message is returned.
parameters
| parameter | type | required | description |
|---|---|---|---|
chat_id | number | string | required | Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username |
message_thread_id | number | optional | Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only |
direct_messages_topic_id | number | optional | Identifier of the direct messages topic to which the message will be forwarded; required if the message is forwarded to a direct messages chat |
from_chat_id | number | string | required | Unique identifier for the chat where the original message was sent (or username of the target bot, supergroup or channel in the format @username) |
video_start_timestamp | number | optional | New start timestamp for the forwarded video in the message |
disable_notification | boolean | optional | Sends the message silently. Users will receive a notification with no sound. |
protect_content | boolean | optional | Protects the contents of the forwarded message from forwarding and saving |
message_effect_id | string | optional | Unique identifier of the message effect to be added to the message; only available when forwarding to private chats |
suggested_post_parameters | SuggestedPostParameters | optional | A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only |
message_id | number | required | Message identifier in the chat specified in from_chat_id |
returns
usage in yaebal
not (yet) hard-typed on Api — call it through the generic .call<T>() escape hatch documented in @yaebal/types.
import type { ForwardMessageParams, Message } from "@yaebal/types";
await bot.api.call<Message>("forwardMessage", {
chat_id: 123456789,
from_chat_id: 123456789,
message_id: 1,
} satisfies ForwardMessageParams);official Bot API docs: https://core.telegram.org/bots/api/#forwardmessage