Browse Source

Fix exception when uploading files (#2034)

tags/3.2.0
Quin Lynch GitHub 3 years ago
parent
commit
7f4feea96d
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      src/Discord.Net.Rest/Entities/Channels/ChannelHelper.cs

+ 1
- 1
src/Discord.Net.Rest/Entities/Channels/ChannelHelper.cs 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)
{


Loading…
Cancel
Save