mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-07 11:48:55 -05:00
Disable commands at !load !reload
This commit is contained in:
parent
def2035f19
commit
de5710082e
@ -72,6 +72,7 @@ class Owner:
|
||||
' Check your logs for more information.')
|
||||
else:
|
||||
set_cog(module, True)
|
||||
await self.disable_commands()
|
||||
await self.bot.say("Module enabled.")
|
||||
|
||||
@commands.command()
|
||||
@ -128,6 +129,7 @@ class Owner:
|
||||
" logs for more information.")
|
||||
else:
|
||||
set_cog(module, True)
|
||||
await self.disable_commands()
|
||||
await self.bot.say("Module reloaded.")
|
||||
|
||||
@commands.command(pass_context=True, hidden=True)
|
||||
@ -348,8 +350,11 @@ class Owner:
|
||||
async def disable_commands(self): # runs at boot
|
||||
for cmd in self.disabled_commands:
|
||||
cmd_obj = await self.get_command(cmd)
|
||||
cmd_obj.enabled = False
|
||||
cmd_obj.hidden = True
|
||||
try:
|
||||
cmd_obj.enabled = False
|
||||
cmd_obj.hidden = True
|
||||
except:
|
||||
pass
|
||||
|
||||
@commands.command()
|
||||
@checks.is_owner()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user