StaticGramBot API

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

Параметры

chat_idInteger or Stringобязательный
Unique identifier for the target chat or username of the target bot, supergroup or channel in the format @username
message_thread_idIntegerнеобязательный
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_idIntegerнеобязательный
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_idInteger or Stringобязательный
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_timestampIntegerнеобязательный
New start timestamp for the forwarded video in the message
disable_notificationBooleanнеобязательный
Sends the message silently. Users will receive a notification with no sound.
protect_contentBooleanнеобязательный
Protects the contents of the forwarded message from forwarding and saving
message_effect_idStringнеобязательный
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_idIntegerобязательный
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"
    }
  }
}

Описания методов и типов взяты из официальной документации Telegram Bot API (Bot API 10.3). Адрес API: https://api.staticgram.top