Table of Contents

Class ModerationModule

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

Moderation commands for game server administration via Discord. Requires ManageGuild permission (moderator-level).

[Group("mod")]
[RequireUserPermission(GuildPermission.ManageGuild)]
public class ModerationModule : ModuleBase<SocketCommandContext>, IModuleBase
Inheritance
ModuleBase<SocketCommandContext>
ModerationModule
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

ModerationModule(IServiceProvider, BridgeBanService, BotConfigurationService, ILogger<ModerationModule>)

public ModerationModule(IServiceProvider serviceProvider, BridgeBanService bridgeBanService, BotConfigurationService botConfigService, ILogger<ModerationModule> logger)

Parameters

serviceProvider IServiceProvider
bridgeBanService BridgeBanService
botConfigService BotConfigurationService
logger ILogger<ModerationModule>

Methods

BanAsync(string)

Bans a game account by setting its AccessLevel to Banned (0). Also inserts a kick request to immediately disconnect the player.

[Command("ban")]
[Summary("Bans a game account (sets AccessLevel to Banned and kicks).")]
public Task BanAsync(string accountName)

Parameters

accountName string

Returns

Task

BanBridgeAsync(string, string)

Bans a character or account from the Discord chat bridge. Messages from bridge-banned names are not forwarded in either direction.

[Command("ban-bridge")]
[Summary("Bans a character/account from the Discord-game chat bridge.")]
public Task BanBridgeAsync(string name, string reason = "No reason provided")

Parameters

name string
reason string

Returns

Task

KickAsync(string)

Kicks a player by inserting a kick request into the game database. The game server processes kick requests on its next tick.

[Command("kick")]
[Summary("Kicks a player from the game server by account name.")]
public Task KickAsync(string accountName)

Parameters

accountName string

Returns

Task

ListBridgeBansAsync()

Lists all current bridge bans.

[Command("bridge-bans")]
[Summary("Lists all current bridge bans.")]
public Task ListBridgeBansAsync()

Returns

Task

UnbanAsync(string)

Unbans a game account by setting its AccessLevel back to Player (1).

[Command("unban")]
[Summary("Unbans a game account (restores AccessLevel to Player).")]
public Task UnbanAsync(string accountName)

Parameters

accountName string

Returns

Task

UnbanBridgeAsync(string)

Removes a bridge ban from a character or account.

[Command("unban-bridge")]
[Summary("Removes a bridge ban from a character/account.")]
public Task UnbanBridgeAsync(string name)

Parameters

name string

Returns

Task