tdlib / td

Cross-platform library for building Telegram clients
https://core.telegram.org/tdlib
Boost Software License 1.0
7.11k stars 1.44k forks source link

Can't send emoji stickers in messages #2508

Closed Mike497 closed 1 year ago

Mike497 commented 1 year ago

Hi! Could you please advice why when I try to send regular type sticker in send_message it works fine, but when I try to use the same code for sending custom type sticker I get an error: Can't send emoji stickers in messages ? Here's example code:

Long chatId;
Client client;
Client.ResultHandler resultHandler;
TdApi.Sticker sticker;

client.send(new TdApi.SendMessage(chatId, 0, 0, null, null,
        new TdApi.InputMessageSticker(new TdApi.InputFileId(sticker.sticker.id),
                new TdApi.InputThumbnail(new TdApi.InputFileId(sticker.thumbnail.file.id), sticker.thumbnail.width, sticker.thumbnail.height),
                sticker.width, sticker.height, sticker.emoji)), resultHandler);
levlam commented 1 year ago

Because emoji stickers can't be sent as a message. They can be used only in the message text using textEntityTypeCustomEmoji by Telegram Premium users.