Skip to main content

Class SocketAutocompleteInteraction

Represents a Discord.InteractionType.ApplicationCommandAutocomplete received over the gateway.

Assembly: Discord.Net.WebSocket.dll​
View Source​
Declaration
public class SocketAutocompleteInteraction : SocketInteraction, IAutocompleteInteraction, IDiscordInteraction, ISnowflakeEntity, IEntity<ulong>

Properties​

Data​

The autocomplete data of this interaction.

View Source​
Declaration
public SocketAutocompleteInteractionData Data { get; }

HasResponded​

View Source​
Declaration
public override bool HasResponded { get; }

IAutocompleteInteraction.Data​

Gets the autocomplete data of this interaction.

View Source​
Declaration
IAutocompleteInteractionData IAutocompleteInteraction.Data { get; }

IDiscordInteraction.Data​

Gets the data sent within this interaction.

View Source​
Declaration
IDiscordInteractionData IDiscordInteraction.Data { get; }

Methods​

RespondAsync(IEnumerable<AutocompleteResult>, RequestOptions)​

Responds to this interaction with a set of choices.

View Source​
Declaration
public async Task RespondAsync(IEnumerable<AutocompleteResult> result, RequestOptions options = null)
Returns​

System.Threading.Tasks.Task: A task that represents the asynchronous operation of responding to this interaction.

Parameters​
TypeNameDescription
System.Collections.Generic.IEnumerable<Discord.AutocompleteResult>result

The set of choices for the user to pick from. <remarks> A max of 20 choices are allowed. Passing null for this argument will show the executing user that there is no choices for their autocompleted input. </remarks> | | Discord.RequestOptions | options | The request options for this response. |

RespondAsync(RequestOptions, AutocompleteResult[])​

Responds to this interaction with a set of choices.

View Source​
Declaration
public Task RespondAsync(RequestOptions options = null, params AutocompleteResult[] result)
Returns​

System.Threading.Tasks.Task: A task that represents the asynchronous operation of responding to this interaction.

Parameters​
TypeNameDescription
Discord.RequestOptionsoptionsThe request options for this response.
Discord.AutocompleteResult[]result

The set of choices for the user to pick from. <remarks> A max of 20 choices are allowed. Passing null for this argument will show the executing user that there is no choices for their autocompleted input. </remarks> |

DeferAsync(Boolean, RequestOptions)​

Acknowledges this interaction.

View Source​
Declaration
[Obsolete("Autocomplete interactions cannot be deferred!", true)]
public override Task DeferAsync(bool ephemeral = false, RequestOptions options = null)
Returns​

System.Threading.Tasks.Task: A task that represents the asynchronous operation of acknowledging the interaction.

Parameters​
TypeNameDescription
System.Booleanephemeraltrue to send this message ephemerally, otherwise false.
Discord.RequestOptionsoptionsThe request options for this async request.

FollowupAsync(String, Embed[], Boolean, Boolean, AllowedMentions, RequestOptions, MessageComponent, Embed)​

Sends a followup message for this interaction.

View Source​
Declaration
[Obsolete("Autocomplete interactions cannot have followups!", true)]
public override Task<RestFollowupMessage> FollowupAsync(string text = null, Embed[] embeds = null, bool isTTS = false, bool ephemeral = false, AllowedMentions allowedMentions = null, RequestOptions options = null, MessageComponent component = null, Embed embed = null)
Returns​

System.Threading.Tasks.Task<Discord.Rest.RestFollowupMessage>: The sent message.

Parameters​
TypeNameDescription
System.StringtextThe text of the message to be sent.
Discord.Embed[]embedsA array of embeds to send with this response. Max 10.
System.BooleanisTTStrue if the message should be read out by a text-to-speech reader, otherwise false.
System.Booleanephemeraltrue if the response should be hidden to everyone besides the invoker of the command, otherwise false.
Discord.AllowedMentionsallowedMentionsThe allowed mentions for this response.
Discord.RequestOptionsoptionsThe request options for this response.
Discord.MessageComponentcomponentA Discord.MessageComponent to be sent with this response.
Discord.EmbedembedA single embed to send with this response. If this is passed alongside an array of embeds, the single embed will be ignored.

