diff --git a/scripty_audio_handler/src/audio_handler.rs b/scripty_audio_handler/src/audio_handler.rs index e89ca697..516742f3 100644 --- a/scripty_audio_handler/src/audio_handler.rs +++ b/scripty_audio_handler/src/audio_handler.rs @@ -171,7 +171,7 @@ impl EventHandler for AudioHandler { Arc::clone(&self.ssrc_state), self.seen_users.clone(), self.guild_id, - self.transcribe_only_role.read().clone(), + *self.transcribe_only_role.read(), )), EventContext::VoiceTick(voice_data) => tokio::spawn(voice_tick( voice_data.clone(), diff --git a/scripty_audio_handler/src/events/voice_tick.rs b/scripty_audio_handler/src/events/voice_tick.rs index a5cdad18..0795ae8d 100644 --- a/scripty_audio_handler/src/events/voice_tick.rs +++ b/scripty_audio_handler/src/events/voice_tick.rs @@ -295,7 +295,7 @@ async fn handle_speakers( if ssrc_state .ssrc_user_data_map .get(&ssrc) - .map_or(false, |x| x.value().2) + .map_or(false, |x| !x.value().2) { continue; } diff --git a/scripty_audio_handler/src/types.rs b/scripty_audio_handler/src/types.rs index 1de1c1eb..a27c68d4 100644 --- a/scripty_audio_handler/src/types.rs +++ b/scripty_audio_handler/src/types.rs @@ -5,7 +5,6 @@ use dashmap::{DashMap, DashSet}; use parking_lot::RwLock; use scripty_data_storage::VoiceIngest; use scripty_stt::Stream; -use serenity::all::RoleId; /// Type alias for a `DashMap` containing SSRCs mapped to `UserId`s. pub type SsrcUserIdMap = DashMap; diff --git a/scripty_commands/src/cmds/config/transcribe_only_role.rs b/scripty_commands/src/cmds/config/transcribe_only_role.rs index 0d56ebf9..ca3d58a2 100644 --- a/scripty_commands/src/cmds/config/transcribe_only_role.rs +++ b/scripty_commands/src/cmds/config/transcribe_only_role.rs @@ -1,6 +1,6 @@ use poise::CreateReply; use scripty_bot_utils::{checks::is_guild, Context, Error}; -use serenity::{all::RoleId, builder::CreateAllowedMentions}; +use serenity::{all::RoleId, builder::CreateAllowedMentions, prelude::Mentionable}; /// Limit Scripty's transcriptions to only users with this role in a voice chat. #[poise::command( @@ -40,7 +40,7 @@ pub async fn config_transcribe_only_role( } else { "config-transcribe-only-role-disabled" }, - roleId: transcribe_only_role.map_or(0, |x| x.get() as i64) + roleId: transcribe_only_role.unwrap_or_else(|| RoleId::new(1)).mention().to_string() )), ) .await?;