def has_role(item):
def predicate(ctx):<EOL><INDENT>if not isinstance(ctx.channel, discord.abc.GuildChannel):<EOL><INDENT>raise NoPrivateMessage()<EOL><DEDENT>if isinstance(item, int):<EOL><INDENT>role = discord.utils.get(ctx.author.roles, id=item)<EOL><DEDENT>else:<EOL><INDENT>role = discord.utils.get(ctx.author.roles, name=item)<EOL><DEDENT>if role is None:<EOL><INDENT>raise MissingRole(item)<EOL><DEDENT>return True<EOL><DEDENT>return check(predicate)<EOL>
A :func:`.check` that is added that checks if the member invoking the
    command has the role specified via the name or ID specified.

    If a string is specified, you must give the exact name of the role, including
    caps and spelling.

    If an integer is specified, you must give the exact snowflake ID of the role.

    If the message is invoked in a private message context then the check will
    return ``False``.

    This check raises one of two special exceptions, :exc:`.MissingRole` if the user
    is missing a role, or :exc:`.NoPrivateMessage` if it is used in a private message.
    Both inherit from :exc:`.CheckFailure`.

    .. versionchanged:: 1.1.0

        Raise :exc:`.MissingRole` or :exc:`.NoPrivateMessage`
        instead of generic :exc:`.CheckFailure`

    Parameters
    -----------
    item: Union[:class:`int`, :class:`str`]
        The name or ID of the role to check.