I'm making a Telegram Bot using C# for "buying crypto". It doesn't actually buy it, just for practice When a client makes an order using "/buy" and fills all the blanks that are asked, it must tell the client "Please, wait. Your order is proceeding". In the real functional, it would really proceed the order, but in my case, it must do nothing in the range of 10 to 60 seconds and if the client types something, answer him something like "Your order is proceeding, it'd not take a lot"
The problem is, if i use
long time = new Random().NextInt64(10, 181);
Thread.Sleep(TimeSpan.FromSeconds(Convert.ToDouble(time)));
It will stop the bot and i won't be able to answer the client "Your order is proceeding, it'd not take a lot" in case the client types something while the thread is sleeping.
Here is an example what i mean Please wait, your order is proceeding i'm a client and i type some text when the order is proceeding Your order is proceeding, it'd not take a lot
What can i use to stop thread, but receive and handle the messages?