|
|
@@ -372,6 +372,16 @@ namespace Discord.Rest |
|
|
|
Preconditions.NotNullOrEmpty(attachment.FileName, nameof(attachment.FileName), "File Name must not be empty or null"); |
|
|
|
} |
|
|
|
|
|
|
|
if (channel is ITextChannel guildTextChannel) |
|
|
|
{ |
|
|
|
var contentSize = (ulong)attachments.Sum(x => x.Stream.Length); |
|
|
|
|
|
|
|
if (contentSize > guildTextChannel.Guild.MaxUploadLimit) |
|
|
|
{ |
|
|
|
throw new ArgumentOutOfRangeException(nameof(attachments), $"Collective file size exceeds the max file size of {guildTextChannel.Guild.MaxUploadLimit} bytes in that guild!"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// check that user flag and user Id list are exclusive, same with role flag and role Id list |
|
|
|
if (allowedMentions != null && allowedMentions.AllowedTypes.HasValue) |
|
|
|
{ |
|
|
|