Fix exception when uploading files (#2034)

This commit is contained in:
Quin Lynch
2022-01-14 07:57:02 -04:00
committed by GitHub
parent 64423a0653
commit 7f4feea96d

View File

@@ -374,7 +374,7 @@ namespace Discord.Rest
if (channel is ITextChannel guildTextChannel)
{
var contentSize = (ulong)attachments.Sum(x => x.Stream.Length);
ulong contentSize = (ulong)attachments.Where(x => x.Stream.CanSeek).Sum(x => x.Stream.Length);
if (contentSize > guildTextChannel.Guild.MaxUploadLimit)
{