You can launch the bot and watch the process or the connection (I am not sure if you mean the whole process dies, or just becomes disconnected). In your loop look to see if the process is still active, if he is not turn him back on.
in reply to Automatically restarting process
Depending on the exact implementation and platform this may be rolled up for you in a module.
if [ bot not connected, alive or whatever]
restart, reconnect or whatever...