Class RestAutocompleteInteraction
Represents a REST-based autocomplete interaction.
public class RestAutocompleteInteraction : RestInteraction, IAutocompleteInteraction, IDiscordInteraction, ISnowflakeEntity, IEntity<ulong>
- Inheritance
-
RestAutocompleteInteraction
- Implements
- Inherited Members
- Extension Methods
Properties
Data
Gets the autocomplete data of this interaction.
public RestAutocompleteInteractionData Data { get; }
Property Value
Methods
Defer(bool, RequestOptions)
public override string Defer(bool ephemeral = false, RequestOptions options = null)
Parameters
ephemeral
booloptions
RequestOptions
Returns
FollowupAsync(string, Embed[], bool, bool, AllowedMentions, MessageComponent, Embed, RequestOptions, PollProperties)
Sends a followup message for this interaction.
public override Task<RestFollowupMessage> FollowupAsync(string text = null, Embed[] embeds = null, bool isTTS = false, bool ephemeral = false, AllowedMentions allowedMentions = null, MessageComponent components = null, Embed embed = null, RequestOptions options = null, PollProperties poll = null)
Parameters
text
stringThe text of the message to be sent.
embeds
Embed[]A array of embeds to send with this response. Max 10.
isTTS
booltrue if the message should be read out by a text-to-speech reader, otherwise false.
ephemeral
booltrue if the response should be hidden to everyone besides the invoker of the command, otherwise false.
allowedMentions
AllowedMentionsThe allowed mentions for this response.
components
MessageComponentA MessageComponent to be sent with this response.
embed
EmbedA single embed to send with this response. If this is passed alongside an array of embeds, the single embed will be ignored.
options
RequestOptionsThe request options for this response.
poll
PollPropertiesA poll to send with the message.
Returns
- Task<RestFollowupMessage>
A task that represents an asynchronous send operation for delivering the message. The task result contains the sent message.
FollowupWithFileAsync(FileAttachment, string, Embed[], bool, bool, AllowedMentions, MessageComponent, Embed, RequestOptions, PollProperties)
Sends a followup message for this interaction.
public override Task<RestFollowupMessage> FollowupWithFileAsync(FileAttachment attachment, string text = null, Embed[] embeds = null, bool isTTS = false, bool ephemeral = false, AllowedMentions allowedMentions = null, MessageComponent components = null, Embed embed = null, RequestOptions options = null, PollProperties poll = null)
Parameters
attachment
FileAttachmentThe attachment containing the file and description.
text
stringThe text of the message to be sent.
embeds
Embed[]A array of embeds to send with this response. Max 10.
isTTS
booltrue if the message should be read out by a text-to-speech reader, otherwise false.
ephemeral
booltrue if the response should be hidden to everyone besides the invoker of the command, otherwise false.
allowedMentions
AllowedMentionsThe allowed mentions for this response.
components
MessageComponentA MessageComponent to be sent with this response.
embed
EmbedA single embed to send with this response. If this is passed alongside an array of embeds, the single embed will be ignored.
options
RequestOptionsThe request options for this response.
poll
PollPropertiesA poll to send with the message.
Returns
- Task<RestFollowupMessage>
A task that represents an asynchronous send operation for delivering the message. The task result contains the sent message.
FollowupWithFileAsync(Stream, string, string, Embed[], bool, bool, AllowedMentions, MessageComponent, Embed, RequestOptions, PollProperties)
Sends a followup message for this interaction.
public override Task<RestFollowupMessage> FollowupWithFileAsync(Stream fileStream, string fileName, string text = null, Embed[] embeds = null, bool isTTS = false, bool ephemeral = false, AllowedMentions allowedMentions = null, MessageComponent components = null, Embed embed = null, RequestOptions options = null, PollProperties poll = null)
Parameters
fileStream
StreamThe file to upload.
fileName
stringThe file name of the attachment.
text
stringThe text of the message to be sent.
embeds
Embed[]A array of embeds to send with this response. Max 10.
isTTS
booltrue if the message should be read out by a text-to-speech reader, otherwise false.
ephemeral
booltrue if the response should be hidden to everyone besides the invoker of the command, otherwise false.
allowedMentions
AllowedMentionsThe allowed mentions for this response.
components
MessageComponentA MessageComponent to be sent with this response.
embed
EmbedA single embed to send with this response. If this is passed alongside an array of embeds, the single embed will be ignored.
options
RequestOptionsThe request options for this response.
poll
PollPropertiesA poll to send with the message.
Returns
- Task<RestFollowupMessage>
A task that represents an asynchronous send operation for delivering the message. The task result contains the sent message.
FollowupWithFileAsync(string, string, string, Embed[], bool, bool, AllowedMentions, MessageComponent, Embed, RequestOptions, PollProperties)
Sends a followup message for this interaction.
public override Task<RestFollowupMessage> FollowupWithFileAsync(string filePath, string fileName = null, string text = null, Embed[] embeds = null, bool isTTS = false, bool ephemeral = false, AllowedMentions allowedMentions = null, MessageComponent components = null, Embed embed = null, RequestOptions options = null, PollProperties poll = null)
Parameters
filePath
stringThe file to upload.
fileName
stringThe file name of the attachment.
text
stringThe text of the message to be sent.
embeds
Embed[]A array of embeds to send with this response. Max 10.
isTTS
booltrue if the message should be read out by a text-to-speech reader, otherwise false.
ephemeral
booltrue if the response should be hidden to everyone besides the invoker of the command, otherwise false.
allowedMentions
AllowedMentionsThe allowed mentions for this response.
components
MessageComponentA MessageComponent to be sent with this response.
embed
EmbedA single embed to send with this response. If this is passed alongside an array of embeds, the single embed will be ignored.
options
RequestOptionsThe request options for this response.
poll
PollPropertiesA poll to send with the message.
Returns
- Task<RestFollowupMessage>
A task that represents an asynchronous send operation for delivering the message. The task result contains the sent message.
FollowupWithFilesAsync(IEnumerable<FileAttachment>, string, Embed[], bool, bool, AllowedMentions, MessageComponent, Embed, RequestOptions, PollProperties)
Sends a followup message for this interaction.
public override Task<RestFollowupMessage> FollowupWithFilesAsync(IEnumerable<FileAttachment> attachments, string text = null, Embed[] embeds = null, bool isTTS = false, bool ephemeral = false, AllowedMentions allowedMentions = null, MessageComponent components = null, Embed embed = null, RequestOptions options = null, PollProperties poll = null)
Parameters
attachments
IEnumerable<FileAttachment>A collection of attachments to upload.
text
stringThe text of the message to be sent.
embeds
Embed[]A array of embeds to send with this response. Max 10.
isTTS
booltrue if the message should be read out by a text-to-speech reader, otherwise false.
ephemeral
booltrue if the response should be hidden to everyone besides the invoker of the command, otherwise false.
allowedMentions
AllowedMentionsThe allowed mentions for this response.
components
MessageComponentA MessageComponent to be sent with this response.
embed
EmbedA single embed to send with this response. If this is passed alongside an array of embeds, the single embed will be ignored.
options
RequestOptionsThe request options for this response.
poll
PollPropertiesA poll to send with the message.
Returns
- Task<RestFollowupMessage>
A task that represents an asynchronous send operation for delivering the message. The task result contains the sent message.
Respond(RequestOptions, params AutocompleteResult[])
Responds to this interaction with a set of choices.
public string Respond(RequestOptions options = null, params AutocompleteResult[] result)
Parameters
options
RequestOptionsThe request options for this response.
result
AutocompleteResult[]The set of choices for the user to pick from.
A max of 25 choices are allowed. Passing null for this argument will show the executing user that there is no choices for their autocompleted input.
Returns
- string
A string that contains json to write back to the incoming http request.
Respond(IEnumerable<AutocompleteResult>, RequestOptions)
Responds to this interaction with a set of choices.
public string Respond(IEnumerable<AutocompleteResult> result, RequestOptions options = null)
Parameters
result
IEnumerable<AutocompleteResult>The set of choices for the user to pick from.
A max of 25 choices are allowed. Passing null for this argument will show the executing user that there is no choices for their autocompleted input. options
RequestOptionsThe request options for this response.
Returns
- string
A string that contains json to write back to the incoming http request.
Respond(string, Embed[], bool, bool, AllowedMentions, MessageComponent, Embed, RequestOptions, PollProperties)
public override string Respond(string text = null, Embed[] embeds = null, bool isTTS = false, bool ephemeral = false, AllowedMentions allowedMentions = null, MessageComponent components = null, Embed embed = null, RequestOptions options = null, PollProperties poll = null)
Parameters
text
stringembeds
Embed[]isTTS
boolephemeral
boolallowedMentions
AllowedMentionscomponents
MessageComponentembed
Embedoptions
RequestOptionspoll
PollProperties
Returns
RespondWithModal(Modal, RequestOptions)
public override string RespondWithModal(Modal modal, RequestOptions options = null)
Parameters
modal
Modaloptions
RequestOptions