Table of Contents

Class DatabaseModule

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

Commands for querying the game database. Restricted to server administrators.

[RequireUserPermission(GuildPermission.Administrator)]
public class DatabaseModule : ModuleBase<SocketCommandContext>, IModuleBase
Inheritance
ModuleBase<SocketCommandContext>
DatabaseModule
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

DatabaseModule(NpgsqlDbContext, ILogger<DatabaseModule>)

Initializes a new instance of the DatabaseModule class.

public DatabaseModule(NpgsqlDbContext dbContext, ILogger<DatabaseModule> logger)

Parameters

dbContext NpgsqlDbContext

The database context for this command scope.

logger ILogger<DatabaseModule>

Logger instance.

Methods

GetAccountAsync(string)

Retrieves an account by name from the database. Requires Administrator permission.

[Command("getaccount")]
[Summary("Retrieves an account by its name from the database.")]
public Task GetAccountAsync(string accountName)

Parameters

accountName string

The account name to look up.

Returns

Task

GetCharacterAsync(string)

Retrieves a character by name from the database. Requires Administrator permission.

[Command("getcharacter")]
[Summary("Retrieves a character by its name from the database.")]
public Task GetCharacterAsync(string characterName)

Parameters

characterName string

The character name to look up.

Returns

Task

ListSceneServersAsync()

Lists all scene servers currently in the database. Requires Administrator permission.

[Command("sceneservers")]
[Summary("Lists all scene servers from the database.")]
public Task ListSceneServersAsync()

Returns

Task

ListScenesAsync()

Lists all active scenes currently in the database. Requires Administrator permission.

[Command("scenes")]
[Summary("Lists all active scenes from the database.")]
public Task ListScenesAsync()

Returns

Task

ListWorldServersAsync()

Lists all world servers currently in the database. Requires Administrator permission.

[Command("worldservers")]
[Summary("Lists all world servers from the database.")]
public Task ListWorldServersAsync()

Returns

Task