def restart(prefix, chan, params): bot.do('QUIT', ' '.join(params)) bot.oqueue.join() os.execl(sys.executable, sys.executable, * sys.argv)