From 0fa1d94701e960c2f596f1241342ea1a3345b16f Mon Sep 17 00:00:00 2001 From: Soo Hwan Na Date: Sat, 29 Jun 2024 21:32:09 +0900 Subject: [PATCH] TgBot++: socket: Add TYPE_STICKER support --- src/socket/include/TgBotSocket_Export.hpp | 1 + src/socket/interface/impl/bot/SocketDataHandler.cpp | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/src/socket/include/TgBotSocket_Export.hpp b/src/socket/include/TgBotSocket_Export.hpp index 670c61a5..5def69bf 100644 --- a/src/socket/include/TgBotSocket_Export.hpp +++ b/src/socket/include/TgBotSocket_Export.hpp @@ -138,6 +138,7 @@ enum class FileType { TYPE_GIF, TYPE_DOCUMENT, TYPE_DICE, + TYPE_STICKER, TYPE_MAX }; diff --git a/src/socket/interface/impl/bot/SocketDataHandler.cpp b/src/socket/interface/impl/bot/SocketDataHandler.cpp index 3b386ff1..af65c141 100644 --- a/src/socket/interface/impl/bot/SocketDataHandler.cpp +++ b/src/socket/interface/impl/bot/SocketDataHandler.cpp @@ -136,6 +136,11 @@ GenericAck SocketInterfaceTgBot::handle_SendFileToChatId(const void* ptr) { return api.sendDocument(id, file); }; break; + case FileType::TYPE_STICKER: + fn = [](const Api& api, ChatId id, const FileOrId_t& file) { + return api.sendSticker(id, file); + }; + break; case FileType::TYPE_DICE: { static const std::vector dices = { "🎲", "🎯", "🏀", "⚽", "🎳", "🎰"};