def disable(self, ctx, *, command: str):
"""Disables a command for this server.
You must have Manage Server permissions or the
Bot Admin role to use this command.
"""
command = command.lower()
if command in ('enable', 'disable'):
return await self.bot.responses.failure(message='Cannot disable that command.')
if command not in self.bot.commands:
return await self.bot.responses.failure(message='Command "{}" was not found.'.format(command))
guild_id = ctx.message.server.id
cmds = self.config.get('commands', {})
entries = cmds.get(guild_id, [])
entries.append(command)
cmds[guild_id] = entries
await self.config.put('commands', cmds)
await self.bot.responses.success(message='"%s" command disabled in this server.' % command)
评论列表
文章目录