Browse Source

Merge pull request #7 from d4n3436/Interactions

Fix content length check in CreateInteractionResponse()
pull/1923/head
Quin Lynch GitHub 4 years ago
parent
commit
3b54bb2bb0
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/DiscordRestApiClient.cs

+ 1
- 1
src/Discord.Net.Rest/DiscordRestApiClient.cs View File

@@ -944,7 +944,7 @@ namespace Discord.API
public async Task CreateInteractionResponse(InteractionResponse response, ulong interactionId, string interactionToken, RequestOptions options = null) public async Task CreateInteractionResponse(InteractionResponse response, ulong interactionId, string interactionToken, RequestOptions options = null)
{ {
if(response.Data.IsSpecified && response.Data.Value.Content.IsSpecified) if(response.Data.IsSpecified && response.Data.Value.Content.IsSpecified)
Preconditions.AtMost(response.Data.Value.Content.Value.Length, 2000, nameof(response.Data.Value.Content));
Preconditions.AtMost(response.Data.Value.Content.Value?.Length ?? 0, 2000, nameof(response.Data.Value.Content));


options = RequestOptions.CreateOrClone(options); options = RequestOptions.CreateOrClone(options);




Loading…
Cancel
Save