Class RestAutocompleteInteraction
Represents a REST-based autocomplete interaction.
Assembly: Discord.Net.Rest.dll​
View Source​
public class RestAutocompleteInteraction : RestInteraction, IAutocompleteInteraction, IDiscordInteraction, ISnowflakeEntity, IEntity<ulong>
Properties​
Data​
Gets the autocomplete data of this interaction.
View Source​
public RestAutocompleteInteractionData Data { get; }
IAutocompleteInteraction.Data​
Gets the autocomplete data of this interaction.
View Source​
IAutocompleteInteractionData IAutocompleteInteraction.Data { get; }
Methods​
Respond(IEnumerable<AutocompleteResult>, RequestOptions)​
Responds to this interaction with a set of choices.
View Source​
public string Respond(IEnumerable<AutocompleteResult> result, RequestOptions options = null)
Returns​
System.String
:
A string that contains json to write back to the incoming http request.
Parameters​
Type | Name | Description |
---|---|---|
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. |
Respond(RequestOptions, AutocompleteResult[])​
Responds to this interaction with a set of choices.
View Source​
public string Respond(RequestOptions options = null, params AutocompleteResult[] result)
Returns​
System.String
:
A string that contains json to write back to the incoming http request.
Parameters​
Type | Name | Description |
---|---|---|
Discord.RequestOptions | options | The 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>
|
Defer(Boolean, RequestOptions)​
View Source​
[Obsolete("Autocomplete interactions cannot be deferred!", true)]
public override string Defer(bool ephemeral = false, RequestOptions options = null)
Returns​
System.String
Parameters​
Type | Name |
---|---|
System.Boolean | ephemeral |
Discord.RequestOptions | options |
FollowupAsync(String, Embed[], Boolean, Boolean, AllowedMentions, RequestOptions, MessageComponent, Embed)​
View Source​
[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>
Parameters​
Type | Name |
---|---|
System.String | text |
Discord.Embed[] | embeds |
System.Boolean | isTTS |
System.Boolean | ephemeral |
Discord.AllowedMentions | allowedMentions |
Discord.RequestOptions | options |
Discord.MessageComponent | component |
Discord.Embed | embed |
FollowupWithFileAsync(Stream, String, String, Embed[], Boolean, Boolean, AllowedMentions, RequestOptions, MessageComponent, Embed)​
Sends a followup message for this interaction.
View Source​
[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​
Type | Name | Description |
---|---|---|
System.IO.Stream | fileStream | The file to upload. |
System.String | fileName | The file name of the attachment. |
System.String | text | The text of the message to be sent. |
Discord.Embed[] | embeds | A array of embeds to send with this response. Max 10. |
System.Boolean | isTTS | true if the message should be read out by a text-to-speech reader, otherwise false . |
System.Boolean | ephemeral | true if the response should be hidden to everyone besides the invoker of the command, otherwise false . |
Discord.AllowedMentions | allowedMentions | The allowed mentions for this response. |
Discord.RequestOptions | options | The request options for this response. |
Discord.MessageComponent | component | A Discord.MessageComponent to be sent with this response. |
Discord.Embed | embed | A 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​
[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​
Type | Name | Description |
---|---|---|
System.String | filePath | The file to upload. |
System.String | text | The text of the message to be sent. |
System.String | fileName | The file name of the attachment. |
Discord.Embed[] | embeds | A array of embeds to send with this response. Max 10. |
System.Boolean | isTTS | true if the message should be read out by a text-to-speech reader, otherwise false . |
System.Boolean | ephemeral | true if the response should be hidden to everyone besides the invoker of the command, otherwise false . |
Discord.AllowedMentions | allowedMentions | The allowed mentions for this response. |
Discord.RequestOptions | options | The request options for this response. |
Discord.MessageComponent | component | A Discord.MessageComponent to be sent with this response. |
Discord.Embed | embed | A single embed to send with this response. If this is passed alongside an array of embeds, the single embed will be ignored. |
Respond(String, Embed[], Boolean, Boolean, AllowedMentions, RequestOptions, MessageComponent, Embed)​
View Source​
[Obsolete("Autocomplete interactions cannot have normal responses!", true)]
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)
Returns​
System.String
Parameters​
Type | Name |
---|---|
System.String | text |
Discord.Embed[] | embeds |
System.Boolean | isTTS |
System.Boolean | ephemeral |
Discord.AllowedMentions | allowedMentions |
Discord.RequestOptions | options |
Discord.MessageComponent | component |
Discord.Embed | embed |