Class ModuleBase<T>
Provides a base class for a command module to inherit from.
public abstract class ModuleBase<T> : IModuleBase where T : class, ICommandContext
Type Parameters
TA class that implements ICommandContext.
- Inheritance
-
objectModuleBase<T>
- Implements
- Derived
Properties
Context
The underlying context of the command.
public T Context { get; }
Property Value
- T
- See Also
Methods
AfterExecute(CommandInfo)
The method to execute after executing the command.
protected virtual void AfterExecute(CommandInfo command)
Parameters
commandCommandInfoThe CommandInfo of the command to be executed.
AfterExecuteAsync(CommandInfo)
The method to execute asynchronously after executing the command.
protected virtual Task AfterExecuteAsync(CommandInfo command)
Parameters
commandCommandInfoThe CommandInfo of the command to be executed.
Returns
BeforeExecute(CommandInfo)
The method to execute before executing the command.
protected virtual void BeforeExecute(CommandInfo command)
Parameters
commandCommandInfoThe CommandInfo of the command to be executed.
BeforeExecuteAsync(CommandInfo)
The method to execute asynchronously before executing the command.
protected virtual Task BeforeExecuteAsync(CommandInfo command)
Parameters
commandCommandInfoThe CommandInfo of the command to be executed.
Returns
OnModuleBuilding(CommandService, ModuleBuilder)
The method to execute when building the module.
protected virtual void OnModuleBuilding(CommandService commandService, ModuleBuilder builder)
Parameters
commandServiceCommandServiceThe CommandService used to create the module.
builderModuleBuilderThe builder used to build the module.
ReplyAsync(string?, List<EmbedRequest>?, MessageReferenceRequest?, AllowedMentionsRequest?, MessageFlag, string?, ulong?, bool?, List<ulong>?, List<AttachmentRequest>?)
Sends a message to the channel the command was executed in.
protected virtual Task<Message> ReplyAsync(string? content = null, List<EmbedRequest>? embeds = null, MessageReferenceRequest? reference = null, AllowedMentionsRequest? allowedMentions = null, MessageFlag flags = MessageFlag.None, string? nonce = null, ulong? favoriteMediaId = null, bool? tts = null, List<ulong>? stickerIds = null, List<AttachmentRequest>? attachments = null)
Parameters
contentstringembedsList<EmbedRequest>referenceMessageReferenceRequestallowedMentionsAllowedMentionsRequestflagsMessageFlagnoncestringfavoriteMediaIdulong?ttsbool?stickerIdsList<ulong>attachmentsList<AttachmentRequest>