mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-12-09 02:42:30 -05:00
Red's launcher / Downloader reqs autoinstall (#552)
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user