mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-08 04:08:56 -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.')
|
' Check your logs for more information.')
|
||||||
else:
|
else:
|
||||||
set_cog(module, True)
|
set_cog(module, True)
|
||||||
|
await self.disable_commands()
|
||||||
await self.bot.say("Module enabled.")
|
await self.bot.say("Module enabled.")
|
||||||
|
|
||||||
@commands.command()
|
@commands.command()
|
||||||
@ -128,6 +129,7 @@ class Owner:
|
|||||||
" logs for more information.")
|
" logs for more information.")
|
||||||
else:
|
else:
|
||||||
set_cog(module, True)
|
set_cog(module, True)
|
||||||
|
await self.disable_commands()
|
||||||
await self.bot.say("Module reloaded.")
|
await self.bot.say("Module reloaded.")
|
||||||
|
|
||||||
@commands.command(pass_context=True, hidden=True)
|
@commands.command(pass_context=True, hidden=True)
|
||||||
@ -348,8 +350,11 @@ class Owner:
|
|||||||
async def disable_commands(self): # runs at boot
|
async def disable_commands(self): # runs at boot
|
||||||
for cmd in self.disabled_commands:
|
for cmd in self.disabled_commands:
|
||||||
cmd_obj = await self.get_command(cmd)
|
cmd_obj = await self.get_command(cmd)
|
||||||
cmd_obj.enabled = False
|
try:
|
||||||
cmd_obj.hidden = True
|
cmd_obj.enabled = False
|
||||||
|
cmd_obj.hidden = True
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
@commands.command()
|
@commands.command()
|
||||||
@checks.is_owner()
|
@checks.is_owner()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user