From 1a8840658c5edcfc565049228e9cbc078677e1dd Mon Sep 17 00:00:00 2001 From: Kae Bartlett Date: Thu, 18 Jan 2024 03:46:09 +0000 Subject: [PATCH] Revert "Don't fail if guild is None in voice state create" This reverts commit 65c7705cc33f9f800d6711b1b425b2f57f8781e0. --- novus/models/channel.py | 2 ++ novus/models/voice_state.py | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/novus/models/channel.py b/novus/models/channel.py index 642e811a..e34806b7 100644 --- a/novus/models/channel.py +++ b/novus/models/channel.py @@ -398,12 +398,14 @@ def partial( data={"id": id, "type": type.value} # pyright: ignore ) + # @cached_slot_property("_cs_guild") @property def guild(self) -> BaseGuild | None: if self.guild_id is None: return None return self.state.cache.get_guild(self.guild_id) + # @cached_slot_property("_cs_parent") @property def parent(self) -> Channel | None: if self.parent_id is None: diff --git a/novus/models/voice_state.py b/novus/models/voice_state.py index 22575f42..ed4e1614 100644 --- a/novus/models/voice_state.py +++ b/novus/models/voice_state.py @@ -116,6 +116,5 @@ def _update(self, data: payloads.VoiceState) -> Self: self.request_to_speak_timestamp = parse_timestamp(data.get("request_to_speak_timestamp")) self.mute = data.get("mute", False) self.deaf = data.get("deaf", False) - if self.guild is not None: - self.guild._add_voice_state(self) + self.guild._add_voice_state(self) return self