Table of Contents

Class ModuleBase<T>

Namespace
Fluxer.Net.Commands
Assembly
Fluxer.Net.dll

Provides a base class for a command module to inherit from.

public abstract class ModuleBase<T> : IModuleBase where T : class, ICommandContext

Type Parameters

T

A class that implements ICommandContext.

Inheritance
object
ModuleBase<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

command CommandInfo

The 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

command CommandInfo

The CommandInfo of the command to be executed.

Returns

Task

BeforeExecute(CommandInfo)

The method to execute before executing the command.

protected virtual void BeforeExecute(CommandInfo command)

Parameters

command CommandInfo

The 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

command CommandInfo

The CommandInfo of the command to be executed.

Returns

Task

OnModuleBuilding(CommandService, ModuleBuilder)

The method to execute when building the module.

protected virtual void OnModuleBuilding(CommandService commandService, ModuleBuilder builder)

Parameters

commandService CommandService

The CommandService used to create the module.

builder ModuleBuilder

The 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

content string
embeds List<EmbedRequest>
reference MessageReferenceRequest
allowedMentions AllowedMentionsRequest
flags MessageFlag
nonce string
favoriteMediaId ulong?
tts bool?
stickerIds List<ulong>
attachments List<AttachmentRequest>

Returns

Task<Message>