Add support for spoiler entities.

This commit is contained in:
levlam 2021-12-30 14:44:21 +03:00
parent 6ec2104b81
commit 6b137be127

View File

@ -417,6 +417,9 @@ class Client::JsonEntity : public Jsonable {
case td_api::textEntityTypeStrikethrough::ID: case td_api::textEntityTypeStrikethrough::ID:
object("type", "strikethrough"); object("type", "strikethrough");
break; break;
case td_api::textEntityTypeSpoiler::ID:
object("type", "spoiler");
break;
case td_api::textEntityTypeCode::ID: case td_api::textEntityTypeCode::ID:
object("type", "code"); object("type", "code");
break; break;
@ -5934,6 +5937,9 @@ td::Result<td_api::object_ptr<td_api::TextEntityType>> Client::get_text_entity_t
if (type == "strikethrough") { if (type == "strikethrough") {
return make_object<td_api::textEntityTypeStrikethrough>(); return make_object<td_api::textEntityTypeStrikethrough>();
} }
if (type == "spoiler") {
return make_object<td_api::textEntityTypeSpoiler>();
}
if (type == "code") { if (type == "code") {
return make_object<td_api::textEntityTypeCode>(); return make_object<td_api::textEntityTypeCode>();
} }