SHARE
TWEET

lol 2

a guest Sep 15th, 2019 84 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const client = new Discord.Client({
  2.     disableEveryone: true
  3. })
  4.  
  5.  
  6. client.commands = new Discord.Collection();
  7. client.aliases = new Discord.Collection();
  8.  
  9. config({
  10.     path: __dirname + "/.env"
  11. });
  12.  
  13. ["command"].forEach(handler => {
  14.     require(`./handlers/${handler}`)(client);
  15. });
  16.  
  17. client.on("pret", () => {
  18.     console.log(`wesh ${client.user.username} est co`);
  19.  
  20.     client.user.setPresence({
  21.         status: "connecté",
  22.         game: {
  23.             name: "test",
  24.             type: "lol"
  25.         }
  26.     });
  27. })
  28.  
  29. client.on("message", async message => {
  30.     const prefix = "?";
  31.  
  32.     if (message.author.bot) return;
  33.     if (!message.guild) return;
  34.     if (!message.content.startsWith(prefix)) return;
  35.  
  36.    
  37.     if (!message.member) message.member = await message.guild.fetchMember(message);
  38.  
  39.     const args = message.content.slice(prefix.length).trim().split(/ +/g);
  40.     const cmd = args.shift().toLowerCase();
  41.    
  42.     if (cmd.length === 0) return;
  43.    
  44.    
  45.     let command = client.commands.get(cmd);
  46.    
  47.     if (!command) command = client.commands.get(client.aliases.get(cmd));
  48.  
  49.    
  50.     if (command)
  51.         command.run(client, message, args);
  52. });
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