feat: respect guild boost file size limit when re-sending attachments

This commit is contained in:
spiral 2021-11-04 14:13:43 -04:00
parent b1bd563dad
commit 38cbca1b34
No known key found for this signature in database
GPG key ID: A6059F0CA0E1BD31
4 changed files with 29 additions and 2 deletions

View file

@ -146,6 +146,7 @@ namespace PluralKit.Bot
var messageChannel = _cache.GetChannel(trigger.ChannelId);
var rootChannel = _cache.GetRootChannel(trigger.ChannelId);
var threadId = messageChannel.IsThread() ? messageChannel.Id : (ulong?)null;
var guild = _cache.GetGuild(trigger.GuildId.Value);
var proxyMessage = await _webhookExecutor.ExecuteWebhook(new ProxyRequest
{
@ -156,6 +157,7 @@ namespace PluralKit.Bot
AvatarUrl = AvatarUtils.TryRewriteCdnUrl(match.Member.ProxyAvatar(ctx)),
Content = content,
Attachments = trigger.Attachments,
FileSizeLimit = guild.FileSizeLimit(),
Embeds = embeds.ToArray(),
AllowEveryone = allowEveryone,
});