Move database initialization to program start

This commit is contained in:
Noi 2020-10-29 00:53:18 -07:00
parent 3c73be3ee7
commit d08fc45774
2 changed files with 4 additions and 3 deletions

View file

@ -1,4 +1,5 @@
using System;
using BirthdayBot.Data;
using System;
using System.Threading.Tasks;
namespace BirthdayBot
@ -13,6 +14,8 @@ namespace BirthdayBot
BotStartTime = DateTimeOffset.UtcNow;
var cfg = new Configuration();
await Database.DoInitialDatabaseSetupAsync();
Console.CancelKeyPress += OnCancelKeyPressed;
_bot = new ShardManager(cfg);

View file

@ -55,8 +55,6 @@ namespace BirthdayBot
/// </summary>
public async Task StartAsync()
{
await Database.DoInitialDatabaseSetupAsync();
await DiscordClient.LoginAsync(TokenType.Bot, Config.BotToken);
await DiscordClient.StartAsync();
}