Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
cattoman1 opened this issue Apr 21, 2022 · 3 comments
Open

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

cattoman1 opened this issue Apr 21, 2022 · 3 comments

Comments

@cattoman1
Copy link

image
help

@emerysteele
Copy link
Owner

emerysteele commented Apr 21, 2022

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
Copy link
Author

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

@emerysteele
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants