mirror of
https://github.com/Radarr/Radarr.git
synced 2024-09-17 15:02:34 +02:00
New: Added silent notification option to telegram
This commit is contained in:
parent
c96f29f1e8
commit
e2c0d83f20
@ -38,6 +38,7 @@ public void SendNotification(string title, string message, TelegramSettings sett
|
|||||||
.AddFormParameter("chat_id", settings.ChatId)
|
.AddFormParameter("chat_id", settings.ChatId)
|
||||||
.AddFormParameter("parse_mode", "HTML")
|
.AddFormParameter("parse_mode", "HTML")
|
||||||
.AddFormParameter("text", text)
|
.AddFormParameter("text", text)
|
||||||
|
.AddFormParameter("disable_notification", settings.SendSilently)
|
||||||
.Build();
|
.Build();
|
||||||
|
|
||||||
_httpClient.Post(request);
|
_httpClient.Post(request);
|
||||||
|
@ -24,7 +24,8 @@ public class TelegramSettings : IProviderConfig
|
|||||||
[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…
Reference in New Issue
Block a user