SHARE
TWEET

Untitled

a guest Sep 18th, 2019 79 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. if (message.content.startsWith('!dm')) {    
  2.     let messageArray = message.content.split(" ");
  3.     let args = messageArray.slice(1);  
  4.     let dUser = message.guild.member(message.mentions.users.first()) || message.guild.members.get(args[0]);
  5.     if (!dUser) return message.channel.send("Impossible de trouver l'utilisateur ...")
  6.     if(!message.member.hasPermission("ADMINISTRATOR")) return message.reply("Vous n'avez pas les permission !")
  7.     let dMessage = args.join(" ").slice(22);
  8.     if(dMessage.length < 1) return message.reply('Vous devez fournir un message !')
  9.  
  10.     const embed = new MessageEmbed()
  11.       .setDescription(`Bonjour, ${dUser}`)
  12.       .addBlankField()
  13.       .setColor(0x3300d9)
  14.       .addField(`Information :`, `${dMessage}`)
  15.       .addBlankField()
  16.       .setTimestamp()
  17.     message.delete();
  18.     dUser.send(embed)
  19.  
  20.     message.author.send(`Le message a bien été envoyé à ${dUser}`)
  21.   }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top