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.
Особенности StaticGram
video_start_timestamp, message_effect_id, suggested_post_parameters ignored
Параметры
Unique identifier for the target chat or username of the target bot, supergroup or channel in the format
@usernameUnique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
Identifier of the direct messages topic to which the message will be forwarded; required if the message is forwarded to a direct messages chat
Unique identifier for the chat where the original message was sent (or username of the target bot, supergroup or channel in the format
@username)New start timestamp for the forwarded video in the message
Sends the message silently. Users will receive a notification with no sound.
Protects the contents of the forwarded message from forwarding and saving
Unique 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 identifier in the chat specified in from_chat_id
Пример запроса
curl
curl "https://api.staticgram.top/bot$TOKEN/forwardMessage" \
-H "Content-Type: application/json" \
-d '{
"chat_id": 123456789,
"from_chat_id": 123456789,
"message_id": 42
}'aiogram 3
from aiogram import Bot
from aiogram.client.session.aiohttp import AiohttpSession
from aiogram.client.telegram import TelegramAPIServer
session = AiohttpSession(api=TelegramAPIServer.from_base("https://api.staticgram.top"))
bot = Bot(TOKEN, session=session)
result = await bot.forward_message(chat_id=123456789, from_chat_id=123456789, message_id=42)JavaScript
const res = await fetch(`https://api.staticgram.top/bot${TOKEN}/forwardMessage`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"chat_id": 123456789,
"from_chat_id": 123456789,
"message_id": 42
}),
});
const data = await res.json();Ответ (Message)
JSON
{
"ok": true,
"result": {
"message_id": 1,
"date": 1790000000,
"chat": {
"id": 1780243423,
"type": "private"
}
}
}