Skip to content
This repository was archived by the owner on Jun 17, 2025. It is now read-only.

Commit 89d719b

Browse files
committed
Fix thread ID widening now that types are correct
1 parent 2ceec42 commit 89d719b

File tree

3 files changed

+9
-12
lines changed

3 files changed

+9
-12
lines changed

scripty_audio_handler/src/connect.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ pub async fn connect_to_vc(
6565
(
6666
ChannelType::NewsThread | ChannelType::PublicThread | ChannelType::PrivateThread,
6767
Some(parent),
68-
) => (parent, Some(ThreadId::new(transcript_target_channel.get()))),
68+
) => (parent, Some(transcript_target_channel)),
6969

7070
// a thread with no parent? i must inform my supervisor post-haste!
7171
(

scripty_bot_utils/src/handler/normal/voice_state_update.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -278,8 +278,5 @@ async fn maybe_create_thread(
278278
.await?
279279
};
280280

281-
Ok((
282-
target_channel_id,
283-
Some(ThreadId::new(thread.id.widen().get())),
284-
))
281+
Ok((target_channel_id, Some(thread.id)))
285282
}

scripty_commands/src/cmds/join.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,10 @@ pub async fn join(
124124
.await?;
125125
return Ok(());
126126
} else if create_thread
127-
&& [ChannelType::Voice, ChannelType::Stage].contains(&target_channel.base.kind)
128-
{
127+
&& matches!(
128+
target_channel.base.kind,
129+
ChannelType::Voice | ChannelType::Stage
130+
) {
129131
ctx.say(
130132
format_message!(resolved_language, "join-create-thread-in-unsupported", targetMention: target_channel.mention().to_string()),
131133
)
@@ -229,9 +231,7 @@ pub async fn join(
229231
if voice_channel
230232
.base
231233
.guild(ctx.cache())
232-
.ok_or(Error::custom(
233-
"the current server was not found in the cache (Discord didn't send data)".to_string(),
234-
))?
234+
.ok_or_else(Error::expected_guild)?
235235
.voice_states
236236
.iter()
237237
.filter(|state| state.channel_id == Some(voice_channel.id))
@@ -274,7 +274,7 @@ pub async fn join(
274274
)
275275
.await?;
276276

277-
(Some(ThreadId::new(thread.id.get())), target_channel.id)
277+
(Some(thread.id), target_channel.id)
278278
} else {
279279
// creating a thread outside a forum
280280

@@ -289,7 +289,7 @@ pub async fn join(
289289
)
290290
.await?;
291291

292-
(Some(ThreadId::new(thread.id.get())), target_channel.id)
292+
(Some(thread.id), target_channel.id)
293293
}
294294
} else if let Some(target_thread) = target_thread {
295295
// this channel is a thread

0 commit comments

Comments
 (0)