SHARE
TWEET

Untitled

a guest Jul 16th, 2019 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const Discord = require("discord.js");
  2. const botconfig = require("./botconfig.json");
  3. const colours = require("./colours.json");
  4.  
  5. const bot = new Discord.Client({disableEveryone: true});
  6.  
  7. bot.on("ready", async () => {
  8.     console.log(`${bot.user.username} est en ligne`)
  9.     bot.user.setActivity("💬 Envoyez-moi un message privé !", {type: "STREAMING"});
  10. })
  11.  
  12. const fs = require("fs");
  13. bot.commands = new Discord.Collection();
  14. bot.aliases  = new Discord.Collection();
  15.  
  16. fs.readdir("./commands",(err, files) => {
  17.  
  18.     if(err) console.log(err)
  19.  
  20.     let jsfile = files.filter(f => f.split(".").pop() === "js")
  21.     if(jsfile.length <= 0) {
  22.        return console.log("[LOGS] Commande non trouvée!");
  23.  
  24.        }
  25.  
  26.     jsfile.forEach((f, i) => {
  27.         let pull = require(`./commands/${f}`);
  28.         bot.commands.set(pull.config.name, pull);
  29.         pull.config.aliases.forEach(alias => {
  30.             bot.aliases.set(alias, pull.config.name)
  31.         });
  32.     });
  33. });
  34.  
  35.  
  36.  
  37. bot.on("message", async message => {
  38.     if(message.author.bot || message.channel.type === "dm") return;
  39.  
  40.     let prefix = botconfig.prefix;
  41.     let messageArray = message.content.split(" ")
  42.     let cmd = messageArray[0]
  43.     let args = messageArray.slice(1);
  44.  
  45.  
  46.     if (!message.content.startsWith(prefix)) return;
  47.     let commandfile = bot.commands.get(cmd.slice(prefix.length)) || bot.commands.get(bot.aliases.get(cmd.slice(prefix.length)))
  48.     if(commandfile) commandfile.run(bot, message, args)
  49.  
  50. })
  51. bot.on('message', (message) => {
  52.     if(message.author.bot) return;
  53.     if(message.channel.type == "dm") {
  54.     if(message.attachments.first().url
  55.         bot.channels.get("600510621183901706").send('📚 **Nouvelle demande support de** ' + message.attachments + ` **avec le message suivant:** ` + message.content).then(message.author.send(`Bonjour, notre équipe s'occupe de votre demande.`)).then(async msg => {
  56.             await msg.react("573151782251921446")
  57.             await msg.react("573151894990618624")
  58.         })
  59.     }
  60.  });    
  61.  
  62. bot.login(botconfig.token);
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