Browse Source

Update optionals in models regarding slash commands

pull/1923/head
quin lynch 4 years ago
parent
commit
99a2204c43
6 changed files with 10 additions and 10 deletions
  1. +1
    -1
      src/Discord.Net.Rest/API/Common/ApplicationCommandInteractionData.cs
  2. +1
    -1
      src/Discord.Net.Rest/API/Common/ApplicationCommandInteractionDataOption.cs
  3. +1
    -1
      src/Discord.Net.WebSocket/Discord.Net.WebSocket.csproj
  4. +1
    -1
      src/Discord.Net.WebSocket/Discord.Net.WebSocket.xml
  5. +2
    -2
      src/Discord.Net.WebSocket/Entities/Interaction/Slash Commands/SocketSlashCommandDataOption.cs
  6. +4
    -4
      src/Discord.Net/Discord.Net.nuspec

+ 1
- 1
src/Discord.Net.Rest/API/Common/ApplicationCommandInteractionData.cs View File

@@ -12,7 +12,7 @@ namespace Discord.API
public string Name { get; set; }

[JsonProperty("options")]
public Optional<List<ApplicationCommandInteractionDataOption>> Options { get; set; }
public Optional<ApplicationCommandInteractionDataOption[]> Options { get; set; }

[JsonProperty("resolved")]
public Optional<ApplicationCommandInteractionDataResolved> Resolved { get; set; }


+ 1
- 1
src/Discord.Net.Rest/API/Common/ApplicationCommandInteractionDataOption.cs View File

@@ -15,6 +15,6 @@ namespace Discord.API
public Optional<object> Value { get; set; }

[JsonProperty("options")]
public List<ApplicationCommandInteractionDataOption> Options { get; set; } = new();
public Optional<ApplicationCommandInteractionDataOption[]> Options { get; set; }
}
}

+ 1
- 1
src/Discord.Net.WebSocket/Discord.Net.WebSocket.csproj View File

@@ -8,7 +8,7 @@
<TargetFrameworks Condition=" '$(OS)' == 'Windows_NT' ">net461;netstandard2.0;netstandard2.1</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netstandard2.0;netstandard2.1</TargetFrameworks>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Version>2.4.1</Version>
<Version>2.4.2</Version>
<RepositoryUrl>https://github.com/Discord-Net-Labs/Discord.Net-Labs</RepositoryUrl>
<PackageProjectUrl>https://github.com/Discord-Net-Labs/Discord.Net-Labs</PackageProjectUrl>
<PackageIcon>Temporary.png</PackageIcon>


+ 1
- 1
src/Discord.Net.WebSocket/Discord.Net.WebSocket.xml View File

@@ -1250,7 +1250,7 @@
<para>
With this option set to <see langword="false"/>, you will have to acknowledge the interaction with
<see cref="!:SocketInteraction.RespondAsync(string, bool, Embed, InteractionResponseType, AllowedMentions, RequestOptions)"/>.
Only after the interaction is acknowledged, the origional slash command message will be visible.
Only after the interaction is acknowledged, the original slash command message will be visible.
</para>
<note>
Please note that manually acknowledging the interaction with a message reply will not provide any return data.


+ 2
- 2
src/Discord.Net.WebSocket/Entities/Interaction/Slash Commands/SocketSlashCommandDataOption.cs View File

@@ -60,8 +60,8 @@ namespace Discord.WebSocket
this.Value = model.Value.Value;
}

this.Options = model.Options.Any()
? model.Options.Select(x => new SocketSlashCommandDataOption(data, x)).ToImmutableArray()
this.Options = model.Options.IsSpecified
? model.Options.Value.Select(x => new SocketSlashCommandDataOption(data, x)).ToImmutableArray()
: null;
}



+ 4
- 4
src/Discord.Net/Discord.Net.nuspec View File

@@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>Discord.Net.Labs</id>
<version>2.4.1$suffix$</version>
<version>2.4.2$suffix$</version>
<title>Discord.Net Labs</title>
<authors>Discord.Net Contributors</authors>
<owners>quinchs</owners>
@@ -16,21 +16,21 @@
<group targetFramework="net461">
<dependency id="Discord.Net.Labs.Core" version="2.4.1$suffix$" />
<dependency id="Discord.Net.Labs.Rest" version="2.4.0$suffix$" />
<dependency id="Discord.Net.Labs.WebSocket" version="2.4.1$suffix$" />
<dependency id="Discord.Net.Labs.WebSocket" version="2.4.2$suffix$" />
<dependency id="Discord.Net.Labs.Commands" version="2.3.5$suffix$" />
<dependency id="Discord.Net.Labs.Webhook" version="2.3.4$suffix$" />
</group>
<group targetFramework="netstandard2.0">
<dependency id="Discord.Net.Labs.Core" version="2.4.1$suffix$" />
<dependency id="Discord.Net.Labs.Rest" version="2.4.0$suffix$" />
<dependency id="Discord.Net.Labs.WebSocket" version="2.4.1$suffix$" />
<dependency id="Discord.Net.Labs.WebSocket" version="2.4.2$suffix$" />
<dependency id="Discord.Net.Labs.Commands" version="2.3.5$suffix$" />
<dependency id="Discord.Net.Labs.Webhook" version="2.3.4$suffix$" />
</group>
<group targetFramework="netstandard2.1">
<dependency id="Discord.Net.Labs.Core" version="2.4.1$suffix$" />
<dependency id="Discord.Net.Labs.Rest" version="2.4.0$suffix$" />
<dependency id="Discord.Net.Labs.WebSocket" version="2.4.1$suffix$" />
<dependency id="Discord.Net.Labs.WebSocket" version="2.4.2$suffix$" />
<dependency id="Discord.Net.Labs.Commands" version="2.3.5$suffix$" />
<dependency id="Discord.Net.Labs.Webhook" version="2.3.4$suffix$" />
</group>


Loading…
Cancel
Save