@classmethod
def has_role(cls, ctx: Optional[commands.Context]=None, channel: Optional[discord.TextChannel]=None, user: Optional[discord.abc.User]=None) -> 'MessagePredicate':
    same_context = cls.same_context(ctx, channel, user)
    guild = cls._get_guild(ctx, channel, cast(discord.Member, user))
    if (user is None):
        if (ctx is None):
            raise TypeError('One of `user` or `ctx` must be supplied to `MessagePredicate.has_role`.')
        user = ctx.author

    def predicate(self: MessagePredicate, m: discord.Message) -> bool:
        if (not same_context(m)):
            return False
        role = self._find_role(guild, m.content)
        if ((role is None) or (role not in user.roles)):
            return False
        self.result = role
        return True
    return cls(predicate)
@classmethod
def has_role(cls, ctx: Optional[commands.Context]=None, channel: Optional[discord.TextChannel]=None, user: Optional[discord.abc.User]=None) -> 'MessagePredicate':
    same_context = cls.same_context(ctx, channel, user)
    guild = cls._get_guild(ctx, channel, cast(discord.Member, user))
    if (user is None):
        if (ctx is None):
            raise TypeError('One of `user` or `ctx` must be supplied to `MessagePredicate.has_role`.')
        user = ctx.author

    def predicate(self: MessagePredicate, m: discord.Message) -> bool:
        if (not same_context(m)):
            return False
        role = self._find_role(guild, m.content)
        if ((role is None) or (role not in user.roles)):
            return False
        self.result = role
        return True
    return cls(predicate)