public async Task MainAsync() { await Loggers.LogEventAsync(new LogMessage(LogSeverity.Info, "Init...", "Stating Iyoku")).ConfigureAwait(false); Globals.InitConfig(); await Globals.Db.InitAsync(); await Loggers.LogEventAsync(new LogMessage(LogSeverity.Info, "Setup", "Initializing Modules...")).ConfigureAwait(false); await commands.AddModuleAsync <CommunicationModule>(null); await commands.AddModuleAsync <CollectionModule>(null); await commands.AddModuleAsync <CollectionManagementModule>(null); await commands.AddModuleAsync <SourceUploaderModule>(null); Globals.Client.MessageReceived += SourceCheck; Globals.Client.MessageReceived += HandleMessageAsync; Globals.Client.Ready += InitJailChannels; Globals.Client.ReactionAdded += CheckLikeReactions; Globals.Client.ChannelCreated += CheckNewJailChannel; commands.Log += Loggers.LogEventAsync; await Globals.Client.LoginAsync(TokenType.Bot, Globals.BotToken); await Globals.Client.StartAsync(); await Task.Delay(-1).ConfigureAwait(false); }
public async Task MainAsync() { await Loggers.LogEventAsync(new LogMessage(LogSeverity.Info, "Casting...", "Starting MeguminReactions")).ConfigureAwait(false); Globals.InitConfig(); await Loggers.LogEventAsync(new LogMessage(LogSeverity.Info, "Setup", "Initializing Modules...")).ConfigureAwait(false); Globals.Client.MessageReceived += HandleMessageAsync; commands.Log += Loggers.LogEventAsync; await Globals.Client.LoginAsync(TokenType.Bot, Globals.BotToken); await Globals.Client.StartAsync(); await Task.Delay(-1).ConfigureAwait(false); }
public async Task MainAsync() { await Loggers.LogEventAsync(new LogMessage(LogSeverity.Info, "Initialisation...", "Starting Netvir")).ConfigureAwait(false); Globals.InitConfig(); try { Globals.InitListener(); } catch (UnavailableServiceException e) { await Loggers.LogEventAsync(new LogMessage(LogSeverity.Warning, "Services Init", e.Message)); } Globals.ListenerService.StartListening(); await Loggers.LogEventAsync(new LogMessage(LogSeverity.Info, "Setup", "Initializing Modules...")).ConfigureAwait(false); await commands.AddModuleAsync <CommunicationModule>(null); await commands.AddModuleAsync <ReportsModule>(null); await commands.AddModuleAsync <AdministrationModule>(null); commands.Log += Loggers.LogEventAsync; commands.CommandExecuted += ProcessResult; Globals.Client.MessageReceived += HandleMessageAsync; await Globals.Client.LoginAsync(TokenType.Bot, Globals.BotToken); await Globals.Client.StartAsync(); await Task.Delay(-1).ConfigureAwait(false); }