diff --git a/discord/abc.py b/discord/abc.py index 16ae7fcda8..a7aba7ecc3 100644 --- a/discord/abc.py +++ b/discord/abc.py @@ -712,10 +712,7 @@ def permissions_for(self, obj: Member | Role, /) -> Permissions: return Permissions.all() default = self.guild.default_role - if default: - base = Permissions(default.permissions.value) - else: - base = Permissions.none() + base = Permissions(default.permissions.value if default else 0) # Handle the role case first if isinstance(obj, Role): diff --git a/discord/interactions.py b/discord/interactions.py index aeae830558..19b5363082 100644 --- a/discord/interactions.py +++ b/discord/interactions.py @@ -191,10 +191,9 @@ def _from_data(self, data: InteractionPayload): self._permissions: int = 0 self._guild: Guild | None = None - if self.guild is None and (_guild_data := data.get("guild")): - self._guild = Guild(data=data, state=self) - - self._guild_data = _guild_data + self._guild_data = data.get("guild") + if self.guild is None and self._guild_data: + self._guild = Guild(data=self._guild_data, state=self) # TODO: there's a potential data loss here if self.guild_id: