renesansz / discord-greeter-bot

My greeter bot for Discord
MIT License
49 stars 38 forks source link

Embed Image #223

Closed ElcairFarron closed 5 years ago

ElcairFarron commented 5 years ago

Hi there, renesansz!

Could you tell me the details to add a comannd that would embed an image via url?

Thank you in advance.

pablo-gbr commented 5 years ago

Write this inside you "client.on('message'..." code:

if(msg.content.startsWith('!image')){
    var image = msg.content.split(' ').splice(1).join(' '); // Your image URL
    var embed = new Discord.RichEmbed()
    .setTitle('Image')
    .setImage(image); // Image must be an url
    msg.channel.send(embed);
}

That's just a basic thing, you can change the command if you want and improve it.

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.