Red's launcher / Downloader reqs autoinstall (#552)

This commit is contained in:
Twentysix
2017-01-05 02:19:54 +01:00
committed by GitHub
parent 04b00b7726
commit c987a89e9c
9 changed files with 686 additions and 147 deletions

View File

@@ -490,9 +490,31 @@ class Owner:
@commands.command()
@checks.is_owner()
async def shutdown(self):
async def shutdown(self, silently : bool=False):
"""Shuts down Red"""
await self.bot.logout()
wave = "\N{WAVING HAND SIGN}"
skin = "\N{EMOJI MODIFIER FITZPATRICK TYPE-3}"
try: # We don't want missing perms to stop our shutdown
if not silently:
await self.bot.say("Shutting down... " + wave + skin)
except:
pass
await self.bot.shutdown()
@commands.command()
@checks.is_owner()
async def restart(self, 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 self.bot.say("Restarting...")
except:
pass
await self.bot.shutdown(restart=True)
@commands.group(name="command", pass_context=True)
@checks.is_owner()