From f7a79ff8d744f0262eded31a90a569304cc213cb Mon Sep 17 00:00:00 2001 From: Rapptz Date: Sat, 2 Apr 2022 11:15:54 -0400 Subject: [PATCH] Avoid calling PartialMessage.__init__ in Message.__init__ This prevents Message creation from crashing due to the public interface's type checks potentially breaking future compatibility. --- discord/message.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/discord/message.py b/discord/message.py index 0f0121c4d..a22093408 100644 --- a/discord/message.py +++ b/discord/message.py @@ -1375,7 +1375,8 @@ class Message(PartialMessage, Hashable): channel: MessageableChannel, data: MessagePayload, ) -> None: - super().__init__(channel=channel, id=int(data['id'])) + self.channel: MessageableChannel = channel + self.id: int = int(data['id']) self._state: ConnectionState = state self.webhook_id: Optional[int] = utils._get_as_snowflake(data, 'webhook_id') self.reactions: List[Reaction] = [Reaction(message=self, data=d) for d in data.get('reactions', [])]