diff --git a/src/UniversalTelegramBot.cpp b/src/UniversalTelegramBot.cpp index 3352cef..f696291 100644 --- a/src/UniversalTelegramBot.cpp +++ b/src/UniversalTelegramBot.cpp @@ -561,7 +561,8 @@ bool UniversalTelegramBot::sendSimpleMessage(const String& chat_id, const String } bool UniversalTelegramBot::sendMessage(const String& chat_id, const String& text, - const String& parse_mode, int message_id, bool disable_web_page_preview) { + const String& parse_mode, int message_id, bool disable_web_page_preview, + bool disable_notification) { DynamicJsonDocument payload(maxMessageLength); payload["chat_id"] = chat_id; @@ -576,6 +577,9 @@ bool UniversalTelegramBot::sendMessage(const String& chat_id, const String& text if (disable_web_page_preview) payload["disable_web_page_preview"] = disable_web_page_preview; + if (disable_notification) + payload["disable_notification"] = disable_notification; + return sendPostMessage(payload.as(), message_id); // if message id == 0 then edit is false, else edit is true } diff --git a/src/UniversalTelegramBot.h b/src/UniversalTelegramBot.h index 4932c5a..f5b73d9 100644 --- a/src/UniversalTelegramBot.h +++ b/src/UniversalTelegramBot.h @@ -84,7 +84,7 @@ class UniversalTelegramBot { bool sendSimpleMessage(const String& chat_id, const String& text, const String& parse_mode); bool sendMessage(const String& chat_id, const String& text, const String& parse_mode = "", int message_id = 0, - bool disable_web_page_preview = false); + bool disable_web_page_preview = false, bool disable_notification = false); bool deleteMessage(const String& chat_id, int message_id = 0); bool sendMessageWithReplyKeyboard(const String& chat_id, const String& text, const String& parse_mode, const String& keyboard,