The bot needs a computer to keep running. When you are programming and testing your bot, it’s your PC which is powering it. When you close your PC or stop the bot process in the terminal, the bot user in the Discord server will also get offline. It takes time for the bot to show it’s status to offline. That is the reason why it does nothing when you send a cmd. It’s not running and if you wait a little bit, it will change the status to offline.
Now how can you fix this? The solution to your problem is the Cloud. Cloud is just a remote computer which runs your bot 24/7. There are tons of services available for remote hosting. I will advise you to use heroku because it’s free and when you get some experience in cloud hosting, you can buy better dedicated VPS by spending some money.
There are lots of tutorial available on YouTube, which can help you to get your bot up and running on heroku.