Comments (8)
Hello, it appears @SushiBtw gave up on this project, so i've forked it and published to npm with many bug fixes and new features.
I am working to fix this bug there, let me know if you find anything else that might help me debug it, my discord is: RaFaTEOLI
.
Repo: https://github.com/RaFaTEOLI/discord-music-player
Package: https://www.npmjs.com/package/@rafateoli/discord-music-player
from discord-music-player.
I just tried it with a new blank project to avoid problems from other code and just added the needed stuff and still get the error
Here the code
const { Client, GatewayIntentBits } = require("discord.js");
const client = new Client({
intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages, GatewayIntentBits.GuildVoiceStates]
});
const settings = {
prefix: '!',
token: '<token>'
};
const { Player } = require("@rafateoli/discord-music-player");
const player = new Player(client);
client.player = player;
client.on("ready", () => {
console.log("I am ready to Play with DMP 🎶");
});
client.player
.on('songAdd', (queue, song) =>
console.log(`Song ${song} was added to the queue.`))
.on('playlistAdd', (queue, playlist) =>
console.log(`Playlist ${playlist} with ${playlist.songs.length} was added to the queue.`))
.on('queueDestroyed', (queue) =>
console.log(`The queue was destroyed.`))
.on('queueEnd', (queue) =>
console.log(`The queue has ended.`))
.on('error', (error, queue) => {
console.log(`Error: ${error} in ${queue.guild.name}`);
})
client.on('messageCreate', async (message) => {
const args = message.content.slice(settings.prefix.length).trim().split(/ +/g);
const command = args.shift();
let guildQueue = client.player.getQueue(message.guild.id);
if (command === 'play') {
let queue = client.player.createQueue(message.guild.id);
await queue.join(message.member.voice.channel);
let song = await queue.play(args.join(' ')).catch(err => {
console.log(err);
if (!guildQueue)
queue.stop();
});
}
if (command === 'playlist') {
let queue = client.player.createQueue(message.guild.id);
await queue.join(message.member.voice.channel);
let song = await queue.playlist(args.join(' ')).catch(err => {
console.log(err);
if (!guildQueue)
queue.stop();
});
}
})
client.login(settings.token);
from discord-music-player.
Reference: fent/node-ytdl-core#1295
from discord-music-player.
@ChubbyStewwa fix pushed to https://github.com/RaFaTEOLI/discord-music-player
Please try again and let me know how it goes.
from discord-music-player.
@RaFaTEOLI it's still not working, now I can't even start the bot
here the error
/<path>/node_modules/@rafateoli/discord-ytdl-core/index.ts:1
import ytdl, { downloadOptions } from '@distube/ytdl-core';
^^^^^^
SyntaxError: Cannot use import statement outside a module
at internalCompileFunction (node:internal/vm:77:18)
at wrapSafe (node:internal/modules/cjs/loader:1288:20)
at Module._compile (node:internal/modules/cjs/loader:1340:27)
at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
at Module.load (node:internal/modules/cjs/loader:1207:32)
at Module._load (node:internal/modules/cjs/loader:1023:12)
at Module.require (node:internal/modules/cjs/loader:1235:19)
at require (node:internal/modules/helpers:176:18)
at Object.<anonymous> (/<path>/node_modules/@rafateoli/discord-music-player/dist/managers/Queue.js:9:45)
at Module._compile (node:internal/modules/cjs/loader:1376:14)
Node.js v20.11.0
from discord-music-player.
That is weird, I will take a look at that later, however it works very well here for me, in case you wanna check it out: https://github.com/RaFaTEOLI/discord-bot-player
from discord-music-player.
Hey I haven't been able to reproduce your error, can you send me how your package.json
looks like?
from discord-music-player.
Sure, here it is
it's just the one for the test bot I set up but get same error
{
"name": "test",
"version": "1.0.0",
"description": "Testing Discord Music Player",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"@discordjs/opus": "^0.9.0",
"@rafateoli/discord-music-player": "^9.2.7",
"discord.js": "^14.15.3"
}
}
Here is the error again
<PATH>\MusicTest\node_modules\@rafateoli\discord-ytdl-core\index.ts:1
import ytdl, { downloadOptions } from '@distube/ytdl-core';
^^^^^^
SyntaxError: Cannot use import statement outside a module
at internalCompileFunction (node:internal/vm:128:18)
at wrapSafe (node:internal/modules/cjs/loader:1280:20)
at Module._compile (node:internal/modules/cjs/loader:1332:27)
at Module._extensions..js (node:internal/modules/cjs/loader:1427:10)
at Module.load (node:internal/modules/cjs/loader:1206:32)
at Module._load (node:internal/modules/cjs/loader:1022:12)
at Module.require (node:internal/modules/cjs/loader:1231:19)
at require (node:internal/modules/helpers:179:18)
at Object.<anonymous> (<PATH>\MusicTest\node_modules\@rafateoli\discord-music-player\dist\managers\Queue.js:9:45)
at Module._compile (node:internal/modules/cjs/loader:1369:14)
Node.js v20.12.2
from discord-music-player.
Related Issues (20)
- [BUG] ytdl-core throws "aborted" error on longer songs HOT 1
- [FR] custom ffmpeg filters for stuff like bassboost
- [BUG] Throwing undefined in Queue#connection. HOT 2
- [FR] Fetch All Tracks from Spotify Playlist HOT 1
- [BUG] DMPError VoiceConnection Error in Linux
- [BUG] Unhandled error when trying to play music HOT 1
- [BUG] Queue.move is not a function HOT 8
- [BUG] play mp3 audio from url
- [BUG] Error in display_name property when loading a playlist HOT 3
- [BUG] ab_channel query is broke the queue.play HOT 3
- Playlist.setData
- [BUG] Error: Invalid header check HOT 1
- [BUG] Bot exits after playing ~30sec of music. HOT 9
- [BUG] DMP error: missing catch or finally
- TypeError: client.player.getQueue is not a function
- [BUG] Multiple Attempts to resolve one video HOT 6
- [BUG] SearchIsNull: The was no YouTube song found by that query. HOT 5
- [BUG] Playing a SPECIFIC YouTube video link doesn't play the exact same video
- [BUG] Short bug description
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from discord-music-player.