mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-19 04:53:30 +01:00
voice: replace self.xyz events
This commit is contained in:
@@ -27,7 +27,7 @@ class VoiceStateUpdate extends Action {
|
|||||||
// Emit event
|
// Emit event
|
||||||
if (member && member.user.id === client.user.id && data.channel_id) {
|
if (member && member.user.id === client.user.id && data.channel_id) {
|
||||||
client.emit('debug', `[VOICE] received voice state update: ${JSON.stringify(data)}`);
|
client.emit('debug', `[VOICE] received voice state update: ${JSON.stringify(data)}`);
|
||||||
client.emit('self.voiceStateUpdate', data);
|
client.voice.onVoiceStateUpdate(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -22,9 +22,6 @@ class ClientVoiceManager {
|
|||||||
* @type {Collection<Snowflake, VoiceConnection>}
|
* @type {Collection<Snowflake, VoiceConnection>}
|
||||||
*/
|
*/
|
||||||
this.connections = new Collection();
|
this.connections = new Collection();
|
||||||
|
|
||||||
this.client.on('self.voiceServer', this.onVoiceServer.bind(this));
|
|
||||||
this.client.on('self.voiceStateUpdate', this.onVoiceStateUpdate.bind(this));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onVoiceServer({ guild_id, token, endpoint }) {
|
onVoiceServer({ guild_id, token, endpoint }) {
|
||||||
|
|||||||
@@ -2,5 +2,5 @@
|
|||||||
|
|
||||||
module.exports = (client, packet) => {
|
module.exports = (client, packet) => {
|
||||||
client.emit('debug', `[VOICE] received voice server: ${JSON.stringify(packet)}`);
|
client.emit('debug', `[VOICE] received voice server: ${JSON.stringify(packet)}`);
|
||||||
client.emit('self.voiceServer', packet.d);
|
client.voice.onVoiceServer(packet.d);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user