mirror of
https://github.com/tribufu/ServerManagers
synced 2026-05-06 15:17:34 +00:00
Finished the remaing bot commands
This commit is contained in:
parent
0f3c6e6be9
commit
aa62646f0f
23 changed files with 1041 additions and 287 deletions
|
|
@ -24,11 +24,8 @@ namespace ServerManagerTool.DiscordBot
|
|||
Started = false;
|
||||
}
|
||||
|
||||
private bool Started
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
public CancellationToken Token { get; private set; }
|
||||
public bool Started { get; private set; }
|
||||
|
||||
public async Task StartAsync(string discordToken, string commandPrefix, string dataDirectory, HandleCommandDelegate handleCommandCallback, HandleTranslationDelegate handleTranslationCallback, CancellationToken token)
|
||||
{
|
||||
|
|
@ -43,6 +40,8 @@ namespace ServerManagerTool.DiscordBot
|
|||
return;
|
||||
}
|
||||
|
||||
Token = token;
|
||||
|
||||
if (commandPrefix.Any(c => !char.IsLetterOrDigit(c)))
|
||||
{
|
||||
throw new Exception("#DiscordBot_InvalidPrefixError");
|
||||
|
|
@ -57,7 +56,7 @@ namespace ServerManagerTool.DiscordBot
|
|||
{
|
||||
{ "DiscordSettings:Token", discordToken },
|
||||
{ "DiscordSettings:Prefix", commandPrefix },
|
||||
{ "ServerManager:DataDirectory", dataDirectory }
|
||||
{ "ServerManager:DataDirectory", dataDirectory },
|
||||
};
|
||||
|
||||
// Begin building the configuration file
|
||||
|
|
@ -107,7 +106,8 @@ namespace ServerManagerTool.DiscordBot
|
|||
.AddSingleton<Random>()
|
||||
.AddSingleton(config)
|
||||
.AddSingleton(handleCommandCallback)
|
||||
.AddSingleton(handleTranslationCallback);
|
||||
.AddSingleton(handleTranslationCallback)
|
||||
.AddSingleton<IServerManagerBot>(this);
|
||||
|
||||
// Create the service provider
|
||||
using (var provider = services.BuildServiceProvider())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue