static void Main(string[] args) { //Register Callbacks Common.loggerFunc = discordLog; Common.Populate(); //Add ranks and other defaults DiscordDataService _data = new DiscordDataService(); _data.setTournament(new Tournament()); //Setup Bot Bot _bot = new Bot(_data); //Start Discord Bot _bot.MainAsync(); //Start Server Listening Thread Server _server = new Server(); Thread t = new Thread(_server.Main); t.Start(); bool exit = false; while (true) { Thread.Sleep(10000); //Let the main thread sleep indefinitely the bot the main thread is forcefully terminated /* * Console.WriteLine("Type something"); * string input = Console.ReadLine(); * * switch (input) * { * case "Q": * exit = true; * break; * } */ } t.Abort(); _bot.Close(); }