player.js icon indicating copy to clipboard operation
player.js copied to clipboard

TypeError: player is not a constructor

Open Frieslbelenoer opened this issue 3 years ago • 1 comments

Hi, recently i want to make a discord bot, but this error just pops up and i don't think i can solve this.

const Discord = require("discord.js") const dotenv = require("dotenv") const { REST } = require("@discordjs/rest") const { Routes } = require('discord-api-types/v9') const fs = require("fs") const { player } = require ("discord-player")

dotenv.config() const TOKEN = process.env.TOKEN

const LOAD_SLASH = process.argv[2] == "load"

const CLIENT_ID = "1019987487554277486" const GUILD_ID ="789424249872973825"

const client = new Discord.Client({ intents: [ "GUILDS", "GUILD_VOICE_STATES", ] })

client.slashcommands = new Discord.Collection() client.player = new player(client, { ytdlOptions: { quality: "highestaudio", highWatermark: 1 << 25


Screenshot 2022-09-16 205455 ERROR------------

client.player = new player(client, { ^

TypeError: player is not a constructor at Object. (D:\Queyla\index.js:24:17) at Module._compile (node:internal/modules/cjs/loader:1126:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1180:10) at Module.load (node:internal/modules/cjs/loader:1004:32) at Function.Module._load (node:internal/modules/cjs/loader:839:12) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) at node:internal/main/run_main_module:17:47

Frieslbelenoer avatar Sep 16 '22 13:09 Frieslbelenoer

@Frieslbelenoer The player object that you are importing is for a package called discord-player, which appears to be for playing music within discord.

gtapplec avatar Nov 18 '22 13:11 gtapplec

Unrelated to Vimeo, as far as I can tell.

bdougherty avatar Apr 03 '24 18:04 bdougherty