Fall back to system avatar when no member avatar is set

This commit is contained in:
Ske 2019-07-26 11:08:06 +02:00
parent b14666aa4f
commit defbf37cfe

View File

@ -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);