Add SpecialStickerSetType::get_dice_emoji.
GitOrigin-RevId: 6f61536c84fdb19a743d9ed78d5bf514db04c353
This commit is contained in:
parent
0fe8cc5250
commit
b698019f36
@ -16,6 +16,7 @@ string SpecialStickerSetType::animated_emoji() {
|
||||
}
|
||||
|
||||
string SpecialStickerSetType::animated_dice(const string &emoji) {
|
||||
CHECK(!emoji.empty());
|
||||
return PSTRING() << "animated_dice_sticker_set#" << emoji;
|
||||
}
|
||||
|
||||
@ -35,13 +36,20 @@ SpecialStickerSetType::SpecialStickerSetType(
|
||||
}
|
||||
}
|
||||
|
||||
string SpecialStickerSetType::get_dice_emoji() const {
|
||||
if (begins_with(type_, "animated_dice_sticker_set#")) {
|
||||
return type_.substr(Slice("animated_dice_sticker_set#").size());
|
||||
}
|
||||
return string();
|
||||
}
|
||||
|
||||
telegram_api::object_ptr<telegram_api::InputStickerSet> SpecialStickerSetType::get_input_sticker_set() const {
|
||||
if (type_ == "animated_emoji_sticker_set") {
|
||||
return telegram_api::make_object<telegram_api::inputStickerSetAnimatedEmoji>();
|
||||
}
|
||||
if (begins_with(type_, "animated_dice_sticker_set#")) {
|
||||
return telegram_api::make_object<telegram_api::inputStickerSetDice>(
|
||||
type_.substr(Slice("animated_dice_sticker_set#").size()));
|
||||
auto emoji = get_dice_emoji();
|
||||
if (!emoji.empty()) {
|
||||
return telegram_api::make_object<telegram_api::inputStickerSetDice>(emoji);
|
||||
}
|
||||
|
||||
UNREACHABLE();
|
||||
|
@ -19,6 +19,8 @@ struct SpecialStickerSetType {
|
||||
|
||||
static string animated_dice(const string &emoji);
|
||||
|
||||
string get_dice_emoji() const;
|
||||
|
||||
SpecialStickerSetType() = default;
|
||||
|
||||
explicit SpecialStickerSetType(const telegram_api::object_ptr<telegram_api::InputStickerSet> &input_sticker_set);
|
||||
|
Loading…
Reference in New Issue
Block a user