From f644e6831a59b2893e134dd356f9f6425022fcae Mon Sep 17 00:00:00 2001 From: Takaaki Suzuki Date: Sun, 17 Nov 2024 00:17:03 +0900 Subject: [PATCH] Eliminate the waste of checking arguments under the same conditions. (#3027) --- src/Discord.Net.Rest/DiscordRestApiClient.cs | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/Discord.Net.Rest/DiscordRestApiClient.cs b/src/Discord.Net.Rest/DiscordRestApiClient.cs index 4c138523..58bded37 100644 --- a/src/Discord.Net.Rest/DiscordRestApiClient.cs +++ b/src/Discord.Net.Rest/DiscordRestApiClient.cs @@ -1524,9 +1524,6 @@ namespace Discord.API throw new ArgumentException("At least one of 'Content', 'Embeds', 'File' or 'Components' must be specified.", nameof(args)); } - if (args.Content.IsSpecified && args.Content.Value is not null && args.Content.Value.Length > DiscordConfig.MaxMessageSize) - throw new ArgumentException(message: $"Message content is too long, length must be less or equal to {DiscordConfig.MaxMessageSize}.", paramName: nameof(args.Content)); - if (args.Content.IsSpecified && args.Content.Value?.Length > DiscordConfig.MaxMessageSize) throw new ArgumentException(message: $"Message content is too long, length must be less or equal to {DiscordConfig.MaxMessageSize}.", paramName: nameof(args.Content));