gaber-elsayed

upload image - developed

Jun 7th, 2020
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. client.on("message", message => {
  2. if(message.content.startsWith('$image')){
  3. let gg = message.mentions.channels.first();
  4. if(!gg) return message.channel.send(new Discord.RichEmbed()
  5. .setDescription(`\`\`\`The way to use the command is \`\`\``)
  6. .addField('**Example**',`> ** ${prefix}image [#channel] "URL" **`)
  7. .setFooter(message.author.tag)
  8. .setTimestamp());
  9. let jj = message.content.split(/ +/).slice(2).join(' ');
  10. if(!jj) return message.channel.send(new Discord.RichEmbed()
  11. .setDescription(`\`\`\`The way to use the command is \`\`\``)
  12. .addField('**Example**',`> ** ${prefix}image [#channel] "URL" **`)
  13. .setFooter(message.author.tag)
  14. .setTimestamp());message.guild.channels.get(gg.id).send({
  15. files: [{ name:"Uranus.png", attachment:jj}]
  16. }).catch(yy => { message.channel.send("Invaild URL")});
  17. //message.channel.send('Done').then(ff => ff.react("✅")).catch(yy => {});
  18. message.delete();
  19. }})
Add Comment
Please, Sign In to add comment