Bot dont get incomming messages after x minutes

Are you sure that the incoming message thread is still running? Something might cause the incoming thread to stop (exceptions it the similar) while the sending thread is still running.

What library are you using?