mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-07 03:38:53 -05:00
[Core] Add shutdown command (#911)
This commit is contained in:
parent
f78c33445c
commit
680a44c4b4
@ -71,6 +71,19 @@ class Core:
|
|||||||
await ctx.bot.save_packages_status()
|
await ctx.bot.save_packages_status()
|
||||||
await ctx.send("Done.")
|
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):
|
def cleanup_and_refresh_modules(self, module_name: str):
|
||||||
"""Interally reloads modules so that changes are detected"""
|
"""Interally reloads modules so that changes are detected"""
|
||||||
splitted = module_name.split('.')
|
splitted = module_name.split('.')
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user