I recently started messing around with Discord bots, and found this site as a place to keep the bot running when my personal computer is off. I’m surprised I haven’t heard of it earlier! Anyways, I get errors now with my bot on Glitch.com, whereas with the same code, I don’t get any when running it from my desktop. I think it might be because the version of discord.js on my desktop is newer than the version on Glitch. It seems to cause an error after I create an embed and use ".addField()" on it. I tried going into the terminal and typing npm install discord.js@12.1.1 but I don’t think that worked.
Hi, discord.js@12.x has problems (for me) and i can’t help you but you can special Embed class like discord.js@11.4.2 RichEmbed class. Look discord.js@11.4.2 source code.
Try typing “*” as the version in dependencies. also i suggest putting your bot token in .env so no one else can see it. Also if you don’t already know inactive projects go to sleep if you haven’t paid.
Thanks for the tip about the .env, I’ll set that up. Using * as the version the the discord.js dependencies didn’t fix the problem. I’m still getting the same error.
Yes, I’m still getting the error. Would it help to send the error message? You could also test it yourself if you put any bot token in the config and try it for yourself by typing the >help command in a server the bot is in.
Here’s a screenshot of the error.
I use .addField() on my embed, which I think was added to a recent version of discord.js, so that’s why I think it’s not using the latest version
ah i see the problem:
discord.js v12 needs node.js v12 or higher to work, and you probably have v8 or v10 node.js in your project. you can change that in your package.json with this: