Ejemplo n.º 1
0
        /// <summary>
        ///     Start the Discord Bot process.
        /// </summary>
        /// <returns>An awaitable task.</returns>
        private async Task Start()
        {
            var discordCommandConfig = new DiscordCommandConfiguration();

            var section = _config.GetSection("keys");

            SetApiKeys(section);

            DiscordCommandConfiguration.Client.Log         += DefaultLogger.Logger;
            DiscordCommandConfiguration.CommandService.Log += DefaultLogger.Logger;

            _services = new ServiceCollection()
                        .AddEmbedGenerators()
                        .BuildServiceProvider();

            DiscordCommandConfiguration.Client.MessageReceived += HandleCommand;
            //TODO Handle the message update;
            await CommandConfiguration.AddModules(_config.GetSection("modules"), _services);


            await discordCommandConfig.Start(_config.GetSection("keys:discord").Value);
        }