Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How do I make the Discord bot reply in "Embed" form in TypeScript

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

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

To send an embed you need to do:

message.reply({embeds: })

In your case

const embed = new MessageEmbed()
    .setTitle('WELCOME')
    .setAuthor('null')
    .setDescription('HELLO BOIIII')
    message.reply({embeds: })
 }
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading