Add td_api::deleteBusinessConnectedBot.
This commit is contained in:
parent
84ecc89d20
commit
f43ba61252
@ -9411,6 +9411,9 @@ getBusinessConnectedBot = BusinessConnectedBot;
|
||||
//@description Adds or changes business bot that is connected to the current user account @bot Connection settings for the bot
|
||||
setBusinessConnectedBot bot:businessConnectedBot = Ok;
|
||||
|
||||
//@description Deletes the business bot that is connected to the current user account @bot_user_id Unique user identifier for the bot
|
||||
deleteBusinessConnectedBot bot_user_id:int53 = Ok;
|
||||
|
||||
|
||||
//@description Returns an HTTPS link, which can be used to get information about the current user
|
||||
getUserLink = UserLink;
|
||||
|
@ -80,6 +80,14 @@ class UpdateConnectedBotQuery final : public Td::ResultHandler {
|
||||
{{"me"}}));
|
||||
}
|
||||
|
||||
void send(telegram_api::object_ptr<telegram_api::InputUser> &&input_user) {
|
||||
int32 flags = telegram_api::account_updateConnectedBot::DELETED_MASK;
|
||||
send_query(G()->net_query_creator().create(
|
||||
telegram_api::account_updateConnectedBot(flags, false /*ignored*/, false /*ignored*/, std::move(input_user),
|
||||
BusinessRecipients().get_input_business_recipients(td_)),
|
||||
{{"me"}}));
|
||||
}
|
||||
|
||||
void on_result(BufferSlice packet) final {
|
||||
auto result_ptr = fetch_result<telegram_api::account_updateConnectedBot>(packet);
|
||||
if (result_ptr.is_error()) {
|
||||
@ -260,6 +268,11 @@ void BusinessManager::set_business_connected_bot(td_api::object_ptr<td_api::busi
|
||||
td_->create_handler<UpdateConnectedBotQuery>(std::move(promise))->send(connected_bot, std::move(input_user));
|
||||
}
|
||||
|
||||
void BusinessManager::delete_business_connected_bot(UserId bot_user_id, Promise<Unit> &&promise) {
|
||||
TRY_RESULT_PROMISE(promise, input_user, td_->contacts_manager_->get_input_user(bot_user_id));
|
||||
td_->create_handler<UpdateConnectedBotQuery>(std::move(promise))->send(std::move(input_user));
|
||||
}
|
||||
|
||||
void BusinessManager::set_business_location(DialogLocation &&location, Promise<Unit> &&promise) {
|
||||
td_->create_handler<UpdateBusinessLocationQuery>(std::move(promise))->send(std::move(location));
|
||||
}
|
||||
|
@ -7,6 +7,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "td/telegram/td_api.h"
|
||||
#include "td/telegram/UserId.h"
|
||||
|
||||
#include "td/actor/actor.h"
|
||||
|
||||
@ -29,6 +30,8 @@ class BusinessManager final : public Actor {
|
||||
|
||||
void set_business_connected_bot(td_api::object_ptr<td_api::businessConnectedBot> &&bot, Promise<Unit> &&promise);
|
||||
|
||||
void delete_business_connected_bot(UserId bot_user_id, Promise<Unit> &&promise);
|
||||
|
||||
void set_business_location(DialogLocation &&location, Promise<Unit> &&promise);
|
||||
|
||||
void set_business_work_hours(BusinessWorkHours &&work_hours, Promise<Unit> &&promise);
|
||||
|
@ -7874,6 +7874,12 @@ void Td::on_request(uint64 id, td_api::setBusinessConnectedBot &request) {
|
||||
business_manager_->set_business_connected_bot(std::move(request.bot_), std::move(promise));
|
||||
}
|
||||
|
||||
void Td::on_request(uint64 id, const td_api::deleteBusinessConnectedBot &request) {
|
||||
CHECK_IS_USER();
|
||||
CREATE_OK_REQUEST_PROMISE();
|
||||
business_manager_->delete_business_connected_bot(UserId(request.bot_user_id_), std::move(promise));
|
||||
}
|
||||
|
||||
void Td::on_request(uint64 id, td_api::setSupergroupUsername &request) {
|
||||
CHECK_IS_USER();
|
||||
CLEAN_INPUT_STRING(request.username_);
|
||||
|
@ -1409,6 +1409,8 @@ class Td final : public Actor {
|
||||
|
||||
void on_request(uint64 id, td_api::setBusinessConnectedBot &request);
|
||||
|
||||
void on_request(uint64 id, const td_api::deleteBusinessConnectedBot &request);
|
||||
|
||||
void on_request(uint64 id, td_api::setSupergroupUsername &request);
|
||||
|
||||
void on_request(uint64 id, td_api::toggleSupergroupUsernameIsActive &request);
|
||||
|
@ -6028,6 +6028,10 @@ class CliClient final : public Actor {
|
||||
get_args(args, bot_user_id, chat_ids, can_reply);
|
||||
send_request(td_api::make_object<td_api::setBusinessConnectedBot>(
|
||||
td_api::make_object<td_api::businessConnectedBot>(bot_user_id, as_business_recipients(chat_ids), can_reply)));
|
||||
} else if (op == "dbcb") {
|
||||
UserId bot_user_id;
|
||||
get_args(args, bot_user_id);
|
||||
send_request(td_api::make_object<td_api::deleteBusinessConnectedBot>(bot_user_id));
|
||||
} else if (op == "sco") {
|
||||
SearchQuery query;
|
||||
get_args(args, query);
|
||||
|
Loading…
Reference in New Issue
Block a user