ptgb
A complete Telegram Bot API client for Dart

Stickers

Part of the API Reference.

sendSticker

Future<Json> sendSticker(
    Object chatId,
    InputFile sticker, {
    String? businessConnectionId,
    int? messageThreadId,
    String? emoji,
    bool? disableNotification,
    bool? protectContent,
    bool? allowPaidBroadcast,
    String? messageEffectId,
    ReplyParameters? replyParameters,
    ReplyMarkup? replyMarkup,
  }) async =>

Sends a sticker from a file_id, URL, or local upload.

getStickerSet

Future<Json> getStickerSet(String name) async =>

Fetches metadata and every sticker in a named sticker set.

getCustomEmojiStickers

Future<List<Json>> getCustomEmojiStickers(List<String> customEmojiIds) async =>

Resolves a list of custom emoji IDs into full sticker information.

uploadStickerFile

Future<Json> uploadStickerFile(int userId, InputFile sticker, StickerFormat stickerFormat) async =>

Uploads a file to be later reused as a sticker in [createNewStickerSet] or [addStickerToSet], returning a reusable file_id.

createNewStickerSet

Future<bool> createNewStickerSet(
    int userId,
    String name,
    String title,
    List<InputSticker> stickers, {
    StickerType? stickerType,
    bool? needsRepainting,
  }) async {

Creates a new sticker set owned by [userId].

addStickerToSet

Future<bool> addStickerToSet(int userId, String name, InputSticker sticker) async {

Adds one more sticker to an existing set created by the bot.

setStickerPositionInSet

Future<bool> setStickerPositionInSet(String sticker, int position) async =>

Moves a sticker to a new zero-based [position] within its set.

deleteStickerFromSet

Future<bool> deleteStickerFromSet(String sticker) async =>

Removes a sticker from its set.

replaceStickerInSet

Future<bool> replaceStickerInSet(
    int userId,
    String name,
    String oldSticker,
    InputSticker sticker,
  ) async {

Replaces an existing sticker in a set with a new one, preserving its position.

setStickerEmojiList

Future<bool> setStickerEmojiList(String sticker, List<String> emojiList) async =>

Changes the emoji associated with a sticker.

setStickerKeywords

Future<bool> setStickerKeywords(String sticker, {List<String>? keywords}) async =>

Changes the search keywords associated with a sticker.

setStickerMaskPosition

Future<bool> setStickerMaskPosition(String sticker, {Json? maskPosition}) async =>

Changes where a mask sticker is anchored on a face.

setStickerSetTitle

Future<bool> setStickerSetTitle(String name, String title) async =>

Renames a sticker set.

setStickerSetThumbnail

Future<bool> setStickerSetThumbnail(
    String name,
    int userId,
    StickerFormat format, {
    InputFile? thumbnail,
  }) async =>

Sets the thumbnail shown for a sticker set in the sticker picker.

setCustomEmojiStickerSetThumbnail

Future<bool> setCustomEmojiStickerSetThumbnail(String name, {String? customEmojiId}) async =>

Sets the thumbnail of a custom emoji sticker set from one of its own stickers.

deleteStickerSet

Future<bool> deleteStickerSet(String name) async =>

Deletes an entire sticker set owned by the bot.