From 00b834c40b5964943299759175cd4aa73d6405e0 Mon Sep 17 00:00:00 2001 From: Bradley Bickford Date: Tue, 2 Jan 2024 21:19:46 -0500 Subject: [PATCH] Adding another element to this to detect when someone stops speaking --- breadbot.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/breadbot.js b/breadbot.js index c09752e..c8bfbcf 100644 --- a/breadbot.js +++ b/breadbot.js @@ -139,6 +139,10 @@ client.on(Events.VoiceStateUpdate, async (oldState, newState) => { .pipe(fs.createWriteStream(media_voice_folder + path.sep + newCallID + path.sep + `${Date.now()}-${user_id}.ogg`)) }) + + receiver.speaking.on("end", (user_id) => { + console.log(`User ${user_id} stopped speaking`) + }) } catch (error) { console.warn(error) }