static void Main(string[] args) { _botMessageDelegate = (bot, chatuid, message) => { Console.ForegroundColor = ConsoleColor.Yellow; PrintToConsole(message); Console.ResetColor(); _waitingForResponse = false; }; Console.WriteLine("1. Rasa Bot"); Console.WriteLine("2. Reversi Bot"); var key = Console.ReadKey(); if (key.KeyChar == '1') { _selectedBot = CreateRasaBot(); } else if (key.KeyChar == '2') { _selectedBot = CreateReversiBot(); } else { return; } Console.WriteLine($"bot created {_selectedBot}"); string convoId = Guid.NewGuid().ToString(); _selectedBot.CreateConversation(convoId, new Dictionary <string, string>()); bool exit = false; Console.WriteLine("Say bye to end the conversation. otherwise, just chat away."); _waitingForResponse = true; do { var input = Console.ReadLine(); if ("bye".Equals(input)) { exit = true; } else { _waitingForResponse = true; _selectedBot.SendMessage(convoId, input); } System.Threading.Thread.Sleep(100); } while (!exit); while (_waitingForResponse) { Task.Yield(); } Console.WriteLine($"bye"); }