Advertisement
vilmodz

message.js Discord

Aug 14th, 2019
263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.   //Dans le dossier events ;)
  2. const Discord = require('discord.js');
  3. const prefix = '>';
  4. const client = new Discord.Client({ disableEveryone: true });
  5.  
  6. module.exports = (client, message) => {
  7.     if (message.author.bot || message.channel.type === 'dm') { return; }
  8.     if (!message.channel.permissionsFor(client.user).has('SEND_MESSAGES')) { return; }
  9.     if (!message.content.startsWith(prefix)) { return; }
  10.  
  11.         let args = message.content.slice(prefix.length).trim().split(/ +/g);
  12.         let commande = args.shift();
  13.         let cmd = client.commands.get(commande);
  14.  
  15.         if (!cmd) { return; }
  16.             cmd.run(client, message, args);
  17. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement