示例#1
0
        /// <summary>
        /// Loads <see cref="Discord.DiscordHandler"/> and <see cref="Discord.CommandSystem.CommandHandler"/>
        /// </summary>
        private static async Task LoadDiscord()
        {
            Logger.Log("Loading Discord", LogLevel.Info);

            DiscordHandler = new DiscordHandler(SkyBotConfig.DiscordToken);
            DiscordHandler.Client.Ready += s => Task.Run(() =>
            {
                if (MaintenanceScanner == null)
                {
                    LoadMaintenanceScanner();
                }
                else
                {
                    MaintenanceScanner.ResetStatus();
                }
            });
            await DiscordHandler.StartAsync().ConfigureAwait(false);

            Logger.Log("Loaded Discord", LogLevel.Info);
        }