mirror of
https://github.com/PaiGramTeam/telegram-bot-api.git
synced 2024-11-21 14:38:23 +00:00
feat: get message
This commit is contained in:
parent
53e15345b0
commit
6c418e4fa0
@ -250,6 +250,7 @@ bool Client::init_methods() {
|
||||
methods_.emplace("editmessagereplymarkup", &Client::process_edit_message_reply_markup_query);
|
||||
methods_.emplace("deletemessage", &Client::process_delete_message_query);
|
||||
methods_.emplace("deletemessages", &Client::process_delete_messages_query);
|
||||
methods_.emplace("getmessage", &Client::process_get_message_query);
|
||||
methods_.emplace("createinvoicelink", &Client::process_create_invoice_link_query);
|
||||
methods_.emplace("getstartransactions", &Client::process_get_star_transactions_query);
|
||||
methods_.emplace("refundstarpayment", &Client::process_refund_star_payment_query);
|
||||
@ -11280,6 +11281,27 @@ td::Status Client::process_delete_messages_query(PromisedQueryPtr &query) {
|
||||
return td::Status::OK();
|
||||
}
|
||||
|
||||
td::Status Client::process_get_message_query(PromisedQueryPtr &query) {
|
||||
auto chat_id = query->arg("chat_id");
|
||||
auto message_id = get_message_id(query.get());
|
||||
|
||||
if (chat_id.empty()) {
|
||||
return td::Status::Error(400, "Chat identifier is not specified");
|
||||
}
|
||||
|
||||
if (message_id == 0) {
|
||||
return td::Status::Error(400, "Message identifier is not specified");
|
||||
}
|
||||
|
||||
check_message(chat_id, message_id, false, AccessRights::Read, "message", std::move(query),
|
||||
[this](int64 chat_id, int64 message_id, PromisedQueryPtr query) {
|
||||
auto message_info = get_message(chat_id, message_id, false);
|
||||
CHECK(message_info != nullptr);
|
||||
answer_query(JsonMessage(message_info, true, "message", this), std::move(query));
|
||||
});
|
||||
return td::Status::OK();
|
||||
}
|
||||
|
||||
td::Status Client::process_create_invoice_link_query(PromisedQueryPtr &query) {
|
||||
TRY_RESULT(input_message_invoice, get_input_message_invoice(query.get()));
|
||||
auto business_connection_id = query->arg("business_connection_id").str();
|
||||
|
@ -683,6 +683,7 @@ class Client final : public WebhookActor::Callback {
|
||||
td::Status process_edit_message_reply_markup_query(PromisedQueryPtr &query);
|
||||
td::Status process_delete_message_query(PromisedQueryPtr &query);
|
||||
td::Status process_delete_messages_query(PromisedQueryPtr &query);
|
||||
td::Status process_get_message_query(PromisedQueryPtr &query);
|
||||
td::Status process_create_invoice_link_query(PromisedQueryPtr &query);
|
||||
td::Status process_get_star_transactions_query(PromisedQueryPtr &query);
|
||||
td::Status process_refund_star_payment_query(PromisedQueryPtr &query);
|
||||
|
Loading…
Reference in New Issue
Block a user