mirror of
https://github.com/NoiTheCat/BirthdayBot.git
synced 2024-11-21 13:54:36 +00:00
Move database initialization to program start
This commit is contained in:
parent
3c73be3ee7
commit
d08fc45774
2 changed files with 4 additions and 3 deletions
|
@ -1,4 +1,5 @@
|
||||||
using System;
|
using BirthdayBot.Data;
|
||||||
|
using System;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace BirthdayBot
|
namespace BirthdayBot
|
||||||
|
@ -13,6 +14,8 @@ namespace BirthdayBot
|
||||||
BotStartTime = DateTimeOffset.UtcNow;
|
BotStartTime = DateTimeOffset.UtcNow;
|
||||||
var cfg = new Configuration();
|
var cfg = new Configuration();
|
||||||
|
|
||||||
|
await Database.DoInitialDatabaseSetupAsync();
|
||||||
|
|
||||||
Console.CancelKeyPress += OnCancelKeyPressed;
|
Console.CancelKeyPress += OnCancelKeyPressed;
|
||||||
_bot = new ShardManager(cfg);
|
_bot = new ShardManager(cfg);
|
||||||
|
|
||||||
|
|
|
@ -55,8 +55,6 @@ namespace BirthdayBot
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public async Task StartAsync()
|
public async Task StartAsync()
|
||||||
{
|
{
|
||||||
await Database.DoInitialDatabaseSetupAsync();
|
|
||||||
|
|
||||||
await DiscordClient.LoginAsync(TokenType.Bot, Config.BotToken);
|
await DiscordClient.LoginAsync(TokenType.Bot, Config.BotToken);
|
||||||
await DiscordClient.StartAsync();
|
await DiscordClient.StartAsync();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue