setChatPhotoПоддерживается
Use this method to set a new profile photo for the chat. Photos can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success.
Особенности StaticGram
multipart upload (or an existing photo file_id of this server); emits new_chat_photo
Параметры
Пример запроса
curl
curl "https://api.staticgram.top/bot$TOKEN/setChatPhoto" \
-F 'chat_id=123456789' \
-F "photo=@photo.jpg"aiogram 3
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.set_chat_photo(chat_id=123456789, photo=FSInputFile("photo.jpg"))JavaScript
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}/setChatPhoto`, {
method: "POST",
body: form,
});
const data = await res.json();Ответ (True)
JSON
{
"ok": true,
"result": true
}