Skip to content
This repository has been archived by the owner on Jul 13, 2023. It is now read-only.

Update for compatibility with discord.js v14 #82

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

r1zyn
Copy link

@r1zyn r1zyn commented May 2, 2023

With discord.js v14 being the current version, client.ws.on now uses the GatewayDispatchEvents enum instead of strings for event listener names. Mainly just updated the discord.js version, switched the event listener names to use the GatewayDispatchEvents enum and tidied up the readme.

- client.ws
-     .on("VOICE_SERVER_UPDATE", this.voiceServerUpdate.bind(this))
-     .on("VOICE_STATE_UPDATE", this.voiceStateUpdate.bind(this))
-     .on("GUILD_CREATE", async data => {
-         for (const state of data.voice_states) await this.voiceStateUpdate({ ...state, guild_id: data.id });
-     });

+ client.ws
+     .on(GatewayDispatchEvents.VoiceServerUpdate, this.voiceServerUpdate.bind(this))
+     .on(GatewayDispatchEvents.VoiceStateUpdate, this.voiceStateUpdate.bind(this))
+     .on(GatewayDispatchEvents.GuildCreate", async data => {
+         for (const state of data.voice_states) await this.voiceStateUpdate({ ...state, guild_id: data.id });
+     });

Note: uses discord.js v14.10.2

@PapiOphidian
Copy link
Contributor

A PR is currently pending on the main lavacord lib which will render this library useless as bindings will be made available in the main lib

@r1zyn
Copy link
Author

r1zyn commented May 3, 2023

A PR is currently pending on the main lavacord lib which will render this library useless as bindings will be made available in the main lib

Yep just saw, got it 👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants