replaceStickerInSet()
Use this method to replace an existing sticker in a sticker set with a new one. The method is equivalent to calling deleteStickerFromSet, then addStickerToSet, then setStickerPositionInSet. Returns True on success.
parameters
| parameter | type | required | description |
|---|---|---|---|
user_id | number | required | User identifier of the sticker set owner |
name | string | required | Sticker set name |
old_sticker | string | required | File identifier of the replaced sticker |
sticker | InputSticker | required | 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 remains unchanged. |
returns
boolean
usage in yaebal
not (yet) hard-typed on Api — call it through the generic .call<T>() escape hatch documented in @yaebal/types.
import type { ReplaceStickerInSetParams } from "@yaebal/types";
await bot.api.call<boolean>("replaceStickerInSet", {
user_id: 123456789,
name: "...",
old_sticker: "...",
sticker: {} /* InputSticker */,
} satisfies ReplaceStickerInSetParams);context shortcut
also available as ctx.replaceStickerInSet() on
16
context types — see @yaebal/contexts.
/** Use this method to replace an existing sticker in a sticker set with a new one. The method is equivalent to calling [deleteStickerFromSet](https://core.telegram.org/bots/api/#deletestickerfromset), then [addStickerToSet](https://core.telegram.org/bots/api/#addstickertoset), then [setStickerPositionInSet](https://core.telegram.org/bots/api/#setstickerpositioninset). Returns *True* on success. */
ctx.replaceStickerInSet(params: Omit<ReplaceStickerInSetParams, "user_id">)official Bot API docs: https://core.telegram.org/bots/api/#replacestickerinset