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.
something like
launch bot
while (1)
if [ bot not connected, alive or whatever]
restart, reconnect or whatever...
end while