summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/tgbot/Api.h7
-rw-r--r--src/Api.cpp4
2 files changed, 11 insertions, 0 deletions
diff --git a/include/tgbot/Api.h b/include/tgbot/Api.h
index 5c3313d..e5b8c5e 100644
--- a/include/tgbot/Api.h
+++ b/include/tgbot/Api.h
@@ -410,6 +410,13 @@ public:
const GenericReply::Ptr replyMarkup = GenericReply::Ptr()) const;
/**
+ * Use this method to delete messages sent by bot (or by other users if bot is admin).
+ * @param chatId Unique identifier for the target chat.
+ * @param messageId Unique identifier for the target message.
+ */
+ void deleteMessage(int64_t chatId, int32_t messageId) const;
+
+ /**
* Use this method to receive incoming updates using long polling.
* This method will not work if an outgoing webhook is set up.
* In order to avoid getting duplicate updates, recalculate offset after each server response.
diff --git a/src/Api.cpp b/src/Api.cpp
index b7a53c1..8029c33 100644
--- a/src/Api.cpp
+++ b/src/Api.cpp
@@ -692,4 +692,8 @@ std::string Api::downloadFile(const std::string& filePath, const std::vector<Htt
return serverResponse;
}
+void Api::deleteMessage(int64_t chatId, int32_t messageId) const {
+ sendRequest("deleteMessage", { HttpReqArg("chat_id", chatId), HttpReqArg("message_id", messageId) });
+}
+
}