Table of Contents

Class AdminModule

Namespace
FishMMO.DiscordBot.Modules
Assembly
FishMMO-DiscordBot.dll

Administrative commands for managing the bot and viewing game server status. All commands in this group require the Administrator permission.

[Group("admin")]
[RequireUserPermission(GuildPermission.Administrator)]
public class AdminModule : ModuleBase<SocketCommandContext>, IModuleBase
Inheritance
ModuleBase<SocketCommandContext>
AdminModule
Implements
IModuleBase
Inherited Members
ModuleBase<SocketCommandContext>.BeforeExecuteAsync(CommandInfo)
ModuleBase<SocketCommandContext>.BeforeExecute(CommandInfo)
ModuleBase<SocketCommandContext>.AfterExecuteAsync(CommandInfo)
ModuleBase<SocketCommandContext>.AfterExecute(CommandInfo)
ModuleBase<SocketCommandContext>.OnModuleBuilding(CommandService, ModuleBuilder)
ModuleBase<SocketCommandContext>.Context

Constructors

AdminModule(DynamicChannelManagerService, BotConfigurationService, CommandService, ILogger<AdminModule>)

public AdminModule(DynamicChannelManagerService dynamicChannelManager, BotConfigurationService botConfigService, CommandService commandService, ILogger<AdminModule> logger)

Parameters

dynamicChannelManager DynamicChannelManagerService
botConfigService BotConfigurationService
commandService CommandService
logger ILogger<AdminModule>

Methods

DisableCommandAsync(string)

Disables a command in this guild. Users will be blocked from executing it. Use the full command key, e.g. "mod kick", "general echo", "link".

[Command("disable-cmd")]
[Summary("Disables a command in this server. Usage: /admin disable-cmd [command key]")]
public Task DisableCommandAsync(string commandKey)

Parameters

commandKey string

Returns

Task

EnableCommandAsync(string)

Re-enables a previously disabled command in this guild.

[Command("enable-cmd")]
[Summary("Re-enables a previously disabled command. Usage: /admin enable-cmd [command key]")]
public Task EnableCommandAsync(string commandKey)

Parameters

commandKey string

Returns

Task

ForceCleanupAsync()

Forces an immediate cleanup of stale game chat channels.

[Command("cleanup")]
[Summary("Forces immediate cleanup of stale game chat channels.")]
public Task ForceCleanupAsync()

Returns

Task

ListChannelsAsync()

Lists all dynamically managed game chat channels in this guild.

[Command("channels")]
[Summary("Lists all managed game chat channels in this server.")]
public Task ListChannelsAsync()

Returns

Task

ListCommandKeysAsync()

Lists all registered command keys for use with disable-cmd and require-role.

[Command("list-cmds")]
[Summary("Lists all registered command keys for configuration purposes.")]
public Task ListCommandKeysAsync()

Returns

Task

RequireRoleAsync(string, IRole)

Requires a specific Discord role to use a command.

[Command("require-role")]
[Summary("Requires a role to use a command. Usage: /admin require-role [command key] [role mention or ID]")]
public Task RequireRoleAsync(string commandKey, IRole role)

Parameters

commandKey string
role IRole

Returns

Task

ShowCommandConfigAsync()

Shows the current command permission configuration for this guild.

[Command("cmd-config")]
[Summary("Shows command permission settings for this server.")]
public Task ShowCommandConfigAsync()

Returns

Task

StatusAsync()

Displays bot status information including uptime, latency, and managed channel count.

[Command("status")]
[Summary("Shows bot status and statistics.")]
public Task StatusAsync()

Returns

Task

UnrequireRoleAsync(string)

Removes the role requirement from a command.

[Command("unrequire-role")]
[Summary("Removes a role requirement from a command. Usage: /admin unrequire-role [command key]")]
public Task UnrequireRoleAsync(string commandKey)

Parameters

commandKey string

Returns

Task