DATABASE WOOOOOOOOOOOOOOOOOOO!

This commit is contained in:
2026-02-28 23:12:26 +00:00
parent f468b8e2dc
commit e806e3cc1f
4 changed files with 51 additions and 3 deletions

View File

@@ -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...");
}
}