Guichaguri / DiscordDJ

Discord DJ Bot. Play music in your server. Inspired by PlugDJ
http://guichaguri.github.io/DiscordDJ/
GNU Lesser General Public License v2.1
200 stars 49 forks source link

Config file can't be generated #50

Open 1sudo opened 8 years ago

1sudo commented 8 years ago

I'm getting the following error when running the latest release. As you can see below, my node version is up to date. I can go into DiscordJS.js and comment out the following:

function initDecoders() { // if(!Utils.exists(config['decoder-path'])) { Utils.registerDecoder(new DiscordDJ.FFmpegDecoder(null)); // } else { // Utils.registerDecoder(new DiscordDJ.FFmpegDecoder(config['decoder-path'])); // } Utils.registerDecoder(new DiscordDJ.ChiptuneDecoder()); }

This allows the bot to start but when I play a song with !yt it says "You were added to the wait list and your track was set" and no song plays.

Any idea what's going on?

root@msg:~/bot/DiscordDJ-0.0.5# node -v v5.7.1

root@msg:~/bot/DiscordDJ-0.0.5# ls LICENSE lib runtime setup-bot.sh start-bot.sh README.md package.json setup-bot.bat start-bot.bat root@msg:~/bot/DiscordDJ-0.0.5# ./setup-bot.sh

NPM is installed! Installing dependencies (that can take a while)

Dependencies are installed.

Now, you can start the bot. We will help you configure the basic information

Run the bot now? [Y/N] y

discord-dj@0.0.5 start /root/bot/DiscordDJ-0.0.5 node ./runtime/DiscordDJ.js

/root/bot/DiscordDJ-0.0.5/runtime/DiscordDJ.js:33 if(!Utils.exists(config['decoder-path'])) { ^

TypeError: Cannot read property 'decoder-path' of null at initDecoders (/root/bot/DiscordDJ-0.0.5/runtime/DiscordDJ.js:33:28) at Object. (/root/bot/DiscordDJ-0.0.5/runtime/DiscordDJ.js:324:1) at Module._compile (module.js:413:34) at Object.Module._extensions..js (module.js:422:10) at Module.load (module.js:357:32) at Function.Module._load (module.js:314:12) at Function.Module.runMain (module.js:447:10) at startup (node.js:141:18) at node.js:933:3

npm ERR! Linux 4.2.6-1-pve npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start" npm ERR! node v5.7.1 npm ERR! npm v3.6.0 npm ERR! code ELIFECYCLE npm ERR! discord-dj@0.0.5 start: node ./runtime/DiscordDJ.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the discord-dj@0.0.5 start script 'node ./runtime/DiscordDJ.j s'. npm ERR! Make sure you have the latest version of node.js and npm installed. npm ERR! If you do, this is most likely a problem with the discord-dj package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node ./runtime/DiscordDJ.js npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs discord-dj npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm owner ls discord-dj npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request: npm ERR! /root/bot/DiscordDJ-0.0.5/npm-debug.log

philno commented 8 years ago

So there is an easy fix for this: Create "config.json" as an empty file / put "{}" in it and the installation dialog will apear as expected.

Btw: @Guichaguri :You "deleted" my issue and use the generic-title one instead? I usually check issues before I open a new one, but "error" or "didnt work" is not as useful...

Guichaguri commented 8 years ago

@bitrape Sorry, I changed the title =P

ghost commented 7 years ago

philno's fix is useful if you start setup-bot.sh without permissions or something went wrong and you get "TypeError: Cannot read property 'decoder-path' of null"