createNewStickerSet
Use this method to create a new sticker set owned by a user
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.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
user_id | Integer | Yes | User identifier of created sticker set owner |
name | String | Yes | 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. |
title | String | Yes | Sticker set title, 1-64 characters |
stickers | Array of InputSticker | Yes | A JSON-serialized list of 1-50 initial stickers to be added to the sticker set |
sticker_type | String | Optional | Type of stickers in the set, pass "regular", "mask", or "custom_emoji". By default, a regular sticker set is created. |
needs_repainting | Boolean | Optional | 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 |
Example
PHP — Call createNewStickerSet on Botlify Cloud
<?php
// ── Botlify Cloud .env — auto-injected, never hardcode secrets ──
$BOT_TOKEN = getenv('BOT_TOKEN'); // Telegram bot token from @BotFather
$ADMIN_CHAT_ID = getenv('ADMIN_CHAT_ID'); // Your numeric admin Telegram user ID
$BOT_USERNAME = getenv('BOT_USERNAME'); // Bot username without @
$resp = bot('createNewStickerSet', [
'user_id' => $userId,
'name' => 'Hello from Botlify Cloud!',
'title' => 'Hello from Botlify Cloud!',
'stickers' => 'value',
]);
if ($resp['ok'] ?? false) {
$result = $resp['result']; // handle the response
}Botlify Cloud Runtime
Credentials are auto-injected in
Credentials are auto-injected in
.env — always load them with getenv(): BOT_TOKEN, ADMIN_CHAT_ID, BOT_USERNAME. Main database: database.db (SQLite, WAL mode). Runtime errors: error.log. Quick test: send to $ADMIN_CHAT_ID. Full details: Runtime Reference.