Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I'm making a discord bot but when I do my help command nothing happens.

The code for my help command is:

const Discord = require('discord.js');

module.exports.run = async (client, message, args) => {
    const Embed = new Discord.RichEmbed()
      .setColor("YELLOW")
      .setTitle("HardBot - Help")
      .setDescription(":tada: Subscribe to our YouTube channel!")
      .addField("meme", "youtube",true)
    .addField("servers", "ping",true)
    .addField("invite",true)
      .addField("our prefix is h!",true);
    message.channel.send(Embed)
}

module.exports.help = {
    name: "help"
}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
260 views
Welcome To Ask or Share your Answers For Others

1 Answer

Make sure to update discord.js by using npm i discord.js@latest in your terminal. Then replace RichEmbed with MessageEmbed.

For all changes in discord.js v12 click here.

Edit:
Make sure you fill every field from an embed with values otherwise it is an invalid form body.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...