Add explicit nullability for some fields of the Interaction Command record

This commit is contained in:
Daan Boerlage 2021-11-14 01:14:26 +01:00
parent bcc2742e81
commit 0f7f936492
Signed by: daan
GPG key ID: FCE070E1E4956606
2 changed files with 8 additions and 8 deletions

View file

@ -9,7 +9,7 @@ namespace Geekbot.Interactions.ApplicationCommand
/// unique id of the command /// unique id of the command
/// </summary> /// </summary>
[JsonPropertyName("id")] [JsonPropertyName("id")]
public string Id { get; set; } public string? Id { get; set; }
/// <summary> /// <summary>
/// the type of command, defaults 1 if not set /// the type of command, defaults 1 if not set
@ -21,13 +21,13 @@ namespace Geekbot.Interactions.ApplicationCommand
/// unique id of the parent application /// unique id of the parent application
/// </summary> /// </summary>
[JsonPropertyName("application_id")] [JsonPropertyName("application_id")]
public string ApplicationId { get; set; } public string? ApplicationId { get; set; }
/// <summary> /// <summary>
/// guild id of the command, if not global /// guild id of the command, if not global
/// </summary> /// </summary>
[JsonPropertyName("guild_id")] [JsonPropertyName("guild_id")]
public string GuildId { get; set; } public string? GuildId { get; set; }
/// <summary> /// <summary>
/// 1-32 character name /// 1-32 character name
@ -46,7 +46,7 @@ namespace Geekbot.Interactions.ApplicationCommand
/// Exclusive: CHAT_INPUT /// Exclusive: CHAT_INPUT
/// </remarks> /// </remarks>
[JsonPropertyName("description")] [JsonPropertyName("description")]
public string Description { get; set; } public string? Description { get; set; }
/// <summary> /// <summary>
/// the parameters for the command, max 25 /// the parameters for the command, max 25
@ -55,7 +55,7 @@ namespace Geekbot.Interactions.ApplicationCommand
/// Exclusive: CHAT_INPUT /// Exclusive: CHAT_INPUT
/// </remarks> /// </remarks>
[JsonPropertyName("options")] [JsonPropertyName("options")]
public List<Option> Options { get; set; } public List<Option>? Options { get; set; }
/// <summary> /// <summary>
/// whether the command is enabled by default when the app is added to a guild /// whether the command is enabled by default when the app is added to a guild
@ -67,6 +67,6 @@ namespace Geekbot.Interactions.ApplicationCommand
/// autoincrementing version identifier updated during substantial record changes /// autoincrementing version identifier updated during substantial record changes
/// </summary> /// </summary>
[JsonPropertyName("version")] [JsonPropertyName("version")]
public string Version { get; set; } public string? Version { get; set; }
} }
} }

View file

@ -39,12 +39,12 @@ namespace Geekbot.Interactions.ApplicationCommand
/// choices for STRING, INTEGER, and NUMBER types for the user to pick from, max 25 /// choices for STRING, INTEGER, and NUMBER types for the user to pick from, max 25
/// </summary> /// </summary>
[JsonPropertyName("choices")] [JsonPropertyName("choices")]
public List<OptionChoice> Choices { get; set; } public List<OptionChoice>? Choices { get; set; }
/// <summary> /// <summary>
/// if the option is a subcommand or subcommand group type, this nested options will be the parameters /// if the option is a subcommand or subcommand group type, this nested options will be the parameters
/// </summary> /// </summary>
[JsonPropertyName("options")] [JsonPropertyName("options")]
public List<Option> Options { get; set; } public List<Option>? Options { get; set; }
} }
} }