1
votes

I will refer to this picture:

I am making a Discord bot in JavaScript and I am stuck somewhere

I have a say command which you use like !say Text here and the bot will send a plain message saying Text here

Now I want the bot to send an embed message used the same and I want the bot to have a title, image, link and a author set on default. When someone does !sayEmbed @everyone loco (the text there)

1

1 Answers

0
votes

There you go:

client.on("message", function(msg){
    if (msg.content.split("!")[0] != "sayEmbed") return;
    if (msg.content.split(" ")[1]){
        // if args exist
        msg.channel.send(new MessageEmbed()
            .setTitle("Genius Mind")
            .setDescription(msg.content.split("!sayEmbed")[0])
            .setColor("#148837")
            .setAuthor(`@everyone react now | {msg.createdAt.toDateString}`)
            .setURL("someURL.example.com")
            .setThumbnail("foo.bar/link/to/image")
        )
   }
}

I couldn't find any url and image url, so change that yourself.