def has_permissions(**perms):
def predicate(ctx):<EOL><INDENT>ch = ctx.channel<EOL>permissions = ch.permissions_for(ctx.author)<EOL>missing = [perm for perm, value in perms.items() if getattr(permissions, perm, None) != value]<EOL>if not missing:<EOL><INDENT>return True<EOL><DEDENT>raise MissingPermissions(missing)<EOL><DEDENT>return check(predicate)<EOL>
A :func:`.check` that is added that checks if the member has all of
    the permissions necessary.

    The permissions passed in must be exactly like the properties shown under
    :class:`.discord.Permissions`.

    This check raises a special exception, :exc:`.MissingPermissions`
    that is inherited from :exc:`.CheckFailure`.

    Parameters
    ------------
    perms
        An argument list of permissions to check for.

    Example
    ---------

    .. code-block:: python3

        @bot.command()
        @commands.has_permissions(manage_messages=True)
        async def test(ctx):
            await ctx.send('You can manage messages.')