Skip to content

sendSticker

Use this method to send static .WEBP, animated .TGS, or video .WEBM stickers. On success, the sent Message is returned.

Parameters

business_connection_idStringOptional
Unique identifier of the business connection on behalf of which the message will be sent
chat_idIntegerStringRequired
Unique identifier for the target chat or username of the target channel (in the format @channelusername)
message_thread_idIntegerOptional
Unique 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_idIntegerOptional
Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
stickerInputFileStringRequired📎 Files
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.
emojiStringOptional
Emoji associated with the sticker; only for just uploaded stickers
disable_notificationBooleanOptional
Sends the message silently. Users will receive a notification with no sound.
protect_contentBooleanOptional
Protects the contents of the sent message from forwarding and saving
allow_paid_broadcastBooleanOptional
Pass 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_idStringOptional
Unique identifier of the message effect to be added to the message; for private chats only
suggested_post_parametersSuggestedPostParametersOptional
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.
reply_parametersReplyParametersOptional
Description of the message to reply to
Additional 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

CodeErrorCause
400Bad Request: chat not foundInvalid or inaccessible chat_id — verify the chat exists and the bot is a member
400Bad Request: STICKER_INVALIDThe provided file_id does not refer to a sticker, or the file is corrupt
400Bad Request: wrong file typeA non-sticker file_id was passed in the sticker field
400Bad Request: failed to get HTTP URL contentTelegram could not fetch the sticker from the provided HTTP URL
400Bad Request: can't send sticker via HTTP URLAnimated (.TGS) or video (.WEBM) stickers cannot be sent via URL — upload them directly
400Bad Request: WEBP_BAD_DIMENSIONSUploaded WEBP sticker dimensions exceed 512×512 pixels
403Forbidden: bot was blocked by the userThe target user has blocked the bot
403Forbidden: not enough rightsBot lacks can_send_other_messages permission in the group/channel
413Request Entity Too LargeUploaded file exceeds the size limit
429Too Many Requests: retry after NFlood 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_id for repeat sends. When you receive a sticker message, save the sticker.file_id from the Message object 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().
  • emoji is only used for freshly uploaded stickers. When sending by file_id or URL, the emoji parameter 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_id after the first upload. After uploading a sticker, capture message.sticker.file_id from the returned MessageContext and persist it (e.g. in a database) for all future sends.
  • Use getStickerSet to discover sticker packs. If you need the file_id for a specific sticker in a set, call bot.api.getStickerSet({ name: "setname" }) and iterate over the stickers array.

See Also