Skip to content

Commit d5287da

Browse files
committed
fix(context)!: guild/channel ID snowflake checks.
1 parent d5302d5 commit d5287da

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

interactions/context.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,10 @@ def __init__(self, **kwargs) -> None:
106106
self.application_id = (
107107
Snowflake(self.application_id) if self._json.get("application_id") else None
108108
)
109-
self.guild_id = (Snowflake(self.guild_id)) if (self._json.get("guild_id")) else None
110-
self.channel_id = (Snowflake(self.channel_id)) if (self._json.get("channel_id")) else None
109+
if self._json.get("guild_id"):
110+
self.guild_id = Snowflake(self.guild_id)
111+
if self._json.get("channel_id"):
112+
self.channel_id = Snowflake(self.channel_id)
111113
self.callback = None
112114
self.type = InteractionType(self.type)
113115
self.data = InteractionData(**self.data) if self._json.get("data") else None

0 commit comments

Comments
 (0)