FollowupWithFileAsync(Stream, String, String, Embed[], Boolean, Boolean, AllowedMentions, RequestOptions, MessageComponent, Embed)​

Sends a followup message for this interaction.

View Source​
Declaration
[Obsolete("Autocomplete interactions cannot have followups!", true)]
public override Task<RestFollowupMessage> FollowupWithFileAsync(Stream fileStream, string fileName, string text = null, Embed[] embeds = null, bool isTTS = false, bool ephemeral = false, AllowedMentions allowedMentions = null, RequestOptions options = null, MessageComponent component = null, Embed embed = null)
Returns​

System.Threading.Tasks.Task<Discord.Rest.RestFollowupMessage>: The sent message.

Parameters​
TypeNameDescription
System.IO.StreamfileStreamThe file to upload.
System.StringfileNameThe file name of the attachment.
System.StringtextThe text of the message to be sent.
Discord.Embed[]embedsA array of embeds to send with this response. Max 10.
System.BooleanisTTStrue if the message should be read out by a text-to-speech reader, otherwise false.
System.Booleanephemeraltrue if the response should be hidden to everyone besides the invoker of the command, otherwise false.
Discord.AllowedMentionsallowedMentionsThe allowed mentions for this response.
Discord.RequestOptionsoptionsThe request options for this response.
Discord.MessageComponentcomponentA Discord.MessageComponent to be sent with this response.
Discord.EmbedembedA single embed to send with this response. If this is passed alongside an array of embeds, the single embed will be ignored.

FollowupWithFileAsync(String, String, String, Embed[], Boolean, Boolean, AllowedMentions, RequestOptions, MessageComponent, Embed)​

Sends a followup message for this interaction.

View Source​
Declaration
[Obsolete("Autocomplete interactions cannot have followups!", true)]
public override Task<RestFollowupMessage> FollowupWithFileAsync(string filePath, string text = null, string fileName = null, Embed[] embeds = null, bool isTTS = false, bool ephemeral = false, AllowedMentions allowedMentions = null, RequestOptions options = null, MessageComponent component = null, Embed embed = null)
Returns​

System.Threading.Tasks.Task<Discord.Rest.RestFollowupMessage>: The sent message.

Parameters​
TypeNameDescription
System.StringfilePathThe file to upload.
System.StringtextThe text of the message to be sent.
System.StringfileNameThe file name of the attachment.
Discord.Embed[]embedsA array of embeds to send with this response. Max 10.
System.BooleanisTTStrue if the message should be read out by a text-to-speech reader, otherwise false.
System.Booleanephemeraltrue if the response should be hidden to everyone besides the invoker of the command, otherwise false.
Discord.AllowedMentionsallowedMentionsThe allowed mentions for this response.
Discord.RequestOptionsoptionsThe request options for this response.
Discord.MessageComponentcomponentA Discord.MessageComponent to be sent with this response.
Discord.EmbedembedA single embed to send with this response. If this is passed alongside an array of embeds, the single embed will be ignored.

RespondAsync(String, Embed[], Boolean, Boolean, AllowedMentions, RequestOptions, MessageComponent, Embed)​

Responds to an Interaction with type Discord.InteractionResponseType.ChannelMessageWithSource.

View Source​
Declaration
[Obsolete("Autocomplete interactions cannot have normal responses!", true)]
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)
Returns​

System.Threading.Tasks.Task

Parameters​
TypeNameDescription
System.StringtextThe text of the message to be sent.
Discord.Embed[]embedsA array of embeds to send with this response. Max 10.
System.BooleanisTTStrue if the message should be read out by a text-to-speech reader, otherwise false.
System.Booleanephemeraltrue if the response should be hidden to everyone besides the invoker of the command, otherwise false.
Discord.AllowedMentionsallowedMentionsThe allowed mentions for this response.
Discord.RequestOptionsoptionsThe request options for this response.
Discord.MessageComponentcomponentA Discord.MessageComponent to be sent with this response.
Discord.EmbedembedA single embed to send with this response. If this is passed alongside an array of embeds, the single embed will be ignored.

Implements​