StaticGramBot API

addStickerToSetПоддерживается

Use this method to add a new sticker to a set created by the bot. Emoji sticker sets can have up to 200 stickers. Other sticker sets can have up to 120 stickers. Returns True on success.

Особенности StaticGram

120 (custom emoji: 200) per set

Параметры

user_idIntegerобязательный
User identifier of sticker set owner
nameStringобязательный
Sticker set name
stickerInputStickerобязательный
A JSON-serialized object with information about the added sticker. If exactly the same sticker had already been added to the set, then the set isn't changed.

Пример запроса

curl
curl "https://api.staticgram.top/bot$TOKEN/addStickerToSet" \
  -H "Content-Type: application/json" \
  -d '{
    "user_id": 123456789,
    "name": "my_set_by_mybot",
    "sticker": "CAACAgIAAxkBAA..."
  }'
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.add_sticker_to_set(
    user_id=123456789,
    name="my_set_by_mybot",
    sticker="CAACAgIAAxkBAA...",
)
JavaScript
const res = await fetch(`https://api.staticgram.top/bot${TOKEN}/addStickerToSet`, {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "user_id": 123456789,
    "name": "my_set_by_mybot",
    "sticker": "CAACAgIAAxkBAA..."
  }),
});
const data = await res.json();

Ответ (True)

JSON
{
  "ok": true,
  "result": true
}

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