[Core] Add shutdown command (#911)

This commit is contained in:
palmtree5 2017-08-12 16:41:25 -08:00 committed by GitHub
parent f78c33445c
commit 680a44c4b4

View File

@ -71,6 +71,19 @@ class Core:
await ctx.bot.save_packages_status()
await ctx.send("Done.")
@commands.command(name="shutdown")
@checks.is_owner()
async def _shutdown(self, ctx, silently: bool=False):
"""Shuts down the bot"""
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 ctx.send("Shutting down... " + wave + skin)
except:
pass
await ctx.bot.shutdown()
def cleanup_and_refresh_modules(self, module_name: str):
"""Interally reloads modules so that changes are detected"""
splitted = module_name.split('.')