DATABASE WOOOOOOOOOOOOOOOOOOO!
This commit is contained in:
@@ -12,30 +12,36 @@ namespace Reactor.Services
|
||||
HashSet<long> initializedPlanets,
|
||||
string prefix)
|
||||
{
|
||||
//Check token is valid
|
||||
if (string.IsNullOrWhiteSpace(token))
|
||||
{
|
||||
Console.WriteLine("TOKEN not set.");
|
||||
return;
|
||||
}
|
||||
|
||||
//Login to the bot
|
||||
var loginResult = await client.InitializeUser(token);
|
||||
if (!loginResult.Success)
|
||||
{
|
||||
Console.WriteLine($"Login failed: {loginResult.Message}");
|
||||
return;
|
||||
}
|
||||
|
||||
Console.WriteLine($"Logged in as {client.Me.Name} (ID: {client.Me.Id})");
|
||||
|
||||
await PlanetService.InitializePlanetsAsync(client, channelCache, initializedPlanets);
|
||||
//Initialize the Database
|
||||
await DatabaseService.InitializeAsync();
|
||||
|
||||
//Initialize the Planets
|
||||
await PlanetService.InitializePlanetsAsync(client, channelCache, initializedPlanets);
|
||||
client.PlanetService.JoinedPlanetsUpdated += async () =>
|
||||
{
|
||||
await PlanetService.InitializePlanetsAsync(client, channelCache, initializedPlanets);
|
||||
};
|
||||
|
||||
//Initialize the Messages
|
||||
client.MessageService.MessageReceived += async (msg) => await MessageService.HandleMessageAsync(client, channelCache, msg, prefix);
|
||||
|
||||
//Bot is active and ready
|
||||
Console.WriteLine("Bot ready and listening...");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user