Skip to content

Commit

Permalink
fix: don't pop key in MessageReference.with_state
Browse files Browse the repository at this point in the history
  • Loading branch information
shiftinv committed Aug 23, 2023
1 parent 35185d5 commit e089c61
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion disnake/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions disnake/types/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit e089c61

Please sign in to comment.