emerysteele / minecraft-server-status-bot

Minecraft Server Status Bot for Discord
21 stars 23 forks source link

I cant use mc!status or the bot crashes #6

Open cattoman1 opened 2 years ago

cattoman1 commented 2 years ago

image help

emerysteele commented 2 years ago

Won't be able to test until later this evening, but looks like I may have missed updating a line of code when I was working on the server icon code.

Try replacing line 190: const attachment = new Discord.MessageAttachment(Buffer.from(body.favicon.substr('data:image/png;base64,'.length), 'base64'), "icon.png")

with this: var imageStream = Buffer.from(defaultFavicon, 'base64'); if(body.favicon != null){ imageStream = Buffer.from(body.favicon.substr('data:image/png;base64,'.length), 'base64'); } const attachment = new Discord.MessageAttachment(imageStream, "icon.png");

cattoman1 commented 2 years ago

image i think i did it right but it wont work image

emerysteele commented 2 years ago

Should look like this when done chrome_183J0vcs30

I've made a temp update to the code here: https://github.com/emerysteele/minecraft-server-status-bot/blob/emerysteele-patch-1/app.js

If you wanna just copy/paste the whole thing.

The token error might be separate tho, maybe double check your config.json file if you still get that message after updating the code? Your token should come from the discord developer portal. notepad++_UUYCRpoW1o