Add BotInfoManager::reload_bot_media_previews.

This commit is contained in:
levlam 2024-07-18 17:58:54 +03:00
parent 5a5a9a28a4
commit 8396faa832
2 changed files with 14 additions and 0 deletions

View File

@ -448,6 +448,18 @@ void BotInfoManager::get_bot_media_previews(UserId bot_user_id,
td_->create_handler<GetPreviewMediasQuery>(std::move(promise))->send(bot_user_id, std::move(input_user));
}
void BotInfoManager::reload_bot_media_previews(UserId bot_user_id, Promise<Unit> &&promise) {
get_bot_media_previews(
bot_user_id, PromiseCreator::lambda([promise = std::move(promise)](
Result<td_api::object_ptr<td_api::botMediaPreviews>> result) mutable {
if (result.is_error()) {
promise.set_error(result.move_as_error());
} else {
promise.set_value(Unit());
}
}));
}
void BotInfoManager::add_pending_set_query(UserId bot_user_id, const string &language_code, int type,
const string &value, Promise<Unit> &&promise) {
pending_set_bot_info_queries_.emplace_back(bot_user_id, language_code, type, value, std::move(promise));

View File

@ -32,6 +32,8 @@ class BotInfoManager final : public Actor {
void get_bot_media_previews(UserId bot_user_id, Promise<td_api::object_ptr<td_api::botMediaPreviews>> &&promise);
void reload_bot_media_previews(UserId bot_user_id, Promise<Unit> &&promise);
void set_bot_name(UserId bot_user_id, const string &language_code, const string &name, Promise<Unit> &&promise);
void get_bot_name(UserId bot_user_id, const string &language_code, Promise<string> &&promise);