* added interaction specific interfaces * fix build error * implement change requestspull/1923/head
| @@ -0,0 +1,13 @@ | |||||
| namespace Discord | |||||
| { | |||||
| /// <summary> | |||||
| /// Represents a Message Command interaction. | |||||
| /// </summary> | |||||
| public interface IMessageCommandInteraction : IDiscordInteraction | |||||
| { | |||||
| /// <summary> | |||||
| /// Gets the data associated with this interaction. | |||||
| /// </summary> | |||||
| new IMessageCommandInteractionData Data { get; } | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,13 @@ | |||||
| namespace Discord | |||||
| { | |||||
| /// <summary> | |||||
| /// Represents the data tied with the <see cref="IMessageCommandInteraction"/> interaction. | |||||
| /// </summary> | |||||
| public interface IMessageCommandInteractionData : IApplicationCommandInteractionData | |||||
| { | |||||
| /// <summary> | |||||
| /// Gets the message associated with this message command. | |||||
| /// </summary> | |||||
| IMessage Message { get; } | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,13 @@ | |||||
| namespace Discord | |||||
| { | |||||
| /// <summary> | |||||
| /// Represents a User Command interaction. | |||||
| /// </summary> | |||||
| public interface IUserCommandInteraction : IDiscordInteraction | |||||
| { | |||||
| /// <summary> | |||||
| /// Gets the data associated with this interaction. | |||||
| /// </summary> | |||||
| new IUserCommandInteractionData Data { get; } | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,13 @@ | |||||
| namespace Discord | |||||
| { | |||||
| /// <summary> | |||||
| /// Represents the data tied with the <see cref="IUserCommandInteraction"/> interaction. | |||||
| /// </summary> | |||||
| public interface IUserCommandInteractionData : IApplicationCommandInteractionData | |||||
| { | |||||
| /// <summary> | |||||
| /// Gets the user who this command targets. | |||||
| /// </summary> | |||||
| IUser User { get; } | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,18 @@ | |||||
| namespace Discord | |||||
| { | |||||
| /// <summary> | |||||
| /// Represents an interaction type for Message Components. | |||||
| /// </summary> | |||||
| public interface IComponentInteraction : IDiscordInteraction | |||||
| { | |||||
| /// <summary> | |||||
| /// Gets the data received with this interaction, contains the button that was clicked. | |||||
| /// </summary> | |||||
| new IComponentInteractionData Data { get; } | |||||
| /// <summary> | |||||
| /// Gets the message that contained the trigger for this interaction. | |||||
| /// </summary> | |||||
| IUserMessage Message { get; } | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,25 @@ | |||||
| using System.Collections.Generic; | |||||
| namespace Discord | |||||
| { | |||||
| /// <summary> | |||||
| /// Represents the data sent with the <see cref="IComponentInteraction"/>. | |||||
| /// </summary> | |||||
| public interface IComponentInteractionData : IDiscordInteractionData | |||||
| { | |||||
| /// <summary> | |||||
| /// Gets the components Custom Id that was clicked. | |||||
| /// </summary> | |||||
| string CustomId { get; } | |||||
| /// <summary> | |||||
| /// Gets the type of the component clicked. | |||||
| /// </summary> | |||||
| ComponentType Type { get; } | |||||
| /// <summary> | |||||
| /// Gets the value(s) of a <see cref="SelectMenuComponent"/> interaction response. | |||||
| /// </summary> | |||||
| IReadOnlyCollection<string> Values { get; } | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,13 @@ | |||||
| namespace Discord | |||||
| { | |||||
| /// <summary> | |||||
| /// Represents a <see cref="InteractionType.ApplicationCommandAutocomplete"/>. | |||||
| /// </summary> | |||||
| public interface IAutocompleteInteraction : IDiscordInteraction | |||||
| { | |||||
| /// <summary> | |||||
| /// Gets the autocomplete data of this interaction. | |||||
| /// </summary> | |||||
| new IAutocompleteInteractionData Data { get; } | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,40 @@ | |||||
| using System.Collections.Generic; | |||||
| namespace Discord | |||||
| { | |||||
| /// <summary> | |||||
| /// Represents data for a slash commands autocomplete interaction. | |||||
| /// </summary> | |||||
| public interface IAutocompleteInteractionData : IDiscordInteractionData | |||||
| { | |||||
| /// <summary> | |||||
| /// Gets the name of the invoked command. | |||||
| /// </summary> | |||||
| string CommandName { get; } | |||||
| /// <summary> | |||||
| /// Gets the id of the invoked command. | |||||
| /// </summary> | |||||
| ulong CommandId { get; } | |||||
| /// <summary> | |||||
| /// Gets the type of the invoked command. | |||||
| /// </summary> | |||||
| ApplicationCommandType Type { get; } | |||||
| /// <summary> | |||||
| /// Gets the version of the invoked command. | |||||
| /// </summary> | |||||
| ulong Version { get; } | |||||
| /// <summary> | |||||
| /// Gets the current autocomplete option that is actively being filled out. | |||||
| /// </summary> | |||||
| AutocompleteOption Current { get; } | |||||
| /// <summary> | |||||
| /// Gets a collection of all the other options the executing users has filled out. | |||||
| /// </summary> | |||||
| IReadOnlyCollection<AutocompleteOption> Options { get; } | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,13 @@ | |||||
| namespace Discord | |||||
| { | |||||
| /// <summary> | |||||
| /// Represents a slash command interaction. | |||||
| /// </summary> | |||||
| public interface ISlashCommandInteraction : IDiscordInteraction | |||||
| { | |||||
| /// <summary> | |||||
| /// Gets the data associated with this interaction. | |||||
| /// </summary> | |||||
| new IApplicationCommandInteractionData Data { get; } | |||||
| } | |||||
| } | |||||
| @@ -7,7 +7,7 @@ namespace Discord.Rest | |||||
| /// <summary> | /// <summary> | ||||
| /// Represents a REST-based message command interaction. | /// Represents a REST-based message command interaction. | ||||
| /// </summary> | /// </summary> | ||||
| public class RestMessageCommand : RestCommandBase, IDiscordInteraction | |||||
| public class RestMessageCommand : RestCommandBase, IMessageCommandInteraction, IDiscordInteraction | |||||
| { | { | ||||
| /// <summary> | /// <summary> | ||||
| /// The data associated with this interaction. | /// The data associated with this interaction. | ||||
| @@ -38,6 +38,8 @@ namespace Discord.Rest | |||||
| Data = await RestMessageCommandData.CreateAsync(client, dataModel, Guild, Channel).ConfigureAwait(false); | Data = await RestMessageCommandData.CreateAsync(client, dataModel, Guild, Channel).ConfigureAwait(false); | ||||
| } | } | ||||
| IDiscordInteractionData IDiscordInteraction.Data => Data; | |||||
| //IMessageCommandInteraction | |||||
| /// <inheritdoc/> | |||||
| IMessageCommandInteractionData IMessageCommandInteraction.Data => Data; | |||||
| } | } | ||||
| } | } | ||||
| @@ -10,7 +10,7 @@ namespace Discord.Rest | |||||
| /// <summary> | /// <summary> | ||||
| /// Represents the data for a <see cref="RestMessageCommand"/>. | /// Represents the data for a <see cref="RestMessageCommand"/>. | ||||
| /// </summary> | /// </summary> | ||||
| public class RestMessageCommandData : RestCommandBaseData, IDiscordInteractionData | |||||
| public class RestMessageCommandData : RestCommandBaseData, IMessageCommandInteractionData, IDiscordInteractionData | |||||
| { | { | ||||
| /// <summary> | /// <summary> | ||||
| /// Gets the message associated with this message command. | /// Gets the message associated with this message command. | ||||
| @@ -34,5 +34,9 @@ namespace Discord.Rest | |||||
| await entity.UpdateAsync(client, model, guild, channel).ConfigureAwait(false); | await entity.UpdateAsync(client, model, guild, channel).ConfigureAwait(false); | ||||
| return entity; | return entity; | ||||
| } | } | ||||
| //IMessageCommandInteractionData | |||||
| /// <inheritdoc/> | |||||
| IMessage IMessageCommandInteractionData.Message => Message; | |||||
| } | } | ||||
| } | } | ||||
| @@ -11,7 +11,7 @@ namespace Discord.Rest | |||||
| /// <summary> | /// <summary> | ||||
| /// Represents a REST-based user command. | /// Represents a REST-based user command. | ||||
| /// </summary> | /// </summary> | ||||
| internal class RestUserCommand : RestCommandBase, IDiscordInteraction | |||||
| internal class RestUserCommand : RestCommandBase, IUserCommandInteraction, IDiscordInteraction | |||||
| { | { | ||||
| /// <summary> | /// <summary> | ||||
| /// Gets the data associated with this interaction. | /// Gets the data associated with this interaction. | ||||
| @@ -41,6 +41,8 @@ namespace Discord.Rest | |||||
| Data = await RestUserCommandData.CreateAsync(client, dataModel, Guild, Channel).ConfigureAwait(false); | Data = await RestUserCommandData.CreateAsync(client, dataModel, Guild, Channel).ConfigureAwait(false); | ||||
| } | } | ||||
| IDiscordInteractionData IDiscordInteraction.Data => Data; | |||||
| //IUserCommandInteractionData | |||||
| /// <inheritdoc/> | |||||
| IUserCommandInteractionData IUserCommandInteraction.Data => Data; | |||||
| } | } | ||||
| } | } | ||||
| @@ -8,7 +8,7 @@ namespace Discord.Rest | |||||
| /// <summary> | /// <summary> | ||||
| /// Represents the data for a <see cref="RestUserCommand"/>. | /// Represents the data for a <see cref="RestUserCommand"/>. | ||||
| /// </summary> | /// </summary> | ||||
| public class RestUserCommandData : RestCommandBaseData, IDiscordInteractionData | |||||
| public class RestUserCommandData : RestCommandBaseData, IUserCommandInteractionData, IDiscordInteractionData | |||||
| { | { | ||||
| /// <summary> | /// <summary> | ||||
| /// Gets the user who this command targets. | /// Gets the user who this command targets. | ||||
| @@ -32,5 +32,9 @@ namespace Discord.Rest | |||||
| await entity.UpdateAsync(client, model, guild, channel).ConfigureAwait(false); | await entity.UpdateAsync(client, model, guild, channel).ConfigureAwait(false); | ||||
| return entity; | return entity; | ||||
| } | } | ||||
| //IUserCommandInteractionData | |||||
| /// <inheritdoc/> | |||||
| IUser IUserCommandInteractionData.User => Member; | |||||
| } | } | ||||
| } | } | ||||
| @@ -13,7 +13,7 @@ namespace Discord.Rest | |||||
| /// <summary> | /// <summary> | ||||
| /// Represents a REST-based message component. | /// Represents a REST-based message component. | ||||
| /// </summary> | /// </summary> | ||||
| internal class RestMessageComponent : RestInteraction, IDiscordInteraction | |||||
| internal class RestMessageComponent : RestInteraction, IComponentInteraction, IDiscordInteraction | |||||
| { | { | ||||
| /// <summary> | /// <summary> | ||||
| /// Gets the data received with this interaction, contains the button that was clicked. | /// Gets the data received with this interaction, contains the button that was clicked. | ||||
| @@ -442,6 +442,11 @@ namespace Discord.Rest | |||||
| return SerializePayload(response); | return SerializePayload(response); | ||||
| } | } | ||||
| IDiscordInteractionData IDiscordInteraction.Data => Data; | |||||
| //IComponentInteraction | |||||
| /// <inheritdoc/> | |||||
| IComponentInteractionData IComponentInteraction.Data => Data; | |||||
| /// <inheritdoc/> | |||||
| IUserMessage IComponentInteraction.Message => Message; | |||||
| } | } | ||||
| } | } | ||||
| @@ -10,7 +10,7 @@ namespace Discord.Rest | |||||
| /// <summary> | /// <summary> | ||||
| /// Represents data for a <see cref="RestMessageComponent"/>. | /// Represents data for a <see cref="RestMessageComponent"/>. | ||||
| /// </summary> | /// </summary> | ||||
| public class RestMessageComponentData : IDiscordInteractionData | |||||
| public class RestMessageComponentData : IComponentInteractionData, IDiscordInteractionData | |||||
| { | { | ||||
| /// <summary> | /// <summary> | ||||
| /// Gets the components Custom Id that was clicked. | /// Gets the components Custom Id that was clicked. | ||||
| @@ -12,7 +12,7 @@ namespace Discord.Rest | |||||
| /// <summary> | /// <summary> | ||||
| /// Represents a REST-based autocomplete interaction. | /// Represents a REST-based autocomplete interaction. | ||||
| /// </summary> | /// </summary> | ||||
| public class RestAutocompleteInteraction : RestInteraction, IDiscordInteraction | |||||
| public class RestAutocompleteInteraction : RestInteraction, IAutocompleteInteraction, IDiscordInteraction | |||||
| { | { | ||||
| /// <summary> | /// <summary> | ||||
| /// Gets the autocomplete data of this interaction. | /// Gets the autocomplete data of this interaction. | ||||
| @@ -128,7 +128,8 @@ namespace Discord.Rest | |||||
| public override string Respond(string text = null, Embed[] embeds = null, bool isTTS = false, bool ephemeral = false, AllowedMentions allowedMentions = null, RequestOptions options = null, MessageComponent component = null, Embed embed = null) | public override string Respond(string text = null, Embed[] embeds = null, bool isTTS = false, bool ephemeral = false, AllowedMentions allowedMentions = null, RequestOptions options = null, MessageComponent component = null, Embed embed = null) | ||||
| => throw new NotSupportedException("Autocomplete interactions cannot be deferred!"); | => throw new NotSupportedException("Autocomplete interactions cannot be deferred!"); | ||||
| IDiscordInteractionData IDiscordInteraction.Data => Data; | |||||
| //IAutocompleteInteraction | |||||
| /// <inheritdoc/> | |||||
| IAutocompleteInteractionData IAutocompleteInteraction.Data => Data; | |||||
| } | } | ||||
| } | } | ||||
| @@ -11,7 +11,7 @@ namespace Discord.Rest | |||||
| /// <summary> | /// <summary> | ||||
| /// Represents the data for a <see cref="RestAutocompleteInteraction"/>. | /// Represents the data for a <see cref="RestAutocompleteInteraction"/>. | ||||
| /// </summary> | /// </summary> | ||||
| public class RestAutocompleteInteractionData : IDiscordInteractionData | |||||
| public class RestAutocompleteInteractionData : IAutocompleteInteractionData | |||||
| { | { | ||||
| /// <summary> | /// <summary> | ||||
| /// Gets the name of the invoked command. | /// Gets the name of the invoked command. | ||||
| @@ -11,7 +11,7 @@ namespace Discord.Rest | |||||
| /// <summary> | /// <summary> | ||||
| /// Represents a REST-based slash command. | /// Represents a REST-based slash command. | ||||
| /// </summary> | /// </summary> | ||||
| public class RestSlashCommand : RestCommandBase, IDiscordInteraction | |||||
| public class RestSlashCommand : RestCommandBase, ISlashCommandInteraction, IDiscordInteraction | |||||
| { | { | ||||
| /// <summary> | /// <summary> | ||||
| /// Gets the data associated with this interaction. | /// Gets the data associated with this interaction. | ||||
| @@ -39,6 +39,8 @@ namespace Discord.Rest | |||||
| Data = await RestSlashCommandData.CreateAsync(client, dataModel, Guild, Channel); | Data = await RestSlashCommandData.CreateAsync(client, dataModel, Guild, Channel); | ||||
| } | } | ||||
| IDiscordInteractionData IDiscordInteraction.Data => Data; | |||||
| //ISlashCommandInteraction | |||||
| /// <inheritdoc/> | |||||
| IApplicationCommandInteractionData ISlashCommandInteraction.Data => Data; | |||||
| } | } | ||||
| } | } | ||||
| @@ -6,7 +6,7 @@ namespace Discord.WebSocket | |||||
| /// <summary> | /// <summary> | ||||
| /// Represents a Websocket-based slash command received over the gateway. | /// Represents a Websocket-based slash command received over the gateway. | ||||
| /// </summary> | /// </summary> | ||||
| public class SocketMessageCommand : SocketCommandBase, IDiscordInteraction | |||||
| public class SocketMessageCommand : SocketCommandBase, IMessageCommandInteraction, IDiscordInteraction | |||||
| { | { | ||||
| /// <summary> | /// <summary> | ||||
| /// The data associated with this interaction. | /// The data associated with this interaction. | ||||
| @@ -34,6 +34,12 @@ namespace Discord.WebSocket | |||||
| return entity; | return entity; | ||||
| } | } | ||||
| //IMessageCommandInteraction | |||||
| /// <inheritdoc/> | |||||
| IMessageCommandInteractionData IMessageCommandInteraction.Data => Data; | |||||
| //IDiscordInteraction | |||||
| /// <inheritdoc/> | |||||
| IDiscordInteractionData IDiscordInteraction.Data => Data; | IDiscordInteractionData IDiscordInteraction.Data => Data; | ||||
| } | } | ||||
| } | } | ||||
| @@ -7,7 +7,7 @@ namespace Discord.WebSocket | |||||
| /// <summary> | /// <summary> | ||||
| /// Represents the data tied with the <see cref="SocketMessageCommand"/> interaction. | /// Represents the data tied with the <see cref="SocketMessageCommand"/> interaction. | ||||
| /// </summary> | /// </summary> | ||||
| public class SocketMessageCommandData : SocketCommandBaseData, IDiscordInteractionData | |||||
| public class SocketMessageCommandData : SocketCommandBaseData, IMessageCommandInteractionData, IDiscordInteractionData | |||||
| { | { | ||||
| /// <summary> | /// <summary> | ||||
| /// Gets the message associated with this message command. | /// Gets the message associated with this message command. | ||||
| @@ -31,5 +31,9 @@ namespace Discord.WebSocket | |||||
| entity.Update(model); | entity.Update(model); | ||||
| return entity; | return entity; | ||||
| } | } | ||||
| //IMessageCommandInteractionData | |||||
| /// <inheritdoc/> | |||||
| IMessage IMessageCommandInteractionData.Message => Message; | |||||
| } | } | ||||
| } | } | ||||
| @@ -6,7 +6,7 @@ namespace Discord.WebSocket | |||||
| /// <summary> | /// <summary> | ||||
| /// Represents a Websocket-based slash command received over the gateway. | /// Represents a Websocket-based slash command received over the gateway. | ||||
| /// </summary> | /// </summary> | ||||
| public class SocketUserCommand : SocketCommandBase, IDiscordInteraction | |||||
| public class SocketUserCommand : SocketCommandBase, IUserCommandInteraction, IDiscordInteraction | |||||
| { | { | ||||
| /// <summary> | /// <summary> | ||||
| /// The data associated with this interaction. | /// The data associated with this interaction. | ||||
| @@ -34,6 +34,12 @@ namespace Discord.WebSocket | |||||
| return entity; | return entity; | ||||
| } | } | ||||
| //IUserCommandInteraction | |||||
| /// <inheritdoc/> | |||||
| IUserCommandInteractionData IUserCommandInteraction.Data => Data; | |||||
| //IDiscordInteraction | |||||
| /// <inheritdoc/> | |||||
| IDiscordInteractionData IDiscordInteraction.Data => Data; | IDiscordInteractionData IDiscordInteraction.Data => Data; | ||||
| } | } | ||||
| } | } | ||||
| @@ -7,7 +7,7 @@ namespace Discord.WebSocket | |||||
| /// <summary> | /// <summary> | ||||
| /// Represents the data tied with the <see cref="SocketUserCommand"/> interaction. | /// Represents the data tied with the <see cref="SocketUserCommand"/> interaction. | ||||
| /// </summary> | /// </summary> | ||||
| public class SocketUserCommandData : SocketCommandBaseData, IDiscordInteractionData | |||||
| public class SocketUserCommandData : SocketCommandBaseData, IUserCommandInteractionData, IDiscordInteractionData | |||||
| { | { | ||||
| /// <summary> | /// <summary> | ||||
| /// Gets the user who this command targets. | /// Gets the user who this command targets. | ||||
| @@ -31,5 +31,9 @@ namespace Discord.WebSocket | |||||
| entity.Update(model); | entity.Update(model); | ||||
| return entity; | return entity; | ||||
| } | } | ||||
| //IUserCommandInteractionData | |||||
| /// <inheritdoc/> | |||||
| IUser IUserCommandInteractionData.User => Member; | |||||
| } | } | ||||
| } | } | ||||
| @@ -13,7 +13,7 @@ namespace Discord.WebSocket | |||||
| /// <summary> | /// <summary> | ||||
| /// Represents a Websocket-based interaction type for Message Components. | /// Represents a Websocket-based interaction type for Message Components. | ||||
| /// </summary> | /// </summary> | ||||
| public class SocketMessageComponent : SocketInteraction, IDiscordInteraction | |||||
| public class SocketMessageComponent : SocketInteraction, IComponentInteraction, IDiscordInteraction | |||||
| { | { | ||||
| /// <summary> | /// <summary> | ||||
| /// Gets the data received with this interaction, contains the button that was clicked. | /// Gets the data received with this interaction, contains the button that was clicked. | ||||
| @@ -422,6 +422,15 @@ namespace Discord.WebSocket | |||||
| } | } | ||||
| } | } | ||||
| //IComponentInteraction | |||||
| /// <inheritdoc/> | |||||
| IComponentInteractionData IComponentInteraction.Data => Data; | |||||
| /// <inheritdoc/> | |||||
| IUserMessage IComponentInteraction.Message => Message; | |||||
| //IDiscordInteraction | |||||
| /// <inheritdoc/> | |||||
| IDiscordInteractionData IDiscordInteraction.Data => Data; | IDiscordInteractionData IDiscordInteraction.Data => Data; | ||||
| } | } | ||||
| } | } | ||||
| @@ -6,7 +6,7 @@ namespace Discord.WebSocket | |||||
| /// <summary> | /// <summary> | ||||
| /// Represents the data sent with a <see cref="InteractionType.MessageComponent"/>. | /// Represents the data sent with a <see cref="InteractionType.MessageComponent"/>. | ||||
| /// </summary> | /// </summary> | ||||
| public class SocketMessageComponentData : IDiscordInteractionData | |||||
| public class SocketMessageComponentData : IComponentInteractionData | |||||
| { | { | ||||
| /// <summary> | /// <summary> | ||||
| /// Gets the components Custom Id that was clicked. | /// Gets the components Custom Id that was clicked. | ||||
| @@ -11,7 +11,7 @@ namespace Discord.WebSocket | |||||
| /// <summary> | /// <summary> | ||||
| /// Represents a <see cref="InteractionType.ApplicationCommandAutocomplete"/> received over the gateway. | /// Represents a <see cref="InteractionType.ApplicationCommandAutocomplete"/> received over the gateway. | ||||
| /// </summary> | /// </summary> | ||||
| public class SocketAutocompleteInteraction : SocketInteraction, IDiscordInteraction | |||||
| public class SocketAutocompleteInteraction : SocketInteraction, IAutocompleteInteraction, IDiscordInteraction | |||||
| { | { | ||||
| /// <summary> | /// <summary> | ||||
| /// The autocomplete data of this interaction. | /// The autocomplete data of this interaction. | ||||
| @@ -115,6 +115,12 @@ namespace Discord.WebSocket | |||||
| public override Task RespondAsync(string text = null, Embed[] embeds = null, bool isTTS = false, bool ephemeral = false, AllowedMentions allowedMentions = null, RequestOptions options = null, MessageComponent component = null, Embed embed = null) | public override Task RespondAsync(string text = null, Embed[] embeds = null, bool isTTS = false, bool ephemeral = false, AllowedMentions allowedMentions = null, RequestOptions options = null, MessageComponent component = null, Embed embed = null) | ||||
| => throw new NotSupportedException("Autocomplete interactions cannot be deferred!"); | => throw new NotSupportedException("Autocomplete interactions cannot be deferred!"); | ||||
| //IAutocompleteInteraction | |||||
| /// <inheritdoc/> | |||||
| IAutocompleteInteractionData IAutocompleteInteraction.Data => Data; | |||||
| //IDiscordInteraction | |||||
| /// <inheritdoc/> | |||||
| IDiscordInteractionData IDiscordInteraction.Data => Data; | IDiscordInteractionData IDiscordInteraction.Data => Data; | ||||
| } | } | ||||
| } | } | ||||
| @@ -8,7 +8,7 @@ namespace Discord.WebSocket | |||||
| /// <summary> | /// <summary> | ||||
| /// Represents data for a slash commands autocomplete interaction. | /// Represents data for a slash commands autocomplete interaction. | ||||
| /// </summary> | /// </summary> | ||||
| public class SocketAutocompleteInteractionData : IDiscordInteractionData | |||||
| public class SocketAutocompleteInteractionData : IAutocompleteInteractionData, IDiscordInteractionData | |||||
| { | { | ||||
| /// <summary> | /// <summary> | ||||
| /// Gets the name of the invoked command. | /// Gets the name of the invoked command. | ||||
| @@ -6,7 +6,7 @@ namespace Discord.WebSocket | |||||
| /// <summary> | /// <summary> | ||||
| /// Represents a Websocket-based slash command received over the gateway. | /// Represents a Websocket-based slash command received over the gateway. | ||||
| /// </summary> | /// </summary> | ||||
| public class SocketSlashCommand : SocketCommandBase, IDiscordInteraction | |||||
| public class SocketSlashCommand : SocketCommandBase, ISlashCommandInteraction, IDiscordInteraction | |||||
| { | { | ||||
| /// <summary> | /// <summary> | ||||
| /// The data associated with this interaction. | /// The data associated with this interaction. | ||||
| @@ -34,6 +34,12 @@ namespace Discord.WebSocket | |||||
| return entity; | return entity; | ||||
| } | } | ||||
| //ISlashCommandInteraction | |||||
| /// <inheritdoc/> | |||||
| IApplicationCommandInteractionData ISlashCommandInteraction.Data => Data; | |||||
| //IDiscordInteraction | |||||
| /// <inheritdoc/> | |||||
| IDiscordInteractionData IDiscordInteraction.Data => Data; | IDiscordInteractionData IDiscordInteraction.Data => Data; | ||||
| } | } | ||||
| } | } | ||||