Set joke command for a valid permission
This commit is contained in:
parent
84f2ec7159
commit
a6449de588
|
@ -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"
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in a new issue