daily pastebin goal
8%
SHARE
TWEET

Untitled

a guest Feb 14th, 2018 78 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     const Discord = require("discord.js");
  2.     const SETTINGS = require('./Config/config.json');
  3.     const COMMANDS = require('./Managers/CommandManager.js');
  4.     const REACTIONS = require('./Config/reactions.json');
  5.     const PREFIX = SETTINGS.prefix;
  6.  
  7.     var bot = new Discord.Client();
  8.  
  9.     bot.on("ready", function(){
  10.         console.log("Bot is fired up!");
  11.     })
  12.  
  13.     bot.on('ready', () => { bot.user.setGame('Mind wants to die.') });    
  14.  
  15.     bot.on("message", function(message) {
  16.         if (message.author.equals(bot.user)) return;
  17.  
  18.         if (message.content == "lol ok") {
  19.             message.channel.send("that's my nigga @Mind#1751 ");
  20.         }
  21.  
  22.         // Will get bot banned - Use with caution.
  23.         var obj = REACTIONS.filter(obj => {
  24.             if (!obj.enable) return;
  25.             if (obj.id === message.author.id) {
  26.                 message.react(obj.emoji).then(function () {
  27.                     if (obj.emoji2 !== null) {
  28.                         message.react(obj.emoji2).then(function () {
  29.                             if (obj.emoji3 !== null) {
  30.                                 message.react(obj.emoji3).then(function (){
  31.                                     //if (obj.emoji4 !== null) {
  32.                                       //  message.react(obj.emoji4);
  33.                                     //}
  34.                             });
  35.                         }});
  36.                     }
  37.                 });
  38.             }
  39.         })[0];
  40.  
  41.         client.on('guildMemberAdd', member => {
  42.             // Send the message to a designated channel on a server:
  43.             const dm = member.createDM(channel => {
  44.               if (!dm) return;
  45.               // Send the message, mentioning the member
  46.               channel.send(`Welcome to the server, ${member}`);
  47.             });
  48.             // Do nothing if the channel wasn't found on this server
  49.           });
  50.  
  51.         /*if (!message.content.startsWith(PREFIX)) return;
  52.  
  53.         var args = message.content.substring(PREFIX.length).split(" ");
  54.         var mention = message.mentions.members.first();
  55.  
  56.         message.delete();*/
  57.  
  58.         switch (args[0]) {
  59.             case "ping":
  60.                 COMMANDS.Ping(message);
  61.                 break;
  62.             case "info":
  63.                 COMMANDS.Info(message);
  64.                 break;
  65.             case "create":
  66.                 var desc = message.content.split('"');
  67.                 COMMANDS.Create(message, desc[1]);
  68.                 break;
  69.             case "update":
  70.                 var desc = message.content.split('"');
  71.                 COMMANDS.Update(message, desc[1]);
  72.                 break;
  73.             /*case "mute":
  74.                 COMMANDS.Mute(message, mention);
  75.                 break;
  76.             case "unmute":
  77.                 COMMANDS.Unmute(message, mention);
  78.                 break;*/
  79.             case "restart":
  80.                 COMMANDS.Restart();
  81.                 break;
  82.         }
  83.     });
  84.  
  85.  
  86.     bot.login(SETTINGS.token)
  87.         .then(token => {
  88.             console.log('Login: Success');
  89.         });
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