def restart(self, ctx):
"""Restarts this bot.
Usage: restart"""
echeck_perms(ctx, ('bot_owner',))
self.bot.store_writer.cancel()
await self.bot.store.commit()
if ctx.invoked_with != 'update':
await ctx.send('I\'ll try to restart. Hopefully I come back alive :stuck_out_tongue:')
self.logger.info('The bot is now restarting!')
# self.bot.is_restart = True
os.execl(sys.executable, sys.executable, *sys.argv)
评论列表
文章目录