forwardMessage
Returns: MessageOfficial docs ↗
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
chat_idIntegerStringRequiredUnique identifier for the target chat or username of the target channel (in the format
@channelusername)message_thread_idIntegerOptionalUnique 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_idIntegerOptionalIdentifier 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_idIntegerStringRequiredUnique identifier for the chat where the original message was sent (or channel username in the format
@channelusername)video_start_timestampIntegerOptionalNew 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
A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only
message_idIntegerRequiredMessage identifier in the chat specified in from\chat\id
Returns
On success, the Message object is returned.
GramIO Usage
ts
// Forward every user message to an admin/moderation chat
const ADMIN_CHAT_ID = -1001234567890;
bot.on("message", async (ctx) => {
await bot.api.forwardMessage({
chat_id: ADMIN_CHAT_ID,
from_chat_id: ctx.chatId,
message_id: ctx.id,
});
});ts
// Forward a specific message from a channel to another chat
await bot.api.forwardMessage({
chat_id: -1009876543210, // destination chat
from_chat_id: "@sourcechannel",
message_id: 501,
});ts
// Forward silently with protected content (prevents re-forwarding)
await bot.api.forwardMessage({
chat_id: -1001234567890,
from_chat_id: -1009876543210,
message_id: 42,
disable_notification: true,
protect_content: true,
});ts
// Forward into a specific forum topic thread
await bot.api.forwardMessage({
chat_id: -1001234567890, // forum supergroup
message_thread_id: 5, // topic ID
from_chat_id: "@mychannel",
message_id: 99,
});Errors
| Code | Error | Cause |
|---|---|---|
| 400 | Bad Request: chat not found | Target chat_id is invalid or the bot is not a member — verify the bot was added to the destination chat |
| 400 | Bad Request: message to forward not found | message_id doesn't exist in from_chat_id — verify both IDs before forwarding |
| 400 | Bad Request: CHAT_FORWARD_RESTRICT | The source chat has disabled message forwarding — the content cannot be forwarded from it |
| 400 | Bad Request: message can't be forwarded | Message is a service message (join, leave, pin, etc.) — service messages cannot be forwarded |
| 403 | Forbidden: bot was blocked by the user | User blocked the bot — catch and mark user as inactive |
| 403 | Forbidden: bot is not a member of the channel chat | Bot is not in the target channel — add it first |
| 429 | Too Many Requests: retry after N | Rate limit hit — check retry_after, use auto-retry plugin |
TIP
Use GramIO's auto-retry plugin to handle 429 errors automatically.
Tips & Gotchas
- Forwarded messages show "Forwarded from" attribution. To forward without showing the original source, use
copyMessageinstead — it copies the content without attribution. - Service messages can't be forwarded. Join/leave events, pinned message notifications, and similar service messages always fail — use
isServiceMessage()to filter them out. - Messages with
protect_contentcan't be forwarded. If the original message was sent withprotect_content: true, it's permanently blocked from forwarding. protect_contenton the forwarded copy is independent. Settingprotect_content: truein yourforwardMessagecall prevents recipients from re-forwarding the copy you send.message_effect_idonly works for private chats. Reaction effects on forwarded messages are restricted to private conversations — they're silently ignored in groups and channels.video_start_timestamplets you deep-link into video messages. Specify a second offset to start playback partway through the video when forwarding.- Use
message_thread_idfor forum supergroups. Without it, the message goes to the general/unthreaded area; with it, it lands in the specified topic.
See Also
- forwardMessages — forward multiple messages in a single call (preserves album grouping)
- copyMessage — copy a message without "Forwarded from" attribution
- copyMessages — copy multiple messages without attribution
- Message — the full object returned on success
- MessageOrigin — origin info available in forwarded message objects
- auto-retry plugin — automatic
429retry handling