0
votes

I want to make discord bot post image from the text.

For example - If someone types !image http://imgur.com/xxxxxx.jpg

then the bot should reply back with the image without link. Any help? Thank you.

1
How are you handling arguments & commands? Please post the code of what you have triedFederico Grandi
Use regex to find the linkSaddy
I managed it to get it working, But what is Regex?John

1 Answers

0
votes

Here's a example how you could do it:

const Discord = require('discord.js');
const imageUrl = msg.content.split(' ').slice(1);

const embed = new Discord.RichEmbed().setImage(imageUrl)
msg.channel.send{ embed }