Update layer 85. Support hide_via_bot.
GitOrigin-RevId: 94fb988d50640f68019007249b8e4860ccea89af
This commit is contained in:
parent
97a4f73999
commit
9cb950bc05
@ -2693,7 +2693,8 @@ sendBotStartMessage bot_user_id:int32 chat_id:int53 parameter:string = Message;
|
||||
//@description Sends the result of an inline query as a message. Returns the sent message. Always clears a chat draft message @chat_id Target chat @reply_to_message_id Identifier of a message to reply to or 0
|
||||
//@disable_notification Pass true to disable notification for the message. Not supported in secret chats @from_background Pass true if the message is sent from background
|
||||
//@query_id Identifier of the inline query @result_id Identifier of the inline result
|
||||
sendInlineQueryResultMessage chat_id:int53 reply_to_message_id:int53 disable_notification:Bool from_background:Bool query_id:int64 result_id:string = Message;
|
||||
//@hide_via_bot If true, there will be no mention of a bot, via which the message is sent. Can be used only for bots getOption('animation_search_bot_username'), getOption('photo_search_bot_username') and getOption('venue_search_bot_username')
|
||||
sendInlineQueryResultMessage chat_id:int53 reply_to_message_id:int53 disable_notification:Bool from_background:Bool query_id:int64 result_id:string hide_via_bot:Bool = Message;
|
||||
|
||||
//@description Forwards previously sent messages. Returns the forwarded messages in the same order as the message identifiers passed in message_ids. If a message can't be forwarded, null will be returned instead of the message
|
||||
//@chat_id Identifier of the chat to which to forward messages @from_chat_id Identifier of the chat from which to forward messages @message_ids Identifiers of the messages to forward
|
||||
|
Binary file not shown.
@ -227,7 +227,7 @@ messages.dialogsNotModified#f0e3e596 count:int = messages.Dialogs;
|
||||
|
||||
messages.messages#8c718e87 messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Messages;
|
||||
messages.messagesSlice#b446ae3 count:int messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Messages;
|
||||
messages.channelMessages#99262e37 flags:# pts:int count:int messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Messages;
|
||||
messages.channelMessages#99262e37 flags:# inexact:flags.1?true pts:int count:int messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Messages;
|
||||
messages.messagesNotModified#74535f21 count:int = messages.Messages;
|
||||
|
||||
messages.chats#64ff9fd5 chats:Vector<Chat> = messages.Chats;
|
||||
@ -1008,11 +1008,10 @@ contacts.getContacts#c023849f hash:int = contacts.Contacts;
|
||||
contacts.importContacts#2c800be5 contacts:Vector<InputContact> = contacts.ImportedContacts;
|
||||
contacts.deleteContact#8e953744 id:InputUser = contacts.Link;
|
||||
contacts.deleteContacts#59ab389e id:Vector<InputUser> = Bool;
|
||||
contacts.deleteByPhones#1013fd9e phones:Vector<string> = Bool;
|
||||
contacts.block#332b49fc id:InputUser = Bool;
|
||||
contacts.unblock#e54100bd id:InputUser = Bool;
|
||||
contacts.getBlocked#f57c350f offset:int limit:int = contacts.Blocked;
|
||||
contacts.exportCard#84e53737 = Vector<int>;
|
||||
contacts.importCard#4fe196fe export_card:Vector<int> = User;
|
||||
contacts.search#11f812d8 q:string limit:int = contacts.Found;
|
||||
contacts.resolveUsername#f93ccba3 username:string = contacts.ResolvedPeer;
|
||||
contacts.getTopPeers#d4982db5 flags:# correspondents:flags.0?true bots_pm:flags.1?true bots_inline:flags.2?true phone_calls:flags.3?true groups:flags.10?true channels:flags.15?true offset:int limit:int hash:int = contacts.TopPeers;
|
||||
@ -1078,7 +1077,7 @@ messages.getSavedGifs#83bf3d52 hash:int = messages.SavedGifs;
|
||||
messages.saveGif#327a30cb id:InputDocument unsave:Bool = Bool;
|
||||
messages.getInlineBotResults#514e999d flags:# bot:InputUser peer:InputPeer geo_point:flags.0?InputGeoPoint query:string offset:string = messages.BotResults;
|
||||
messages.setInlineBotResults#eb5ea206 flags:# gallery:flags.0?true private:flags.1?true query_id:long results:Vector<InputBotInlineResult> cache_time:int next_offset:flags.2?string switch_pm:flags.3?InlineBotSwitchPM = Bool;
|
||||
messages.sendInlineBotResult#b16e06fe flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true peer:InputPeer reply_to_msg_id:flags.0?int random_id:long query_id:long id:string = Updates;
|
||||
messages.sendInlineBotResult#b16e06fe flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true hide_via:flags.11?true peer:InputPeer reply_to_msg_id:flags.0?int random_id:long query_id:long id:string = Updates;
|
||||
messages.getMessageEditData#fda68d36 peer:InputPeer id:int = messages.MessageEditData;
|
||||
messages.editMessage#c000e4c8 flags:# no_webpage:flags.1?true stop_geo_live:flags.12?true peer:InputPeer id:int message:flags.11?string media:flags.14?InputMedia reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector<MessageEntity> geo_point:flags.13?InputGeoPoint = Updates;
|
||||
messages.editInlineBotMessage#adc3e828 flags:# no_webpage:flags.1?true stop_geo_live:flags.12?true id:InputBotInlineMessageID message:flags.11?string media:flags.14?InputMedia reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector<MessageEntity> geo_point:flags.13?InputGeoPoint = Bool;
|
||||
|
Binary file not shown.
@ -2059,7 +2059,7 @@ class SendInlineBotResultQuery : public Td::ResultHandler {
|
||||
CHECK(input_peer != nullptr);
|
||||
|
||||
auto query = G()->net_query_creator().create(create_storer(telegram_api::messages_sendInlineBotResult(
|
||||
flags, false /*ignored*/, false /*ignored*/, false /*ignored*/, std::move(input_peer),
|
||||
flags, false /*ignored*/, false /*ignored*/, false /*ignored*/, false /*ignored*/, std::move(input_peer),
|
||||
reply_to_message_id.get_server_message_id().get(), random_id, query_id, result_id)));
|
||||
auto send_query_ref = query.get_weak();
|
||||
send_query(std::move(query));
|
||||
@ -15896,7 +15896,8 @@ void MessagesManager::do_send_bot_start_message(UserId bot_user_id, DialogId dia
|
||||
|
||||
Result<MessageId> MessagesManager::send_inline_query_result_message(DialogId dialog_id, MessageId reply_to_message_id,
|
||||
bool disable_notification, bool from_background,
|
||||
int64 query_id, const string &result_id) {
|
||||
int64 query_id, const string &result_id,
|
||||
bool hide_via_bot) {
|
||||
LOG(INFO) << "Begin to send inline query result message to " << dialog_id << " in reply to " << reply_to_message_id;
|
||||
|
||||
Dialog *d = get_dialog_force(dialog_id);
|
||||
@ -15938,7 +15939,9 @@ Result<MessageId> MessagesManager::send_inline_query_result_message(DialogId dia
|
||||
Message *m = get_message_to_send(
|
||||
d, get_reply_to_message_id(d, reply_to_message_id), disable_notification, from_background,
|
||||
dup_message_content(td_, dialog_id, content->message_content.get(), false), &need_update_dialog_pos);
|
||||
m->via_bot_user_id = td_->inline_queries_manager_->get_inline_bot_user_id(query_id);
|
||||
if (!hide_via_bot) {
|
||||
m->via_bot_user_id = td_->inline_queries_manager_->get_inline_bot_user_id(query_id);
|
||||
}
|
||||
if (content->message_reply_markup != nullptr && !to_secret) {
|
||||
m->reply_markup = make_unique<ReplyMarkup>(*content->message_reply_markup);
|
||||
}
|
||||
@ -16015,8 +16018,12 @@ void MessagesManager::do_send_inline_query_result_message(DialogId dialog_id, Me
|
||||
LOG(INFO) << "Do send inline query result " << FullMessageId(dialog_id, m->message_id);
|
||||
|
||||
int64 random_id = begin_send_message(dialog_id, m);
|
||||
m->send_query_ref = td_->create_handler<SendInlineBotResultQuery>()->send(
|
||||
get_message_flags(m), dialog_id, m->reply_to_message_id, random_id, query_id, result_id);
|
||||
auto flags = get_message_flags(m);
|
||||
if (!m->via_bot_user_id.is_valid()) {
|
||||
flags |= telegram_api::messages_sendInlineBotResult::HIDE_VIA_MASK;
|
||||
}
|
||||
m->send_query_ref = td_->create_handler<SendInlineBotResultQuery>()->send(flags, dialog_id, m->reply_to_message_id,
|
||||
random_id, query_id, result_id);
|
||||
}
|
||||
|
||||
bool MessagesManager::can_edit_message(DialogId dialog_id, const Message *m, bool is_editing,
|
||||
@ -21742,8 +21749,10 @@ void MessagesManager::update_message(Dialog *d, unique_ptr<Message> &old_message
|
||||
}
|
||||
}
|
||||
if (old_message->via_bot_user_id != new_message->via_bot_user_id) {
|
||||
LOG(ERROR) << message_id << " in " << dialog_id << " has changed bot via it is sent from "
|
||||
<< old_message->via_bot_user_id << " to " << new_message->via_bot_user_id;
|
||||
if (!message_id.is_yet_unsent() || old_message->via_bot_user_id.is_valid()) {
|
||||
LOG(ERROR) << message_id << " in " << dialog_id << " has changed bot via it is sent from "
|
||||
<< old_message->via_bot_user_id << " to " << new_message->via_bot_user_id;
|
||||
}
|
||||
old_message->via_bot_user_id = new_message->via_bot_user_id;
|
||||
is_changed = true;
|
||||
}
|
||||
|
@ -333,7 +333,7 @@ class MessagesManager : public Actor {
|
||||
|
||||
Result<MessageId> send_inline_query_result_message(DialogId dialog_id, MessageId reply_to_message_id,
|
||||
bool disable_notification, bool from_background, int64 query_id,
|
||||
const string &result_id) TD_WARN_UNUSED_RESULT;
|
||||
const string &result_id, bool hide_via_bot) TD_WARN_UNUSED_RESULT;
|
||||
|
||||
Result<vector<MessageId>> forward_messages(DialogId to_dialog_id, DialogId from_dialog_id,
|
||||
vector<MessageId> message_ids, bool disable_notification,
|
||||
|
@ -5284,7 +5284,7 @@ void Td::on_request(uint64 id, td_api::sendInlineQueryResultMessage &request) {
|
||||
DialogId dialog_id(request.chat_id_);
|
||||
auto r_new_message_id = messages_manager_->send_inline_query_result_message(
|
||||
dialog_id, MessageId(request.reply_to_message_id_), request.disable_notification_, request.from_background_,
|
||||
request.query_id_, request.result_id_);
|
||||
request.query_id_, request.result_id_, request.hide_via_bot_);
|
||||
if (r_new_message_id.is_error()) {
|
||||
return send_closure(actor_id(this), &Td::send_error, id, r_new_message_id.move_as_error());
|
||||
}
|
||||
|
@ -2691,7 +2691,7 @@ class CliClient final : public Actor {
|
||||
std::tie(bot_id, query) = split(args);
|
||||
send_request(
|
||||
make_tl_object<td_api::getInlineQueryResults>(as_user_id(bot_id), 0, as_location("1.1", "2.2"), query, ""));
|
||||
} else if (op == "siqr") {
|
||||
} else if (op == "siqr" || op == "siqrh") {
|
||||
string chat_id;
|
||||
string query_id;
|
||||
string result_id;
|
||||
@ -2699,8 +2699,8 @@ class CliClient final : public Actor {
|
||||
std::tie(query_id, result_id) = split(args);
|
||||
|
||||
auto chat = as_chat_id(chat_id);
|
||||
send_request(make_tl_object<td_api::sendInlineQueryResultMessage>(chat, 0, false, false,
|
||||
to_integer<int64>(query_id), result_id));
|
||||
send_request(make_tl_object<td_api::sendInlineQueryResultMessage>(
|
||||
chat, 0, false, false, to_integer<int64>(query_id), result_id, op == "siqrh"));
|
||||
} else if (op == "gcqr") {
|
||||
string chat_id;
|
||||
string message_id;
|
||||
|
Reference in New Issue
Block a user