def __init__(self, *, channel: MessageableChannel, id: int) -> None:
    if ((not isinstance(channel, PartialMessageable)) and (channel.type not in (ChannelType.text, ChannelType.voice, ChannelType.news, ChannelType.private, ChannelType.news_thread, ChannelType.public_thread, ChannelType.private_thread))):
        raise TypeError(f'expected PartialMessageable, TextChannel, VoiceChannel, DMChannel or Thread not {type(channel)!r}')
    self.channel: MessageableChannel = channel
    self._state: ConnectionState = channel._state
    self.id: int = id
    self.guild: Optional[Guild] = getattr(channel, 'guild', None)
def __init__(self, *, channel: MessageableChannel, id: int) -> None:
    if ((not isinstance(channel, PartialMessageable)) and (channel.type not in (ChannelType.text, ChannelType.voice, ChannelType.news, ChannelType.private, ChannelType.news_thread, ChannelType.public_thread, ChannelType.private_thread))):
        raise TypeError(f'expected PartialMessageable, TextChannel, VoiceChannel, DMChannel or Thread not {type(channel)!r}')
    self.channel: MessageableChannel = channel
    self._state: ConnectionState = channel._state
    self.id: int = id
    self.guild: Optional[Guild] = getattr(channel, 'guild', None)