Issue
I am trying to make a bot reply in embed form when its mentioned, So far this is my code but it sends an error in my terminal and of course it does nothing.
client.on('messageCreate',message=>{
if(client.user && message.content === `<@!${client.user.id}>`){
const {MessageEmbed} = require('discord.js')
var embed = new MessageEmbed()
.setTitle('WELCOME')
.setAuthor('null')
.setDescription('HELLO BOIIII')
message.reply(embed)
}
})
When I put content: 'string'
in the message.reply({})
it works. but how do I make the message sent embed?
Thank you
Solution
To send an embed you need to do:
message.reply({embeds: [embed]})
In your case
const embed = new MessageEmbed()
.setTitle('WELCOME')
.setAuthor('null')
.setDescription('HELLO BOIIII')
message.reply({embeds: [embed]})
}
Answered By - abisammy
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.