sendMessageПоддерживается
Use this method to send text messages. On success, the sent Message is returned.
quote / cross-chat replies, message_thread_id (also private-chat topics), protect_content, message_effect_id (private chats), link preview is_disabled/show_above_text, any keyboard; allow_paid_broadcast ignored; direct_messages_topic_id / suggested_post_parameters for channel direct messages chats (see "Channel direct messages"; elsewhere → 400); business_connection_id : sent as the business account; needs can_reply and a chat with an incoming message in the last 24 hours (else BUSINESS_PEER_USAGE_MISSING); reply has from = account, sender_business_bot, business_connection_id; the account's copy carries MTProto via_business_bot_id; callback buttons on business messages go to the bot (callback_query with a business Message, MTProto updateBusinessBotCallbackQuery)
Параметры
@usernameПример запроса
curl "https://api.staticgram.top/bot$TOKEN/sendMessage" \
-H "Content-Type: application/json" \
-d '{
"chat_id": 123456789,
"text": "Привет из StaticGram!"
}'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.send_message(chat_id=123456789, text="Привет из StaticGram!")const res = await fetch(`https://api.staticgram.top/bot${TOKEN}/sendMessage`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"chat_id": 123456789,
"text": "Привет из StaticGram!"
}),
});
const data = await res.json();Ответ (Message)
{
"ok": true,
"result": {
"message_id": 1,
"date": 1790000000,
"chat": {
"id": 1780243423,
"type": "private"
}
}
}