diff --git a/telegram-bot-api/Client.cpp b/telegram-bot-api/Client.cpp index fec702b..a7d288e 100644 --- a/telegram-bot-api/Client.cpp +++ b/telegram-bot-api/Client.cpp @@ -268,6 +268,7 @@ bool Client::init_methods() { methods_.emplace("editchatsubscriptioninvitelink", &Client::process_edit_chat_subscription_invite_link_query); methods_.emplace("revokechatinvitelink", &Client::process_revoke_chat_invite_link_query); methods_.emplace("getbusinessconnection", &Client::process_get_business_connection_query); + methods_.emplace("setuseremojistatus", &Client::process_set_user_emoji_status_query); methods_.emplace("getchat", &Client::process_get_chat_query); methods_.emplace("setchatphoto", &Client::process_set_chat_photo_query); methods_.emplace("deletechatphoto", &Client::process_delete_chat_photo_query); @@ -11487,6 +11488,23 @@ td::Status Client::process_get_business_connection_query(PromisedQueryPtr &query return td::Status::OK(); } +td::Status Client::process_set_user_emoji_status_query(PromisedQueryPtr &query) { + TRY_RESULT(user_id, get_user_id(query.get())); + auto emoji_status_custom_emoji_id = td::to_integer(query->arg("emoji_status_custom_emoji_id")); + auto emoji_status_expiration_date = td::to_integer(query->arg("emoji_status_expiration_date")); + check_user( + user_id, std::move(query), + [this, user_id, emoji_status_custom_emoji_id, emoji_status_expiration_date](PromisedQueryPtr query) mutable { + send_request(make_object( + user_id, emoji_status_custom_emoji_id == 0 + ? nullptr + : make_object(emoji_status_custom_emoji_id, + emoji_status_expiration_date)), + td::make_unique(std::move(query))); + }); + return td::Status::OK(); +} + td::Status Client::process_get_chat_query(PromisedQueryPtr &query) { auto chat_id = query->arg("chat_id"); diff --git a/telegram-bot-api/Client.h b/telegram-bot-api/Client.h index 00e71cd..1e701f0 100644 --- a/telegram-bot-api/Client.h +++ b/telegram-bot-api/Client.h @@ -698,6 +698,7 @@ class Client final : public WebhookActor::Callback { td::Status process_edit_chat_subscription_invite_link_query(PromisedQueryPtr &query); td::Status process_revoke_chat_invite_link_query(PromisedQueryPtr &query); td::Status process_get_business_connection_query(PromisedQueryPtr &query); + td::Status process_set_user_emoji_status_query(PromisedQueryPtr &query); td::Status process_get_chat_query(PromisedQueryPtr &query); td::Status process_set_chat_photo_query(PromisedQueryPtr &query); td::Status process_delete_chat_photo_query(PromisedQueryPtr &query);