def bot_has_role(item):
def predicate(ctx):<EOL><INDENT>ch = ctx.channel<EOL>if not isinstance(ch, discord.abc.GuildChannel):<EOL><INDENT>raise NoPrivateMessage()<EOL><DEDENT>me = ch.guild.me<EOL>if isinstance(item, int):<EOL><INDENT>role = discord.utils.get(me.roles, id=item)<EOL><DEDENT>else:<EOL><INDENT>role = discord.utils.get(me.roles, name=item)<EOL><DEDENT>if role is None:<EOL><INDENT>raise BotMissingRole(item)<EOL><DEDENT>return True<EOL><DEDENT>return check(predicate)<EOL>
Similar to :func:`.has_role` except checks if the bot itself has the
    role.

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

    .. versionchanged:: 1.1.0

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