From e089c61931049dd52146ada3a874614f21d4f47e Mon Sep 17 00:00:00 2001 From: shiftinv Date: Wed, 23 Aug 2023 23:34:17 +0200 Subject: [PATCH] fix: don't pop key in `MessageReference.with_state` --- disnake/message.py | 2 +- disnake/types/message.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/disnake/message.py b/disnake/message.py index 714069cc50..75ccf00886 100644 --- a/disnake/message.py +++ b/disnake/message.py @@ -603,7 +603,7 @@ def __init__( def with_state(cls, state: ConnectionState, data: MessageReferencePayload) -> Self: self = cls.__new__(cls) self.message_id = utils._get_as_snowflake(data, "message_id") - self.channel_id = int(data.pop("channel_id")) + self.channel_id = int(data["channel_id"]) self.guild_id = utils._get_as_snowflake(data, "guild_id") self.fail_if_not_exists = data.get("fail_if_not_exists", True) self._state = state diff --git a/disnake/types/message.py b/disnake/types/message.py index a7501fbb93..26f691c6bb 100644 --- a/disnake/types/message.py +++ b/disnake/types/message.py @@ -63,11 +63,11 @@ class MessageApplication(TypedDict): cover_image: NotRequired[str] -class MessageReference(TypedDict, total=False): - message_id: Snowflake +class MessageReference(TypedDict): + message_id: NotRequired[Snowflake] channel_id: Snowflake - guild_id: Snowflake - fail_if_not_exists: bool + guild_id: NotRequired[Snowflake] + fail_if_not_exists: NotRequired[bool] class RoleSubscriptionData(TypedDict):