diff --git a/td/telegram/AnimationsManager.cpp b/td/telegram/AnimationsManager.cpp index 0e70d2ead..f769f722d 100644 --- a/td/telegram/AnimationsManager.cpp +++ b/td/telegram/AnimationsManager.cpp @@ -684,9 +684,6 @@ int64 AnimationsManager::get_saved_animations_hash(const char *source) const { void AnimationsManager::add_saved_animation(const tl_object_ptr &input_file, Promise &&promise) { - if (td_->auth_manager_->is_bot()) { - return promise.set_error(Status::Error(400, "Method is not available for bots")); - } if (!are_saved_animations_loaded_) { load_saved_animations(std::move(promise)); return; @@ -803,9 +800,6 @@ void AnimationsManager::add_saved_animation_impl(FileId animation_id, bool add_o void AnimationsManager::remove_saved_animation(const tl_object_ptr &input_file, Promise &&promise) { - if (td_->auth_manager_->is_bot()) { - return promise.set_error(Status::Error(400, "Method is not available for bots")); - } if (!are_saved_animations_loaded_) { load_saved_animations(std::move(promise)); return; diff --git a/td/telegram/ContactsManager.cpp b/td/telegram/ContactsManager.cpp index bfd303795..66474f957 100644 --- a/td/telegram/ContactsManager.cpp +++ b/td/telegram/ContactsManager.cpp @@ -14678,10 +14678,6 @@ void ContactsManager::add_dialog_participant(DialogId dialog_id, UserId user_id, void ContactsManager::add_dialog_participants(DialogId dialog_id, const vector &user_ids, Promise &&promise) { - if (td_->auth_manager_->is_bot()) { - return promise.set_error(Status::Error(400, "Method is not available for bots")); - } - if (!td_->messages_manager_->have_dialog_force(dialog_id, "add_dialog_participants")) { return promise.set_error(Status::Error(400, "Chat not found")); } diff --git a/td/telegram/MessagesManager.cpp b/td/telegram/MessagesManager.cpp index f4892eff8..d9e0a8267 100644 --- a/td/telegram/MessagesManager.cpp +++ b/td/telegram/MessagesManager.cpp @@ -10757,9 +10757,7 @@ void MessagesManager::find_unloadable_messages(const Dialog *d, int32 unload_bef void MessagesManager::delete_dialog_messages_from_user(DialogId dialog_id, UserId user_id, Promise &&promise) { bool is_bot = td_->auth_manager_->is_bot(); - if (is_bot) { - return promise.set_error(Status::Error(400, "Method is not available for bots")); - } + CHECK(!is_bot); LOG(INFO) << "Receive deleteChatMessagesFromUser request to delete all messages in " << dialog_id << " from the user " << user_id; @@ -11046,11 +11044,6 @@ void MessagesManager::on_update_dialog_group_call_rights(DialogId dialog_id) { } void MessagesManager::read_all_dialog_mentions(DialogId dialog_id, Promise &&promise) { - bool is_bot = td_->auth_manager_->is_bot(); - if (is_bot) { - return promise.set_error(Status::Error(400, "Method is not available for bots")); - } - Dialog *d = get_dialog_force(dialog_id, "read_all_dialog_mentions"); if (d == nullptr) { return promise.set_error(Status::Error(400, "Chat not found")); @@ -31660,11 +31653,6 @@ tl_object_ptr MessagesManager::get_ch int64 MessagesManager::get_dialog_event_log(DialogId dialog_id, const string &query, int64 from_event_id, int32 limit, const tl_object_ptr &filters, const vector &user_ids, Promise &&promise) { - if (td_->auth_manager_->is_bot()) { - promise.set_error(Status::Error(400, "Method is not available for bots")); - return 0; - } - if (!have_dialog_force(dialog_id, "get_dialog_event_log")) { promise.set_error(Status::Error(400, "Chat not found")); return 0; diff --git a/td/telegram/StickersManager.cpp b/td/telegram/StickersManager.cpp index b335cc48c..b72149afe 100644 --- a/td/telegram/StickersManager.cpp +++ b/td/telegram/StickersManager.cpp @@ -6002,9 +6002,6 @@ FileSourceId StickersManager::get_recent_stickers_file_source_id(int is_attached void StickersManager::add_recent_sticker(bool is_attached, const tl_object_ptr &input_file, Promise &&promise) { - if (td_->auth_manager_->is_bot()) { - return promise.set_error(Status::Error(400, "Method is not available for bots")); - } if (!are_recent_stickers_loaded_[is_attached]) { load_recent_stickers(is_attached, std::move(promise)); return; @@ -6113,9 +6110,6 @@ void StickersManager::add_recent_sticker_impl(bool is_attached, FileId sticker_i void StickersManager::remove_recent_sticker(bool is_attached, const tl_object_ptr &input_file, Promise &&promise) { - if (td_->auth_manager_->is_bot()) { - return promise.set_error(Status::Error(400, "Method is not available for bots")); - } if (!are_recent_stickers_loaded_[is_attached]) { load_recent_stickers(is_attached, std::move(promise)); return; @@ -6144,9 +6138,6 @@ void StickersManager::remove_recent_sticker(bool is_attached, const tl_object_pt } void StickersManager::clear_recent_stickers(bool is_attached, Promise &&promise) { - if (td_->auth_manager_->is_bot()) { - return promise.set_error(Status::Error(400, "Method is not available for bots")); - } if (!are_recent_stickers_loaded_[is_attached]) { load_recent_stickers(is_attached, std::move(promise)); return; @@ -6407,9 +6398,6 @@ FileSourceId StickersManager::get_favorite_stickers_file_source_id() { void StickersManager::add_favorite_sticker(const tl_object_ptr &input_file, Promise &&promise) { - if (td_->auth_manager_->is_bot()) { - return promise.set_error(Status::Error(400, "Method is not available for bots")); - } if (!are_favorite_stickers_loaded_) { load_favorite_stickers(std::move(promise)); return; @@ -6512,9 +6500,6 @@ void StickersManager::add_favorite_sticker_impl(FileId sticker_id, bool add_on_s void StickersManager::remove_favorite_sticker(const tl_object_ptr &input_file, Promise &&promise) { - if (td_->auth_manager_->is_bot()) { - return promise.set_error(Status::Error(400, "Method is not available for bots")); - } if (!are_favorite_stickers_loaded_) { load_favorite_stickers(std::move(promise)); return;