Fix Message.channel rebinding sometimes being Object

This commit is contained in:
Rapptz
2023-02-11 18:25:42 -05:00
parent 742630f144
commit ec71a46907
2 changed files with 10 additions and 6 deletions

View File

@ -1763,9 +1763,13 @@ class Message(PartialMessage, Hashable):
def _handle_interaction(self, data: MessageInteractionPayload):
self.interaction = MessageInteraction(state=self._state, guild=self.guild, data=data)
def _rebind_cached_references(self, new_guild: Guild, new_channel: Union[TextChannel, Thread]) -> None:
def _rebind_cached_references(
self,
new_guild: Guild,
new_channel: Union[GuildChannel, Thread, PartialMessageable],
) -> None:
self.guild = new_guild
self.channel = new_channel
self.channel = new_channel # type: ignore # Not all "GuildChannel" are messageable at the moment
@utils.cached_slot_property('_cs_raw_mentions')
def raw_mentions(self) -> List[int]: