Skip to content

Commit

Permalink
Eliminate the waste of checking arguments under the same conditions. (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
xin9le authored Nov 16, 2024
1 parent 164a289 commit f644e68
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions src/Discord.Net.Rest/DiscordRestApiClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1524,9 +1524,6 @@ public Task<Message> CreateInteractionFollowupMessageAsync(CreateWebhookMessageP
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));

Expand Down

0 comments on commit f644e68

Please sign in to comment.