Skip to content

Commit 398f131

Browse files
committed
🎨 Requested changes
1 parent 9409c35 commit 398f131

File tree

1 file changed

+8
-13
lines changed

1 file changed

+8
-13
lines changed

discord/interactions.py

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -262,9 +262,7 @@ def _from_data(self, data: InteractionPayload):
262262
pass
263263

264264
channel = data.get("channel")
265-
data_ch_type: int | None = None
266-
if channel:
267-
data_ch_type = channel.get("type")
265+
data_ch_type: int | None = channel.get("type") if channel else None
268266

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

278276
if self.channel is None and self.guild:
279277
self.channel = self.guild._resolve_channel(self.channel_id)
280-
if self.channel is None:
281-
if self.channel_id is not None:
282-
ch_type = (
283-
ChannelType.text
284-
if self.guild_id is not None
285-
else ChannelType.private
286-
)
287-
return PartialMessageable(
288-
state=self._state, id=self.channel_id, type=ch_type
289-
)
278+
if self.channel is None and self.channel_id is not None:
279+
ch_type = (
280+
ChannelType.text if self.guild_id is not None else ChannelType.private
281+
)
282+
return PartialMessageable(
283+
state=self._state, id=self.channel_id, type=ch_type
284+
)
290285

291286
self._channel_data = channel
292287

0 commit comments

Comments
 (0)