Available methods

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

parametertyperequireddescription
chat_idnumber | stringrequiredUnique identifier for the target chat or username of the target bot, supergroup or channel in the format @username
message_thread_idnumberoptionalUnique 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_idnumberoptionalIdentifier 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_idnumber | stringrequiredUnique 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_timestampnumberoptionalNew start timestamp for the forwarded video in the message
disable_notificationbooleanoptionalSends the message silently. Users will receive a notification with no sound.
protect_contentbooleanoptionalProtects the contents of the forwarded message from forwarding and saving
message_effect_idstringoptionalUnique identifier of the message effect to be added to the message; only available when forwarding to private chats
suggested_post_parametersSuggestedPostParametersoptionalA JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only
message_idnumberrequiredMessage identifier in the chat specified in from_chat_id

returns

Message

usage in yaebal

not (yet) hard-typed on Api — call it through the generic .call<T>() escape hatch documented in @yaebal/types.

bot.ts
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);