Class RestInteractionModuleBase<T>
Provides a base class for a Rest based command module to inherit from.
Implements
Inherited Members
Namespace: Discord.Interactions
Assembly: Discord.Net.Interactions.dll
Syntax
public abstract class RestInteractionModuleBase<T> : InteractionModuleBase<T>, IInteractionModuleBase where T : class, IInteractionContext
Type Parameters
Name | Description |
---|---|
T | Type of interaction context to be injected into the module. |
Properties
| Improve this Doc View SourceInteractionService
Gets or sets the underlying Interaction Service.
Declaration
public InteractionService InteractionService { get; set; }
Property Value
Type | Description |
---|---|
InteractionService |
Methods
| Improve this Doc View SourceDeferAsync(Boolean, RequestOptions)
Defer a Rest based Discord Interaction using the RestResponseCallback delegate.
Declaration
protected override async Task DeferAsync(bool ephemeral = false, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
Boolean | ephemeral | true if the response should be hidden to everyone besides the invoker of the command, otherwise false. |
RequestOptions | options | The request options for this response. |
Returns
Type | Description |
---|---|
Task | A Task representing the operation of creating the interaction response. |
Overrides
RespondAsync(String, Embed[], Boolean, Boolean, AllowedMentions, RequestOptions, MessageComponent, Embed)
Respond to a Rest based Discord Interaction using the RestResponseCallback delegate.
Declaration
protected override async Task RespondAsync(string text = null, Embed[] embeds = null, bool isTTS = false, bool ephemeral = false, AllowedMentions allowedMentions = null, RequestOptions options = null, MessageComponent components = null, Embed embed = null)
Parameters
Type | Name | Description |
---|---|---|
String | text | The text of the message to be sent. |
Embed[] | embeds | A array of embeds to send with this response. Max 10. |
Boolean | isTTS | true if the message should be read out by a text-to-speech reader, otherwise false. |
Boolean | ephemeral | true if the response should be hidden to everyone besides the invoker of the command, otherwise false. |
AllowedMentions | allowedMentions | The allowed mentions for this response. |
RequestOptions | options | The request options for this response. |
MessageComponent | components | A MessageComponent to be sent with this response. |
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. |
Returns
Type | Description |
---|---|
Task | A Task representing the operation of creating the interaction response. |
Overrides
RespondWithModalAsync(Modal, RequestOptions)
Responds to the interaction with a modal.
Declaration
protected override async Task RespondWithModalAsync(Modal modal, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
Modal | modal | The modal to respond with. |
RequestOptions | options | The request options for this async request. |
Returns
Type | Description |
---|---|
Task | A string that contains json to write back to the incoming http request. |
Overrides
RespondWithModalAsync<TModal>(String, RequestOptions)
Declaration
protected override async Task RespondWithModalAsync<TModal>(string customId, RequestOptions options = null)
where TModal : class, IModal
Parameters
Type | Name | Description |
---|---|---|
String | customId | |
RequestOptions | options |
Returns
Type | Description |
---|---|
Task |
Type Parameters
Name | Description |
---|---|
TModal |