Browse Source

Added restriction for description not being null (#200)

pull/1923/head
Simon Hjorthøj GitHub 4 years ago
parent
commit
94ff2e69ed
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      src/Discord.Net.Core/Entities/Interactions/Slash Commands/SlashCommandBuilder.cs

+ 3
- 1
src/Discord.Net.Core/Entities/Interactions/Slash Commands/SlashCommandBuilder.cs View File

@@ -50,7 +50,8 @@ namespace Discord
}

/// <summary>
/// A 1-100 length description of this slash command
/// A 1-100 length description of this slash command.
/// The description is not allowed to be null.
/// </summary>
public string Description
{
@@ -60,6 +61,7 @@ namespace Discord
}
set
{
Preconditions.NotNullOrEmpty(value, nameof(Description));
Preconditions.AtLeast(value.Length, 1, nameof(Description));
Preconditions.AtMost(value.Length, MaxDescriptionLength, nameof(Description));



Loading…
Cancel
Save