public async Task MainAsync() { ///////////initialize autofac SettingsTripleZeroBot settingsTripleZeroBot = null; autoFacContainer = AutofacConfig.ConfigureContainer(); using (var scope = autoFacContainer.BeginLifetimeScope()) { applicationSettings = scope.Resolve <ApplicationSettings>(); commands = scope.Resolve <CommandService>(); client = scope.Resolve <DiscordSocketClient>(); logo = scope.Resolve <Logo>(); //memoryCache = scope.Resolve<MemoryCache>(); settingsTripleZeroBot = applicationSettings.GetTripleZeroBotSettings(); await InstallCommands(); await client.LoginAsync(TokenType.Bot, settingsTripleZeroBot.DiscordSettings.Token); await client.StartAsync(); await client.SetGameAsync(string.Format("{0}help", settingsTripleZeroBot.DiscordSettings.Prefix)); } //client.MessageReceived += MessageReceived; while (client.ConnectionState != ConnectionState.Connected) { Consoler.WriteLineInColor(string.Format("Still not connected... {0}", DateTime.Now), ConsoleColor.Yellow); await Task.Delay(2000); } logo.ConsolePrintLogo(); //prints application name,version etc //await TestCharAliasesDelete(); //await TestDelete(); //await TestGuildPlayers("41st"); //await TestPlayerReport("tsitas_66"); //await TestGuildModule("41s", "gk"); //await TestCharacterModule("tsitas_66", "cls"); await client.GetUser("TSiTaS", "1984").SendMessageAsync(logo.GetLogo()); await Task.Delay(-1); }