Class InteractionModuleBase<T>
Provides a base class for a command module to inherit from.
Inheritance
InteractionModuleBase<T>
Assembly: Discord.Net.Interactions.dll
Syntax
public abstract class InteractionModuleBase<T> : object, 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 Source
Context
Gets the underlying context of the command.
Declaration
public T Context { get; }
Property Value
Methods
|
Improve this Doc
View Source
AfterExecute(ICommandInfo)
Method body to be executed after an application command execution.
Declaration
public virtual void AfterExecute(ICommandInfo command)
Parameters
Type |
Name |
Description |
ICommandInfo |
command |
Command information related to the Discord Application Command.
|
|
Improve this Doc
View Source
AfterExecuteAsync(ICommandInfo)
Method body to be executed asynchronously after an application command execution.
Declaration
public virtual Task AfterExecuteAsync(ICommandInfo command)
Parameters
Type |
Name |
Description |
ICommandInfo |
command |
Command information related to the Discord Application Command.
|
Returns
|
Improve this Doc
View Source
BeforeExecute(ICommandInfo)
Method body to be executed before executing an application command.
Declaration
public virtual void BeforeExecute(ICommandInfo command)
Parameters
Type |
Name |
Description |
ICommandInfo |
command |
Command information related to the Discord Application Command.
|
|
Improve this Doc
View Source
BeforeExecuteAsync(ICommandInfo)
Method body to be executed asynchronously before executing an application command.
Declaration
public virtual Task BeforeExecuteAsync(ICommandInfo command)
Parameters
Type |
Name |
Description |
ICommandInfo |
command |
Command information related to the Discord Application Command.
|
Returns
|
Improve this Doc
View Source
Construct(ModuleBuilder, InteractionService)
Method body to be executed after the automated module creation is completed and before is called.
Declaration
public virtual void Construct(ModuleBuilder builder, InteractionService commandService)
Parameters
Type |
Name |
Description |
ModuleBuilder |
builder |
Builder class of this module.
|
InteractionService |
commandService |
Command Service instance that is building this method.
|
|
Improve this Doc
View Source
DeferAsync(Boolean, RequestOptions)
Declaration
protected virtual async Task DeferAsync(bool ephemeral = false, RequestOptions options = null)
Parameters
Returns
|
Improve this Doc
View Source
DeleteOriginalResponseAsync()
Deletes this object and all its children.
Declaration
protected virtual async Task DeleteOriginalResponseAsync()
Returns
|
Improve this Doc
View Source
FollowupAsync(String, Embed[], Boolean, Boolean, AllowedMentions, RequestOptions, MessageComponent, Embed)
Declaration
protected virtual async Task<IUserMessage> FollowupAsync(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
Returns
|
Improve this Doc
View Source
FollowupWithFileAsync(FileAttachment, String, Embed[], Boolean, Boolean, AllowedMentions, MessageComponent, Embed, RequestOptions)
Declaration
protected virtual Task<IUserMessage> 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)
Parameters
Returns
|
Improve this Doc
View Source
FollowupWithFileAsync(Stream, String, String, Embed[], Boolean, Boolean, AllowedMentions, MessageComponent, Embed, RequestOptions)
Declaration
protected virtual Task<IUserMessage> 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)
Parameters
Returns
|
Improve this Doc
View Source
FollowupWithFileAsync(String, String, String, Embed[], Boolean, Boolean, AllowedMentions, MessageComponent, Embed, RequestOptions)
Declaration
protected virtual Task<IUserMessage> 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)
Parameters
Returns
|
Improve this Doc
View Source
FollowupWithFilesAsync(IEnumerable<FileAttachment>, String, Embed[], Boolean, Boolean, AllowedMentions, MessageComponent, Embed, RequestOptions)
Declaration
protected virtual Task<IUserMessage> 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)
Parameters
Returns
|
Improve this Doc
View Source
GetOriginalResponseAsync(RequestOptions)
Gets the original response for this interaction.
Declaration
protected virtual Task<IUserMessage> GetOriginalResponseAsync(RequestOptions options = null)
Parameters
Type |
Name |
Description |
RequestOptions |
options |
The request options for this async request.
|
Returns
|
Improve this Doc
View Source
ModifyOriginalResponseAsync(Action<MessageProperties>, RequestOptions)
Declaration
protected virtual Task<IUserMessage> ModifyOriginalResponseAsync(Action<MessageProperties> func, RequestOptions options = null)
Parameters
Returns
|
Improve this Doc
View Source
OnModuleBuilding(InteractionService, ModuleInfo)
Method body to be executed when is called.
Declaration
public virtual void OnModuleBuilding(InteractionService commandService, ModuleInfo module)
Parameters
Type |
Name |
Description |
InteractionService |
commandService |
Command Service instance that built this module.
|
ModuleInfo |
module |
Info class of this module.
|
|
Improve this Doc
View Source
ReplyAsync(String, Boolean, Embed, RequestOptions, AllowedMentions, MessageReference, MessageComponent, ISticker[], Embed[], MessageFlags)
Declaration
protected virtual async Task<IUserMessage> ReplyAsync(string text = null, bool isTTS = false, Embed embed = null, RequestOptions options = null, AllowedMentions allowedMentions = null, MessageReference messageReference = null, MessageComponent components = null, ISticker[] stickers = null, Embed[] embeds = null, MessageFlags flags = default(MessageFlags))
Parameters
Returns
|
Improve this Doc
View Source
RespondAsync(String, Embed[], Boolean, Boolean, AllowedMentions, RequestOptions, MessageComponent, Embed)
Declaration
protected virtual 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
Returns
|
Improve this Doc
View Source
RespondWithFileAsync(FileAttachment, String, Embed[], Boolean, Boolean, AllowedMentions, MessageComponent, Embed, RequestOptions)
Declaration
protected virtual Task RespondWithFileAsync(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)
Parameters
Returns
|
Improve this Doc
View Source
RespondWithFileAsync(Stream, String, String, Embed[], Boolean, Boolean, AllowedMentions, MessageComponent, Embed, RequestOptions)
Declaration
protected virtual Task RespondWithFileAsync(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)
Parameters
Returns
|
Improve this Doc
View Source
RespondWithFileAsync(String, String, String, Embed[], Boolean, Boolean, AllowedMentions, MessageComponent, Embed, RequestOptions)
Declaration
protected virtual Task RespondWithFileAsync(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)
Parameters
Returns
|
Improve this Doc
View Source
RespondWithFilesAsync(IEnumerable<FileAttachment>, String, Embed[], Boolean, Boolean, AllowedMentions, MessageComponent, Embed, RequestOptions)
Declaration
protected virtual Task RespondWithFilesAsync(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)
Parameters
Returns
|
Improve this Doc
View Source
RespondWithModalAsync(Modal, RequestOptions)
Responds to the interaction with a modal.
Declaration
protected virtual 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 task that represents the asynchronous operation of responding to the interaction.
|
|
Improve this Doc
View Source
RespondWithModalAsync<TModal>(String, RequestOptions)
Respond to an interaction with a IModal.
Declaration
protected virtual async Task RespondWithModalAsync<TModal>(string customId, RequestOptions options = null)
where TModal : class, IModal
Parameters
Returns
Type |
Description |
Task |
A task that represents the asynchronous operation of responding to the interaction.
|
Type Parameters
Explicit Interface Implementations
|
Improve this Doc
View Source
IInteractionModuleBase.SetContext(IInteractionContext)
Sets the context of this module.
Declaration
void IInteractionModuleBase.SetContext(IInteractionContext context)
Parameters
Implements