forwardMessage

Raw MD
Use this method to forward messages of any kind

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_idInteger or StringYesUnique identifier for the target chat or username of the target bot, supergroup or channel in the format @username
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_idInteger or StringYesUnique 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_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
suggested_post_parametersSuggestedPostParametersOptionalA JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only
message_idIntegerYesMessage identifier in the chat specified in from_chat_id

Example

PHP — Call forwardMessage on Botlify Cloud
<?php
// ── Botlify Cloud .env — auto-injected, never hardcode secrets ──
$BOT_TOKEN     = getenv('BOT_TOKEN');     // Telegram bot token from @BotFather
$ADMIN_CHAT_ID = getenv('ADMIN_CHAT_ID'); // Your numeric admin Telegram user ID
$BOT_USERNAME  = getenv('BOT_USERNAME');  // Bot username without @

$resp = bot('forwardMessage', [
    'chat_id' => $chatId,
    'from_chat_id' => $userId,
    'message_id' => $messageId,
]);

if ($resp['ok'] ?? false) {
    $result = $resp['result']; // handle the response
}
Botlify Cloud Runtime
Credentials are auto-injected in .env — always load them with getenv(): BOT_TOKEN, ADMIN_CHAT_ID, BOT_USERNAME. Main database: database.db (SQLite, WAL mode). Runtime errors: error.log. Quick test: send to $ADMIN_CHAT_ID. Full details: Runtime Reference.