New: Added silent notification option to telegram

(cherry picked from commit 9e392977b9f66be37c1fd6938c0b051c362ddb42)
pull/1689/head
Dtaggart 4 years ago committed by Qstick
parent f44359efe4
commit 0e98e93170

@ -37,6 +37,7 @@ namespace NzbDrone.Core.Notifications.Telegram
request.AddParameter("chat_id", settings.ChatId); request.AddParameter("chat_id", settings.ChatId);
request.AddParameter("parse_mode", "HTML"); request.AddParameter("parse_mode", "HTML");
request.AddParameter("text", text); request.AddParameter("text", text);
request.AddParameter("disable_notification", settings.SendSilently);
client.ExecuteAndValidate(request); client.ExecuteAndValidate(request);
} }

@ -24,7 +24,8 @@ namespace NzbDrone.Core.Notifications.Telegram
[FieldDefinition(1, Label = "Chat ID", HelpLink = "http://stackoverflow.com/a/37396871/882971", HelpText = "You must start a conversation with the bot or add it to your group to receive messages")] [FieldDefinition(1, Label = "Chat ID", HelpLink = "http://stackoverflow.com/a/37396871/882971", HelpText = "You must start a conversation with the bot or add it to your group to receive messages")]
public string ChatId { get; set; } public string ChatId { get; set; }
public bool IsValid => !string.IsNullOrWhiteSpace(ChatId) && !string.IsNullOrWhiteSpace(BotToken); [FieldDefinition(2, Label = "Send Silently", Type = FieldType.Checkbox, HelpText = "Sends the message silently. Users will receive a notification with no sound")]
public bool SendSilently { get; set; }
public NzbDroneValidationResult Validate() public NzbDroneValidationResult Validate()
{ {

Loading…
Cancel
Save