fix(context)!: guild/channel ID snowflake checks.
@@ -106,8 +106,10 @@ class CommandContext(Context):
self.application_id = (
Snowflake(self.application_id) if self._json.get("application_id") else None
)
- self.guild_id = (Snowflake(self.guild_id)) if (self._json.get("guild_id")) else None
- self.channel_id = (Snowflake(self.channel_id)) if (self._json.get("channel_id")) else None
+ if self._json.get("guild_id"):
+ self.guild_id = Snowflake(self.guild_id)
+ if self._json.get("channel_id"):
+ self.channel_id = Snowflake(self.channel_id)
self.callback = None
self.type = InteractionType(self.type)
self.data = InteractionData(**self.data) if self._json.get("data") else None
