Adding another element to this to detect when someone stops speaking

This commit is contained in:
Bradley Bickford 2024-01-02 21:19:46 -05:00
parent a294b8c668
commit 00b834c40b

View File

@ -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)
}