I am trying to make a submission command for my discord bot, it’s like when I user uses the command; !submit {#channel} + attachment
Once the use the command there will need to be an attachment with it, here is what I have done so far, the problem is that it isn’t showing the image in the embed.
if(message.content.toLowerCase().startsWith(prefix + 'submit')){
if(message.mentions.channels.first()){
if(message.attachments.first()){
message.delete()
var channel = message.mentions.channels.first()
let image = message.attachments.first().url
let submission = new Discord.RichEmbed()
.setTitle('Submission')
.setColor('RANDOM')
.setImage(image)
.setFooter('by '+message.author.tag)
.setTimestamp()
channel.send(submission);
}else{
message.reply('you'll need an attachment.')
}
}else{
message.reply('you need to mention a channel to submit in.')
}
}