1
0
Fork 0
mirror of synced 2024-06-02 18:54:33 +12:00

Set joke command for a valid permission

This commit is contained in:
phxntxm 2016-07-17 15:54:31 -05:00
parent 84f2ec7159
commit a6449de588
2 changed files with 4 additions and 7 deletions

View file

@ -35,7 +35,6 @@ class Core:
await self.bot.say("Use this URL to add me to a server that you'd like!\n{}"
.format(discord.utils.oauth_url('183748889814237186', perms)))
@commands.command(pass_context=True)
@checks.customPermsOrRole("none")
async def doggo(self, ctx):
@ -46,10 +45,9 @@ class Core:
f = open(f,'rb')
await self.bot.send_file(ctx.message.channel,f)
f.close()
@commands.command()
@checks.customPermsOrRole("none")
@checks.customPermsOrRole("send_message")
async def joke(self):
"""Prints a random riddle"""
fortuneCommand = "/usr/bin/fortune riddles"

View file

@ -8,7 +8,6 @@ def isOwner(ctx):
def customPermsOrRole(perm):
def predicate(ctx):
nonlocal perm
if ctx.message.channel.is_private:
return False
custom_permissions = config.getContent('custom_permissions')
@ -18,9 +17,9 @@ def customPermsOrRole(perm):
pass
if _perm is None:
return getattr(ctx.message.author.permissions_in(ctx.message.channel),perm)
return getattr(ctx.message.author.permissions_in(ctx.message.channel), perm)
else:
return getattr(ctx.message.author.permissions_in(ctx.message.channel),_perm)
return getattr(ctx.message.author.permissions_in(ctx.message.channel), _perm)
return commands.check(predicate)