static async Task Main() { BotStartTime = DateTimeOffset.UtcNow; var cfg = new Configuration(); await Database.DoInitialDatabaseSetupAsync(); Console.CancelKeyPress += OnCancelKeyPressed; _bot = new ShardManager(cfg); await Task.Delay(-1); }
/// <summary> /// Prepares and configures the shard instances, but does not yet start its connection. /// </summary> public ShardInstance(ShardManager manager, DiscordSocketClient client, Dictionary <string, CommandHandler> commands) { _manager = manager; _dispatchCommands = commands; DiscordClient = client; DiscordClient.Log += Client_Log; DiscordClient.Ready += Client_Ready; DiscordClient.MessageReceived += Client_MessageReceived; // Background task constructor begins background processing immediately. _background = new ShardBackgroundWorker(this); DiscordClient.Disconnected += Client_Disconnected; }