@@ -262,9 +262,7 @@ def _from_data(self, data: InteractionPayload):
262
262
pass
263
263
264
264
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
268
266
269
267
if data_ch_type is not None :
270
268
factory , ch_type = _threaded_channel_factory (data_ch_type )
@@ -277,16 +275,13 @@ def _from_data(self, data: InteractionPayload):
277
275
278
276
if self .channel is None and self .guild :
279
277
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
+ )
290
285
291
286
self ._channel_data = channel
292
287
0 commit comments