From 4f793f6b9374984af554b82b07a4d1e2e43c98ad Mon Sep 17 00:00:00 2001 From: Bogdan Date: Wed, 25 Sep 2024 10:28:00 +0300 Subject: [PATCH] Remove $ from Discord delete notifications --- .../Notifications/Discord/Discord.cs | 190 +++++++++--------- 1 file changed, 95 insertions(+), 95 deletions(-) diff --git a/src/NzbDrone.Core/Notifications/Discord/Discord.cs b/src/NzbDrone.Core/Notifications/Discord/Discord.cs index 5245e89a3..526e1147a 100644 --- a/src/NzbDrone.Core/Notifications/Discord/Discord.cs +++ b/src/NzbDrone.Core/Notifications/Discord/Discord.cs @@ -25,15 +25,15 @@ namespace NzbDrone.Core.Notifications.Discord public override void OnGrab(GrabMessage message) { var embeds = new List - { - new Embed - { - Description = message.Message, - Title = message.Author.Name, - Text = message.Message, - Color = (int)DiscordColors.Warning - } - }; + { + new () + { + Description = message.Message, + Title = message.Author.Name, + Text = message.Message, + Color = (int)DiscordColors.Warning + } + }; var payload = CreatePayload($"Grabbed: {message.Message}", embeds); _proxy.SendPayload(payload, Settings); @@ -43,7 +43,7 @@ namespace NzbDrone.Core.Notifications.Discord { var attachments = new List { - new Embed + new () { Description = message.Message, Title = message.Author.Name, @@ -59,12 +59,12 @@ namespace NzbDrone.Core.Notifications.Discord public override void OnRename(Author author, List renamedFiles) { var attachments = new List - { - new Embed - { - Title = author.Name, - } - }; + { + new () + { + Title = author.Name, + } + }; var payload = CreatePayload("Renamed", attachments); @@ -74,21 +74,21 @@ namespace NzbDrone.Core.Notifications.Discord public override void OnAuthorAdded(Author author) { var attachments = new List - { - new Embed - { - Title = author.Name, - Fields = new List() - { - new DiscordField() - { - Name = "Links", - Value = string.Join(" / ", author.Metadata.Value.Links.Select(link => $"[{link.Name}]({link.Url})")) - } - }, - } - }; - var payload = CreatePayload($"Author Added", attachments); + { + new () + { + Title = author.Name, + Fields = new List() + { + new () + { + Name = "Links", + Value = string.Join(" / ", author.Metadata.Value.Links.Select(link => $"[{link.Name}]({link.Url})")) + } + }, + } + }; + var payload = CreatePayload("Author Added", attachments); _proxy.SendPayload(payload, Settings); } @@ -96,13 +96,13 @@ namespace NzbDrone.Core.Notifications.Discord public override void OnAuthorDelete(AuthorDeleteMessage deleteMessage) { var attachments = new List - { - new Embed - { - Title = deleteMessage.Author.Name, - Description = deleteMessage.DeletedFilesMessage - } - }; + { + new () + { + Title = deleteMessage.Author.Name, + Description = deleteMessage.DeletedFilesMessage + } + }; var payload = CreatePayload("Author Deleted", attachments); @@ -112,13 +112,13 @@ namespace NzbDrone.Core.Notifications.Discord public override void OnBookDelete(BookDeleteMessage deleteMessage) { var attachments = new List - { - new Embed - { - Title = $"${deleteMessage.Book.Author.Value.Name} - ${deleteMessage.Book.Title}", - Description = deleteMessage.DeletedFilesMessage - } - }; + { + new () + { + Title = $"{deleteMessage.Book.Author.Value.Name} - ${deleteMessage.Book.Title}", + Description = deleteMessage.DeletedFilesMessage + } + }; var payload = CreatePayload("Book Deleted", attachments); @@ -128,13 +128,13 @@ namespace NzbDrone.Core.Notifications.Discord public override void OnBookFileDelete(BookFileDeleteMessage deleteMessage) { var attachments = new List - { - new Embed - { - Title = $"${deleteMessage.Book.Author.Value.Name} - ${deleteMessage.Book.Title} - file deleted", - Description = deleteMessage.BookFile.Path - } - }; + { + new () + { + Title = $"{deleteMessage.Book.Author.Value.Name} - ${deleteMessage.Book.Title} - file deleted", + Description = deleteMessage.BookFile.Path + } + }; var payload = CreatePayload("Book File Deleted", attachments); @@ -144,14 +144,14 @@ namespace NzbDrone.Core.Notifications.Discord public override void OnHealthIssue(HealthCheck.HealthCheck healthCheck) { var attachments = new List - { - new Embed - { - Title = healthCheck.Source.Name, - Text = healthCheck.Message, - Color = healthCheck.Type == HealthCheck.HealthCheckResult.Warning ? (int)DiscordColors.Warning : (int)DiscordColors.Danger - } - }; + { + new () + { + Title = healthCheck.Source.Name, + Text = healthCheck.Message, + Color = healthCheck.Type == HealthCheck.HealthCheckResult.Warning ? (int)DiscordColors.Warning : (int)DiscordColors.Danger + } + }; var payload = CreatePayload("Health Issue", attachments); @@ -161,13 +161,13 @@ namespace NzbDrone.Core.Notifications.Discord public override void OnBookRetag(BookRetagMessage message) { var attachments = new List - { - new Embed - { - Title = BOOK_RETAGGED_TITLE, - Text = message.Message - } - }; + { + new () + { + Title = BOOK_RETAGGED_TITLE, + Text = message.Message + } + }; var payload = CreatePayload($"Track file tags updated: {message.Message}", attachments); @@ -178,7 +178,7 @@ namespace NzbDrone.Core.Notifications.Discord { var attachments = new List { - new Embed + new () { Description = message.Message, Title = message.SourceTitle, @@ -195,7 +195,7 @@ namespace NzbDrone.Core.Notifications.Discord { var attachments = new List { - new Embed + new () { Description = message.Message, Title = message.Book?.Title ?? message.Message, @@ -211,32 +211,32 @@ namespace NzbDrone.Core.Notifications.Discord public override void OnApplicationUpdate(ApplicationUpdateMessage updateMessage) { var attachments = new List - { - new Embed - { - Author = new DiscordAuthor - { - Name = Settings.Author.IsNullOrWhiteSpace() ? Environment.MachineName : Settings.Author, - IconUrl = "https://raw.githubusercontent.com/Readarr/Readarr/develop/Logo/256.png" - }, - Title = APPLICATION_UPDATE_TITLE, - Timestamp = DateTime.UtcNow.ToString("yyyy-MM-ddTHH:mm:ss.fffZ"), - Color = (int)DiscordColors.Standard, - Fields = new List() - { - new DiscordField() - { - Name = "Previous Version", - Value = updateMessage.PreviousVersion.ToString() - }, - new DiscordField() - { - Name = "New Version", - Value = updateMessage.NewVersion.ToString() - } - }, - } - }; + { + new () + { + Author = new DiscordAuthor + { + Name = Settings.Author.IsNullOrWhiteSpace() ? Environment.MachineName : Settings.Author, + IconUrl = "https://raw.githubusercontent.com/Readarr/Readarr/develop/Logo/256.png" + }, + Title = APPLICATION_UPDATE_TITLE, + Timestamp = DateTime.UtcNow.ToString("yyyy-MM-ddTHH:mm:ss.fffZ"), + Color = (int)DiscordColors.Standard, + Fields = new List() + { + new () + { + Name = "Previous Version", + Value = updateMessage.PreviousVersion.ToString() + }, + new () + { + Name = "New Version", + Value = updateMessage.NewVersion.ToString() + } + }, + } + }; var payload = CreatePayload(null, attachments);