@@ -1,9 +1,5 @@ | |||||
using Newtonsoft.Json; | using Newtonsoft.Json; | ||||
using System; | |||||
using System.Collections.Generic; | using System.Collections.Generic; | ||||
using System.Linq; | |||||
using System.Text; | |||||
using System.Threading.Tasks; | |||||
namespace Discord.API | namespace Discord.API | ||||
{ | { | ||||
@@ -16,6 +12,6 @@ namespace Discord.API | |||||
public string Name { get; set; } | public string Name { get; set; } | ||||
[JsonProperty("options")] | [JsonProperty("options")] | ||||
public Optional<ApplicationCommandInteractionDataOption[]> Options { get; set; } | |||||
public List<ApplicationCommandInteractionDataOption> Options { get; set; } = new(); | |||||
} | } | ||||
} | } |
@@ -1,9 +1,5 @@ | |||||
using Newtonsoft.Json; | using Newtonsoft.Json; | ||||
using System; | |||||
using System.Collections.Generic; | using System.Collections.Generic; | ||||
using System.Linq; | |||||
using System.Text; | |||||
using System.Threading.Tasks; | |||||
namespace Discord.API | namespace Discord.API | ||||
{ | { | ||||
@@ -16,6 +12,6 @@ namespace Discord.API | |||||
public Optional<object> Value { get; set; } | public Optional<object> Value { get; set; } | ||||
[JsonProperty("options")] | [JsonProperty("options")] | ||||
public Optional<IEnumerable<ApplicationCommandInteractionDataOption>> Options { get; set; } | |||||
public List<ApplicationCommandInteractionDataOption> Options { get; set; } = new(); | |||||
} | } | ||||
} | } |
@@ -1,12 +1,9 @@ | |||||
using Discord.Rest; | using Discord.Rest; | ||||
using Newtonsoft.Json.Linq; | using Newtonsoft.Json.Linq; | ||||
using System; | using System; | ||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Text; | |||||
using System.Threading.Tasks; | using System.Threading.Tasks; | ||||
using Model = Discord.API.Gateway.InteractionCreated; | |||||
using DataModel = Discord.API.ApplicationCommandInteractionData; | using DataModel = Discord.API.ApplicationCommandInteractionData; | ||||
using Model = Discord.API.Gateway.InteractionCreated; | |||||
namespace Discord.WebSocket | namespace Discord.WebSocket | ||||
{ | { | ||||
@@ -40,7 +37,7 @@ namespace Discord.WebSocket | |||||
(model.Data.Value as JToken).ToObject<DataModel>() | (model.Data.Value as JToken).ToObject<DataModel>() | ||||
: null; | : null; | ||||
this.Data.Update(data, this.Guild.Id); | |||||
this.Data.Update(data, model.GuildId); | |||||
base.Update(model); | base.Update(model); | ||||
} | } | ||||
@@ -1,9 +1,6 @@ | |||||
using System; | |||||
using System.Collections.Generic; | using System.Collections.Generic; | ||||
using System.Collections.Immutable; | using System.Collections.Immutable; | ||||
using System.Linq; | using System.Linq; | ||||
using System.Text; | |||||
using System.Threading.Tasks; | |||||
using Model = Discord.API.ApplicationCommandInteractionData; | using Model = Discord.API.ApplicationCommandInteractionData; | ||||
namespace Discord.WebSocket | namespace Discord.WebSocket | ||||
@@ -14,7 +11,7 @@ namespace Discord.WebSocket | |||||
public string Name { get; private set; } | public string Name { get; private set; } | ||||
/// <summary> | /// <summary> | ||||
/// The <see cref="SocketSlashCommandDataOption"/>'s recieved with this interaction. | |||||
/// The <see cref="SocketSlashCommandDataOption"/>'s received with this interaction. | |||||
/// </summary> | /// </summary> | ||||
public IReadOnlyCollection<SocketSlashCommandDataOption> Options { get; private set; } | public IReadOnlyCollection<SocketSlashCommandDataOption> Options { get; private set; } | ||||
@@ -37,8 +34,8 @@ namespace Discord.WebSocket | |||||
this.Name = model.Name; | this.Name = model.Name; | ||||
this.guildId = guildId; | this.guildId = guildId; | ||||
this.Options = model.Options.IsSpecified | |||||
? model.Options.Value.Select(x => new SocketSlashCommandDataOption(x, this.Discord, guildId)).ToImmutableArray() | |||||
this.Options = model.Options.Any() | |||||
? model.Options.Select(x => new SocketSlashCommandDataOption(x, this.Discord, guildId)).ToImmutableArray() | |||||
: null; | : null; | ||||
} | } | ||||
@@ -1,9 +1,6 @@ | |||||
using System; | |||||
using System.Collections.Generic; | using System.Collections.Generic; | ||||
using System.Collections.Immutable; | using System.Collections.Immutable; | ||||
using System.Linq; | using System.Linq; | ||||
using System.Text; | |||||
using System.Threading.Tasks; | |||||
using Model = Discord.API.ApplicationCommandInteractionDataOption; | using Model = Discord.API.ApplicationCommandInteractionDataOption; | ||||
namespace Discord.WebSocket | namespace Discord.WebSocket | ||||
@@ -20,7 +17,7 @@ namespace Discord.WebSocket | |||||
public object Value { get; private set; } | public object Value { get; private set; } | ||||
/// <summary> | /// <summary> | ||||
/// The sub command options recieved for this sub command group. | |||||
/// The sub command options received for this sub command group. | |||||
/// </summary> | /// </summary> | ||||
public IReadOnlyCollection<SocketSlashCommandDataOption> Options { get; private set; } | public IReadOnlyCollection<SocketSlashCommandDataOption> Options { get; private set; } | ||||
@@ -35,8 +32,8 @@ namespace Discord.WebSocket | |||||
this.discord = discord; | this.discord = discord; | ||||
this.guild = guild; | this.guild = guild; | ||||
this.Options = model.Options.IsSpecified | |||||
? model.Options.Value.Select(x => new SocketSlashCommandDataOption(x, discord, guild)).ToImmutableArray() | |||||
this.Options = model.Options.Any() | |||||
? model.Options.Select(x => new SocketSlashCommandDataOption(x, discord, guild)).ToImmutableArray() | |||||
: null; | : null; | ||||
} | } | ||||