Capps0611 / DayZ-Player-Leaderboard-Bot

A bot that uses FTP connection to generate and display a leaderboard to a discord server using the DayZ Mod @Intenz-Leaderboard
MIT License
4 stars 3 forks source link

Leaderboard Bot doesnt work #2

Closed Spinne1977 closed 4 years ago

Spinne1977 commented 4 years ago

Hello. I´m trying to use your Leaderboard on Discord. But if i type "!leaderboard" in discord, i`ll get this error message.


C:\Leaderboard>npm start

dayz_player_leaderboard_bot@1.0.0 start C:\Leaderboard nodemon --ignore "playerJsons/" dayzPlayerLeaderboardBot.js

[nodemon] 2.0.4 [nodemon] to restart at any time, enter rs [nodemon] watching path(s): . [nodemon] watching extensions: js,mjs,json [nodemon] starting node dayzPlayerLeaderboardBot.js Connected as Kill Em All - Leaderboard#4683 Command received: leaderboard Arguments: undefined:1

SyntaxError: Unexpected end of JSON input at JSON.parse () at compilePlayers (C:\Leaderboard\dayzPlayerLeaderboardBot.js:124:19) at C:\Leaderboard\dayzPlayerLeaderboardBot.js:86:32 at Array.forEach () at Timeout._onTimeout (C:\Leaderboard\dayzPlayerLeaderboardBot.js:86:16) at listOnTimeout (internal/timers.js:551:17) at processTimers (internal/timers.js:494:7) [nodemon] app crashed - waiting for file changes before starting...

Do you know what`s wrong?

Capps0611 commented 4 years ago

I haven't been monitoring this repo and just saw this report. I will take a look into it (I haven't updated the code in over a year so something could have broke in the meantime).

Spinne1977 commented 4 years ago

Yes please, I would be very grateful if you could check that out

Capps0611 commented 4 years ago

Yes please, I would be very grateful if you could check that out

Just wanted to give you an update. I believe I have narrowed down the issue, it looks like jsFTP has issues downloading files since node v10. I am working on converting over to a new FTP package. I should hopefully have it fixed up later this week!

Spinne1977 commented 4 years ago

All right, thank you for your efforts

Capps0611 commented 4 years ago

@Spinne1977 See my latest changes! Let me know if your issue is resolved!

saboteur13 commented 4 years ago

Hi Capps0611

Thanks for sharing this!

I also have a issue not sure if its the same (log file attached).

I am still noob with js so I am not sure how to fix, hopefully you can help.

I have my own Deathmatch server on DayZ in South Africa and since there is no mod for an in-game leaderboard this might come in handy.

Hope to hear from you soon

2020-08-27T14_56_44_501Z-debug.log

Capps0611 commented 4 years ago

@saboteur13 are you using the latest code I put out a few days ago? Also is your settings.json file setup properly? Also did you run npm i after extracting the zip file?

saboteur13 commented 4 years ago

Thanks for the reply.

I believe so, although I might have missed something.

I changed the samplesettings.json to settings.json and filled in all the info as per your quick guide including my discord bot token key and then I also extracted the files using rpm i in a node.js command prompt.

Is your latest code the files included here in this post in the Code tab?

Capps0611 commented 4 years ago

Yes, the code on in the "code" section is the latest code. I updated it about ~3 days ago fixing an issue. After extracting the files from the zip, if you run npm i that will install all of the required node modules. then using npm start you should be up and running.

saboteur13 commented 4 years ago

Thanks I did all that but it doesn't work for me, I'm probably just doing something else wrong.

If possible, maybe on Sunday we can chat on Discord and I can give you access on AnyDesk to my server then you can have a look at what I've done? Maybe it's something simple.

I'm working tomorrow unfortunately

Capps0611 commented 4 years ago

@saboteur13 it may be an issue with your node version, try updating node to make sure its on the latest version!

Capps0611 commented 4 years ago

Initial issue has been resolved, closing this. If you have any other issues please open a new issue.

Thank you,