sendSticker
Use this method to send static .WEBP, animated .TGS, or video .WEBM stickers. On success, the sent Message is returned.
Parameters
business_connection_idStringOptionalUnique identifier of the business connection on behalf of which the message will be sent
chat_idIntegerStringRequiredUnique identifier for the target chat or username of the target channel (in the format
@channelusername)message_thread_idIntegerOptionalUnique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
direct_messages_topic_idIntegerOptionalIdentifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
Sticker to send. Pass a file\_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a .WEBP sticker from the Internet, or upload a new .WEBP, .TGS, or .WEBM sticker using multipart/form-data. More information on Sending Files ». Video and animated stickers can't be sent via an HTTP URL.
emojiStringOptionalEmoji associated with the sticker; only for just uploaded stickers
disable_notificationBooleanOptionalSends the message silently. Users will receive a notification with no sound.
protect_contentBooleanOptionalProtects the contents of the sent message from forwarding and saving
allow_paid_broadcastBooleanOptionalPass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance
message_effect_idStringOptionalUnique identifier of the message effect to be added to the message; for private chats only
A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.
Description of the message to reply to
reply_markupInlineKeyboardMarkupReplyKeyboardMarkupReplyKeyboardRemoveForceReplyOptional⌨️ KeyboardsAdditional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user
Returns
On success, the Message object is returned.
GramIO Usage
ts
// Send a sticker by file_id (recommended — fastest, no re-upload)
bot.command("sticker", (ctx) =>
ctx.sendSticker(
"CAACAgIAAxkBAAIBfWXzO5example_file_id_hereAAp4BAAIXxZFRqY4JaXAAE"
)
);ts
// Upload a local .WEBP sticker file from disk
bot.command("upload", async (ctx) => {
const sticker = await MediaUpload.path("./assets/sticker.webp");
return ctx.sendSticker(sticker, { emoji: "😎" });
});ts
// Send sticker via HTTP URL (static WEBP only — animated/video require upload)
bot.command("websticker", (ctx) =>
ctx.sendSticker("https://example.com/sticker.webp")
);ts
// Reply to the user's message with a sticker
bot.command("react", (ctx) =>
ctx.replyWithSticker(
"CAACAgIAAxkBAAIBfWXzO5example_file_id_hereAAp4BAAIXxZFRqY4JaXAAE"
)
);ts
// Send sticker silently with an inline keyboard below
bot.command("quiet", (ctx) =>
ctx.sendSticker(
"CAACAgIAAxkBAAIBfWXzO5example_file_id_hereAAp4BAAIXxZFRqY4JaXAAE",
{
disable_notification: true,
reply_markup: new InlineKeyboard().text("More stickers", "more_stickers"),
}
)
);Errors
| Code | Error | Cause |
|---|---|---|
| 400 | Bad Request: chat not found | Invalid or inaccessible chat_id — verify the chat exists and the bot is a member |
| 400 | Bad Request: STICKER_INVALID | The provided file_id does not refer to a sticker, or the file is corrupt |
| 400 | Bad Request: wrong file type | A non-sticker file_id was passed in the sticker field |
| 400 | Bad Request: failed to get HTTP URL content | Telegram could not fetch the sticker from the provided HTTP URL |
| 400 | Bad Request: can't send sticker via HTTP URL | Animated (.TGS) or video (.WEBM) stickers cannot be sent via URL — upload them directly |
| 400 | Bad Request: WEBP_BAD_DIMENSIONS | Uploaded WEBP sticker dimensions exceed 512×512 pixels |
| 403 | Forbidden: bot was blocked by the user | The target user has blocked the bot |
| 403 | Forbidden: not enough rights | Bot lacks can_send_other_messages permission in the group/channel |
| 413 | Request Entity Too Large | Uploaded file exceeds the size limit |
| 429 | Too Many Requests: retry after N | Flood control triggered — use the auto-retry plugin to handle this automatically |
Auto-retry for 429 errors
Install the @gramio/auto-retry plugin to transparently handle flood-wait errors without manual retry logic.
Tips & Gotchas
- Prefer
file_idfor repeat sends. When you receive a sticker message, save thesticker.file_idfrom theMessageobject and reuse it. This avoids re-uploading and is significantly faster. - Animated and video stickers cannot be sent via URL. Only static WEBP stickers can be fetched from an HTTP URL. TGS and WEBM formats require a direct file upload via
MediaUpload.path(). emojiis only used for freshly uploaded stickers. When sending byfile_idor URL, theemojiparameter is ignored — the emoji is already attached to the sticker on Telegram's servers.- WEBP stickers must be exactly 512×512 pixels. Larger dimensions will be rejected with
WEBP_BAD_DIMENSIONS. Resize before uploading. - Cache
file_idafter the first upload. After uploading a sticker, capturemessage.sticker.file_idfrom the returnedMessageContextand persist it (e.g. in a database) for all future sends. - Use
getStickerSetto discover sticker packs. If you need thefile_idfor a specific sticker in a set, callbot.api.getStickerSet({ name: "setname" })and iterate over thestickersarray.
See Also
- getStickerSet — Retrieve all stickers in a sticker set by name
- uploadStickerFile — Upload a sticker file to Telegram servers before adding to a set
- createNewStickerSet — Create a new sticker set for the bot
- Sticker — The Sticker type embedded in Message
- StickerSet — Collection of stickers with name and title
- Media upload guide — Upload files using
MediaUploadhelpers - sendAnimation — Send GIF animations
- sendDocument — Send arbitrary files as documents