From defbf37cfe9a86ed597c8af2927a6118547f2249 Mon Sep 17 00:00:00 2001 From: Ske Date: Fri, 26 Jul 2019 11:08:06 +0200 Subject: [PATCH] Fall back to system avatar when no member avatar is set --- PluralKit.Bot/Services/ProxyService.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PluralKit.Bot/Services/ProxyService.cs b/PluralKit.Bot/Services/ProxyService.cs index 9f51ac5d..d10edf9a 100644 --- a/PluralKit.Bot/Services/ProxyService.cs +++ b/PluralKit.Bot/Services/ProxyService.cs @@ -111,7 +111,8 @@ namespace PluralKit.Bot // Fetch a webhook for this channel, and send the proxied message var webhook = await _webhookCache.GetWebhook(message.Channel as ITextChannel); - var hookMessageId = await ExecuteWebhook(webhook, match.InnerText, match.ProxyName, match.Member.AvatarUrl, message.Attachments.FirstOrDefault()); + var avatarUrl = match.Member.AvatarUrl ?? match.System.AvatarUrl; + var hookMessageId = await ExecuteWebhook(webhook, match.InnerText, match.ProxyName, avatarUrl, message.Attachments.FirstOrDefault()); // Store the message in the database, and log it in the log channel (if applicable) await _messageStorage.Store(message.Author.Id, hookMessageId, message.Channel.Id, message.Id, match.Member);