@classmethod
def valid_text_channel(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))

    def predicate(self: MessagePredicate, m: discord.Message) -> bool:
        if (not same_context(m)):
            return False
        match = (_ID_RE.match(m.content) or _CHAN_MENTION_RE.match(m.content))
        if match:
            result = guild.get_channel(int(match.group(1)))
        else:
            result = discord.utils.get(guild.text_channels, name=m.content)
        if (not isinstance(result, discord.TextChannel)):
            return False
        self.result = result
        return True
    return cls(predicate)
@classmethod
def valid_text_channel(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))

    def predicate(self: MessagePredicate, m: discord.Message) -> bool:
        if (not same_context(m)):
            return False
        match = (_ID_RE.match(m.content) or _CHAN_MENTION_RE.match(m.content))
        if match:
            result = guild.get_channel(int(match.group(1)))
        else:
            result = discord.utils.get(guild.text_channels, name=m.content)
        if (not isinstance(result, discord.TextChannel)):
            return False
        self.result = result
        return True
    return cls(predicate)