Skip to content

Commit

Permalink
🎨 Requested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Paillat-dev committed Dec 27, 2024
1 parent 9409c35 commit 398f131
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions discord/interactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,9 +262,7 @@ def _from_data(self, data: InteractionPayload):
pass

channel = data.get("channel")
data_ch_type: int | None = None
if channel:
data_ch_type = channel.get("type")
data_ch_type: int | None = channel.get("type") if channel else None

if data_ch_type is not None:
factory, ch_type = _threaded_channel_factory(data_ch_type)
Expand All @@ -277,16 +275,13 @@ def _from_data(self, data: InteractionPayload):

if self.channel is None and self.guild:
self.channel = self.guild._resolve_channel(self.channel_id)
if self.channel is None:
if self.channel_id is not None:
ch_type = (
ChannelType.text
if self.guild_id is not None
else ChannelType.private
)
return PartialMessageable(
state=self._state, id=self.channel_id, type=ch_type
)
if self.channel is None and self.channel_id is not None:
ch_type = (
ChannelType.text if self.guild_id is not None else ChannelType.private
)
return PartialMessageable(
state=self._state, id=self.channel_id, type=ch_type
)

self._channel_data = channel

Expand Down

0 comments on commit 398f131

Please sign in to comment.