New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Start/Stop speaking events on UDP packets #3578
Changes from all commits
6953d97
8d82b38
6928a25
9ebd148
789776b
bf667e3
506d62a
bada4ff
b394f49
c78a401
File filter...
Jump to…
@@ -38,7 +38,7 @@ discord.js is a powerful [Node.js](https://nodejs.org) module that allows you to | ||
- 100% coverage of the Discord API | ||
|
||
## Installation | ||
**Node.js 10.0.0 or newer is required.** | ||
**Node.js 10.2.0 or newer is required.** | ||
sillyfrog
Author
Contributor
|
||
Ignore any warnings about unmet peer dependencies, as they're all optional. | ||
|
||
Without voice support: `npm install discordjs/discord.js` | ||
@@ -422,7 +422,7 @@ class VoiceConnection extends EventEmitter { | ||||||
udp.on('error', err => this.emit('error', err)); | ||||||
ws.on('ready', this.onReady.bind(this)); | ||||||
ws.on('sessionDescription', this.onSessionDescription.bind(this)); | ||||||
ws.on('speaking', this.onSpeaking.bind(this)); | ||||||
ws.on('startSpeaking', this.onStartSpeaking.bind(this)); | ||||||
|
||||||
this.sockets.ws.connect(); | ||||||
} | ||||||
@@ -465,16 +465,19 @@ class VoiceConnection extends EventEmitter { | ||||||
}); | ||||||
} | ||||||
|
||||||
onStartSpeaking({ user_id, ssrc, speaking }) { | ||||||
this.ssrcMap.set(+ssrc, { userID: user_id, speaking: speaking }); | ||||||
} | ||||||
|
||||||
/** | ||||||
* Invoked when a speaking event is received. | ||||||
* @param {Object} data The received data | ||||||
* @private | ||||||
*/ | ||||||
onSpeaking({ user_id, ssrc, speaking }) { | ||||||
onSpeaking({ user_id, speaking }) { | ||||||
speaking = new Speaking(speaking).freeze(); | ||||||
const guild = this.channel.guild; | ||||||
const user = this.client.users.get(user_id); | ||||||
this.ssrcMap.set(+ssrc, user_id); | ||||||
const old = this._speaking.get(user_id); | ||||||
this._speaking.set(user_id, speaking); | ||||||
/** | ||||||
@@ -504,7 +507,7 @@ class VoiceConnection extends EventEmitter { | ||||||
} | ||||||
} | ||||||
|
||||||
play() {} // eslint-disable-line no-empty-function | ||||||
play() { } // eslint-disable-line no-empty-function | ||||||
This conversation was marked as resolved
by sillyfrog
PyroTechniac
Contributor
|
play() { } // eslint-disable-line no-empty-function | |
play() {} // eslint-disable-line no-empty-function |
Nit: formatting should stay the same as it's like that throughout d.js
This comment has been minimized.
This comment has been minimized.
sillyfrog
Nov 14, 2019
Author
Contributor
Aggg, that's VSCode (I'm just using the default setup), fixed (x2)
This shouldn't change until an official announcement is made about a version bump
Unless @iCrawl is okay with this I should mention