Skip to content

Commit

Permalink
fix: duplication of speakEnd event
Browse files Browse the repository at this point in the history
This commit fixes an issue where it the speaknd event would be duplicated, one with data and other without.
  • Loading branch information
ThePedroo committed Dec 24, 2023
1 parent eeeb66b commit 0e8b96e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class Connection extends EventEmitter {

this.ws = new WebSocket(`wss://${this.voiceServer.endpoint}/?v=4`, {
headers: {
'User-Agent': `DiscordBot (https://github.com/PerformanC/voice, 1.0.1)`
'User-Agent': `DiscordBot (https://github.com/PerformanC/voice, 1.0.2)`
}
})

Expand Down Expand Up @@ -193,7 +193,6 @@ class Connection extends EventEmitter {

this.emit('speakEnd', userData.userId, ssrc)

userData.stream.emit('end')
userData.stream.push(null)
} else {
if (userData.stream._readableState.ended) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@performanc/voice",
"version": "1.0.1",
"version": "1.0.2",
"description": "Performant Discord voice API client for ES6 Node.js",
"main": "index.js",
"type": "module",
Expand Down

0 comments on commit 0e8b96e

Please sign in to comment.