Issue
I wrote a short discord.js Bot, it does work well if i host it on my Windows PC.
But if i try to host the same code on my Raspberry Pi 4 with node.js and pm2 it does not show my "-help" command which uses embed message.
All other commands work well on both my PC and on my Pi.
If i remove the part that embeds the "-help" command it works again on my Pi.
The following code works on Windows but not on my Pi.
if(command === "help") {
const embed = new Discord.MessageEmbed()
.setTitle("Here is a list of all commands")
.setColor(0x992d22)
.setDescription("-capy\n-vibe\n-coinflip\n-jail")
message.channel.send(embed)
}
My node.js version on my PC is 14.16.1 and on my Pi it is 10.24.1
I did not get any errors as far as i can tell.
How can i make the code work on my Raspberry Pi? Is the Problem the older node.js verison on my Pi?
Solution
You need Node v12+ to use djs v12, the problem is MessageEmbed uses some code that will break node v10 so just upgrade your node version
Answered By - Jytesh