1 // 2 // Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2021 3 // 4 // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 // 7 #pragma once 8 9 #include "td/telegram/telegram_api.h" 10 11 #include "td/utils/common.h" 12 13 #include <functional> 14 15 namespace td { 16 17 class SpecialStickerSetType { SpecialStickerSetType(string type)18 explicit SpecialStickerSetType(string type) : type_(type) { 19 } 20 21 friend struct SpecialStickerSetTypeHash; 22 23 public: 24 string type_; 25 26 static SpecialStickerSetType animated_emoji(); 27 28 static SpecialStickerSetType animated_emoji_click(); 29 30 static SpecialStickerSetType animated_dice(const string &emoji); 31 32 string get_dice_emoji() const; 33 is_empty()34 bool is_empty() const { 35 return type_.empty(); 36 } 37 38 SpecialStickerSetType() = default; 39 40 explicit SpecialStickerSetType(const telegram_api::object_ptr<telegram_api::InputStickerSet> &input_sticker_set); 41 42 telegram_api::object_ptr<telegram_api::InputStickerSet> get_input_sticker_set() const; 43 }; 44 45 inline bool operator==(const SpecialStickerSetType &lhs, const SpecialStickerSetType &rhs) { 46 return lhs.type_ == rhs.type_; 47 } 48 49 inline bool operator!=(const SpecialStickerSetType &lhs, const SpecialStickerSetType &rhs) { 50 return !(lhs == rhs); 51 } 52 53 struct SpecialStickerSetTypeHash { operatorSpecialStickerSetTypeHash54 std::size_t operator()(SpecialStickerSetType type) const { 55 return std::hash<string>()(type.type_); 56 } 57 }; 58 59 } // namespace td 60