From 680a44c4b40d371372cdedb26ee542516d6442b4 Mon Sep 17 00:00:00 2001 From: palmtree5 Date: Sat, 12 Aug 2017 16:41:25 -0800 Subject: [PATCH] [Core] Add shutdown command (#911) --- core/core_commands.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/core/core_commands.py b/core/core_commands.py index a38f3de7b..f3dfa2fd4 100644 --- a/core/core_commands.py +++ b/core/core_commands.py @@ -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('.')