sendPhotoПоддерживается
Use this method to send photos. On success, the sent Message is returned.
photo/document/audio/video/animation/voice/video_note/sticker/live_photo via upload, file_id or URL; has_spoiler, show_caption_above_media, reply/quote/thread/protect/effect honoured; thumbnail (upload/attach:// only, when the main file is uploaded; normalised to JPEG ≤320 px, >200 KB ignored) stored as the document thumb (Bot API thumbnail + MTProto document.thumbs); sendVideo cover (upload/photo file_id/URL) + start_timestamp → Video.cover/start_timestamp and MTProto messageMediaDocument.video_cover/video_timestamp; supports_streaming → documentAttributeVideo.supports_streaming; sendDocument disable_content_type_detection (GIF uploads become animations unless disabled); sendSticker uploads are content-probed (TGS/WEBM/WEBP, PNG/JPEG→WEBP); uploaded video/video_note/animation/live photo videos are probed (MP4/MOV boxes, WEBM): missing width/height/duration and an empty or application/octet-stream MIME type come from the file (values passed by the bot win), unreadable files keep 1×1/1 s; an upload without a usable Content-Type (application/octet-stream) gets the MIME type of its file name extension; photos keep one stored rendition per size letter (no server-side downscaling: m and x share the file); message_thread_id also routes into private-chat topics; direct_messages_topic_id / suggested_post_parameters as sendMessage; business_connection_id supported (see sendMessage)
Параметры
@usernameПример запроса
curl "https://api.staticgram.top/bot$TOKEN/sendPhoto" \
-F 'chat_id=123456789' \
-F "photo=@photo.jpg"from aiogram import Bot
from aiogram.client.session.aiohttp import AiohttpSession
from aiogram.client.telegram import TelegramAPIServer
from aiogram.types import FSInputFile
session = AiohttpSession(api=TelegramAPIServer.from_base("https://api.staticgram.top"))
bot = Bot(TOKEN, session=session)
result = await bot.send_photo(chat_id=123456789, photo=FSInputFile("photo.jpg"))const form = new FormData();
form.append("chat_id", "123456789");
form.append("photo", fileBlob, "photo.jpg");
const res = await fetch(`https://api.staticgram.top/bot${TOKEN}/sendPhoto`, {
method: "POST",
body: form,
});
const data = await res.json();Ответ (Message)
{
"ok": true,
"result": {
"message_id": 1,
"date": 1790000000,
"chat": {
"id": 1780243423,
"type": "private"
}
}
}