StaticGramBot API

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

Use this method to create a new sticker set owned by a user. The bot will be able to edit the sticker set thus created. Returns True on success.

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

owner = user_id, editable by the creating bot (set.software = botapi:<bot_id>), _by_<bot_username> suffix enforced; multi-emoji, keywords, mask_position, needs_repainting; ≤50 stickers

Параметры

user_idIntegerобязательный
User identifier of created sticker set owner
nameStringобязательный
Short name of sticker set, to be used in t.me/addstickers/ URLs (e.g., animals). Can contain only English letters, digits and underscores. Must begin with a letter, can't contain consecutive underscores and must end in "_by_<bot_username>". <bot_username> is case insensitive. 1-64 characters.
titleStringобязательный
Sticker set title, 1-64 characters
stickersArray of InputStickerобязательный
A JSON-serialized list of 1-50 initial stickers to be added to the sticker set
sticker_typeStringнеобязательный
Type of stickers in the set, pass “regular”, “mask”, or “custom_emoji”. By default, a regular sticker set is created.
needs_repaintingBooleanнеобязательный
Pass True if stickers in the sticker set must be repainted to the color of text when used in messages, the accent color if used as emoji status, white on chat photos, or another appropriate color based on context; for custom emoji sticker sets only

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

curl
curl "https://api.staticgram.top/bot$TOKEN/createNewStickerSet" \
  -H "Content-Type: application/json" \
  -d '{
    "user_id": 123456789,
    "name": "my_set_by_mybot",
    "title": "Название",
    "stickers": []
  }'
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.create_new_sticker_set(
    user_id=123456789,
    name="my_set_by_mybot",
    title="Название",
    stickers=[],
)
JavaScript
const res = await fetch(`https://api.staticgram.top/bot${TOKEN}/createNewStickerSet`, {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "user_id": 123456789,
    "name": "my_set_by_mybot",
    "title": "Название",
    "stickers": []
  }),
});
const data = await res.json();

Ответ (True)

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

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