How to keep a console application open even if all the awaitables finished, but without interrupting other possible awaitables?
I know my question sounds strange but just to explain:
I'm using the Telegram.Bot library and I need to listen to all the incoming updates from telegram. The problem is that as soon as I set the Update Handler the console just closes.
Another thing I have is a request using RestSharp that gets a json from API every x minutes, that does the job done keeping the console alive because I'm using a way to detect console cancelation before interrupting the loop.
Is there another better way of doing what I want?
This is what I'm using for console close listening https://stackoverflow.com/a/22996661/12420972
And I have the exitSystem as a variable for a while loop
while (!exitSystem)
// Do this