[V3 Core] add restart command (#1272)

This commit is contained in:
palmtree5
2018-01-28 18:29:56 -09:00
committed by Kowlin
parent 1d1f2c9f12
commit f36ed2f8c8
2 changed files with 123 additions and 52 deletions

View File

@@ -277,6 +277,21 @@ class Core:
except:
pass
await ctx.bot.shutdown()
@commands.command(name="restart")
@checks.is_owner()
async def _restart(self, ctx, silently: bool=False):
"""Attempts to restart Red
Makes Red quit with exit code 26
The restart is not guaranteed: it must be dealt
with by the process manager in use"""
try:
if not silently:
await ctx.send(_("Restarting..."))
except:
pass
await ctx.bot.shutdown(restart=True)
def cleanup_and_refresh_modules(self, module_name: str):
"""Interally reloads modules so that changes are detected"""