Search code examples
c#event-handlingconsole-applicationconsole-input

C# Console Application console Input and Listen to Handlers


I have a Skype for Business bot that is listening to a specific contact with handlers from the lync sdk. Now I want to input some commands through the console. But when I use the ReadLine method my Bot only listen to the console and not to the skype handler from the conversation. Is there a way to listen to both inputs?

Best regards

Tobias


Solution

  • Try run bot at new thread, like this:

    var bot = new MyBot();
    new System.Threading.Tasks.Task(() => {
        bot.Start();
    }).Start();
    do {
        Console.ReadLine();//read command
    } while (true);