mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-04-18 23:15:48 +00:00
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.
This commit is contained in:
parent
2aca705b95
commit
f7a79ff8d7
@ -1375,7 +1375,8 @@ class Message(PartialMessage, Hashable):
|
|||||||
channel: MessageableChannel,
|
channel: MessageableChannel,
|
||||||
data: MessagePayload,
|
data: MessagePayload,
|
||||||
) -> None:
|
) -> None:
|
||||||
super().__init__(channel=channel, id=int(data['id']))
|
self.channel: MessageableChannel = channel
|
||||||
|
self.id: int = int(data['id'])
|
||||||
self._state: ConnectionState = state
|
self._state: ConnectionState = state
|
||||||
self.webhook_id: Optional[int] = utils._get_as_snowflake(data, 'webhook_id')
|
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', [])]
|
self.reactions: List[Reaction] = [Reaction(message=self, data=d) for d in data.get('reactions', [])]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user