416rehman / splite

SPLITE - Discord Bot with Slash Command Handler and Endpoint Handler, supporting AI, Music, Moderation, and more!
GNU General Public License v3.0
104 stars 29 forks source link

discord_js_1.IntentsBitField is not a constructor #36

Closed prosilentgamer2 closed 1 year ago

prosilentgamer2 commented 2 years ago

2022-09-11 23:35:17 - info [app.js]: Initializing... /home/Bot/node_modules/discord-player/dist/Player.js:46 if (this.client?.options?.intents && !new discord_js_1.IntentsBitField(this.client?.options?.intents).has(discord_js_1.IntentsBitField.Flags.GuildVoiceStates)) { ^

TypeError: discord_js_1.IntentsBitField is not a constructor at new Player (/home/Bot/node_modules/discord-player/dist/Player.js:46:47) at new Client (/home/Bot/src/Client.js:53:23) at Object. (/home/Bot/app.js:15:16) at Module._compile (node:internal/modules/cjs/loader:1101:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10) at Module.load (node:internal/modules/cjs/loader:981:32) at Function.Module._load (node:internal/modules/cjs/loader:822:12) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) at node:internal/main/run_main_module:17:47

AdroidNoodle commented 1 year ago

Changing the discord-player package version from 5.3.2 to 3.0.0 in /package.json seems to have fixed the issue.

416rehman commented 1 year ago

Changing the discord-player package version from 5.3.2 to 3.0.0 in /package.json seems to have fixed the issue.

This was the issue, discord-player was not compatible with discord.js 13.

The bot has been updated to DiscordJS 14 with update dd9442e. And this issue should no longer exist.