I'm trying to make my code exit the program when something happens, such as a user exit command. This is how I'm running my program:
fun main() = runBlocking {
Bot().start()
}
Unfortunately, running exitProcess(0) or Thread.currentThread().interrupt() doesn't seem to do anything when called outside of start(), which is really inconvient in my use case.
Is there any way around this?