From 32da949a9547f68c57eb4338f749228b7de167c2 Mon Sep 17 00:00:00 2001 From: tidusjar Date: Wed, 1 Nov 2023 16:19:13 +0000 Subject: [PATCH] =?UTF-8?q?fix(discord):=20=F0=9F=90=9B=20Fixed=20an=20iss?= =?UTF-8?q?ue=20where=20the=20Icon=20in=20the=20discord=20notifications=20?= =?UTF-8?q?wouldn't=20apply?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Ombi.Api.Discord/Models/DiscordWebhookBody.cs | 2 +- src/Ombi.Notifications/Agents/DiscordNotification.cs | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Ombi.Api.Discord/Models/DiscordWebhookBody.cs b/src/Ombi.Api.Discord/Models/DiscordWebhookBody.cs index 7700005c8c..45f9598828 100644 --- a/src/Ombi.Api.Discord/Models/DiscordWebhookBody.cs +++ b/src/Ombi.Api.Discord/Models/DiscordWebhookBody.cs @@ -7,6 +7,7 @@ public class DiscordWebhookBody { public string content { get; set; } public string username { get; set; } + public string avatar_url { get; set; } public List embeds { get; set; } } @@ -32,7 +33,6 @@ public class DiscordAuthor { public string name { get; set; } public string url { get; set; } - public string iconurl { get; set; } } public class DiscordField diff --git a/src/Ombi.Notifications/Agents/DiscordNotification.cs b/src/Ombi.Notifications/Agents/DiscordNotification.cs index a1619de695..25d59e7a98 100644 --- a/src/Ombi.Notifications/Agents/DiscordNotification.cs +++ b/src/Ombi.Notifications/Agents/DiscordNotification.cs @@ -108,6 +108,7 @@ protected override async Task Send(NotificationMessage model, DiscordNotificatio { content = model.Message, username = settings.Username ?? "Ombi", + avatar_url = settings.Icon.HasValue() ? settings.Icon : string.Empty }; var fields = new List(); @@ -157,10 +158,7 @@ protected override async Task Send(NotificationMessage model, DiscordNotificatio } } - var author = new DiscordAuthor - { - iconurl = settings.Icon.HasValue() ? settings.Icon : string.Empty - }; + var author = new DiscordAuthor(); if (model.Data.TryGetValue("ApplicationUrl", out var appUrl)) {