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
dbContextNpgsqlDbContextThe database context for this command scope.
loggerILogger<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
accountNamestringThe account name to look up.
Returns
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
characterNamestringThe character name to look up.
Returns
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
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
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()