SHARE
TWEET

once again...

a guest Dec 3rd, 2019 179 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const Discord = require('discord.js');
  2. const client = new Discord.Client();
  3. const Sequelize = require('sequelize');
  4.  
  5. const mysql = require('mysql');
  6. const connection = mysql.createConnection({
  7.   host     : '127.0.0.1',
  8.   port     : '3306',
  9.   user     : 'root',
  10.   password : '1017',
  11.   database : 'discordbot',
  12.   charset : 'utf8mb4'
  13. });
  14.  
  15. const ip = ["180.18.163.3", "114.116.98.254", "44.180.69.107",]
  16.  
  17.  
  18. client.once('ready', () => {
  19.     console.log('Ready!');
  20.     client.user.setActivity("With Andrew Z")
  21. });
  22.  
  23. var prefix = '!';
  24.  
  25. client.on('message', message => {
  26.  
  27.     if (message.content === '!ping1') {
  28.       message.reply('Pinging...');
  29. }
  30.      
  31.     if (message.content === '!react') {
  32.       message.react('👌');
  33. }
  34.  
  35.     if (message.content.startsWith('!hack')) {
  36.         let member = message.mentions.members.first();
  37.         message.channel.send("hacking **" + member.displayName +"**");
  38.         message.channel.send( "getting **" + member.displayName + "'s** IP" );
  39.         message.channel.send( "Injecting malware into **" + member.displayName + "'s** account" );
  40.         message.channel.send( "Found **" + member.displayName + "'s** IP" );
  41.         message.channel.send( "Shutting down **" + member.displayName + "'s** account" );
  42.         message.channel.send( "successfully hacked **" + member.displayName + "**" );
  43.         console.log('hack') }
  44.     if (message.content == "!clear") {
  45.         if (message.member.hasPermission("MANAGE_MESSAGES")) {
  46.             message.channel.send('Deleting...')
  47.             message.channel.fetchMessages()
  48.             .then(function(list){
  49.                 message.channel.bulkDelete(list);
  50.                 message.channel.send('Done!')
  51.              }, function(err){message.channel.send("ERROR: ERROR CLEARING CHANNEL.")})                        
  52.         }
  53.     console.log('clear')
  54.     }
  55.        
  56.     if (message.content === '!help') {
  57.         let embed = new Discord.RichEmbed()
  58.         .setTitle('Heres a list of commands!')
  59.         .setDescription('\n \n **!whois** : Do !whois then the user that you want to get info on. \n \n **!clear** : deletes the latest messages in the channel that you run the command.')
  60.         .setColor('#275BF0')
  61.             message.channel.send(embed)
  62.             console.log('help')
  63.     }
  64.  
  65.     if (message.content.startsWith('!server')) {
  66.         // Easy way to get member object though mentions.
  67.         var member = message.mentions.members.first();
  68.             message.channel.send("Heres some info on **" + message.guild.name +"**\n User count: **" + message.guild.memberCount + "**" + "\n Prefix: **" + "!**");
  69.             console.log('server')
  70.         }
  71.  
  72.     if(message.content.startsWith(prefix + 'flip')) {
  73.     let options = ["Heads", "Tails"];
  74.     let random = Math.floor(Math.random() * options.length);
  75.     message.channel.send(random)
  76.     console.log('flip')
  77.     }
  78.  
  79.     if (message.content.toLowerCase.startsWith(prefix + 'say')){
  80.     let content = message.content
  81.     content = content.replace(prefix+'say', '')
  82.     message.channel.send(content)
  83.     console.log('say')
  84.     }
  85.  
  86.     if (message.content.startsWith('!whois')) {
  87.         var member = message.mentions.members.first();
  88.             message.channel.send("Heres some info on **" + member.displayName +"**\n Their full username: **" + member.user.tag + "** \n Their ID: **" + member.id + "**");
  89.             console.log('whois')   
  90.         }
  91.  
  92.     if (message.content.startsWith(`${prefix}spam`)) {
  93.         var member = message.mentions.members.first();
  94.         let loop = 0;
  95.         while(loop <= 5){
  96.             message.channel.send(`${member.user} `)
  97.             loop++
  98.         }   console.log('spam')}
  99.  
  100.    
  101.     if (message.content.startsWith('!battle')) {
  102.         var member = message.mentions.members.first();
  103.             message.channel.send("**" + message.member.displayName +"** would like to battle. React to fight!")
  104.             .then(sentMessage => sentMessage.react('⚔️'))
  105.             .catch(console.error)
  106.             console.log('battle')
  107.     }
  108.  
  109.  
  110.     if (message.content.startsWith('!kill')) { 
  111.         if(!message.mentions.members) return;
  112.         var member = message.mentions.members.first(); 
  113.             message.channel.send("**" + member.displayName +"** was killed by **" + message.member.user + "**");
  114.             console.log('kill')
  115.         }
  116.  
  117.     if (message.content === '!ping') {
  118.       message.reply('Pong!');
  119.     }
  120.  
  121.     if (message.content === '!invite') {
  122.       message.reply('Here you go! https://discordapp.com/api/oauth2/authorize?client_id=649034587724316673&permissions=0&scope=bot');
  123.     }
  124.  
  125.     if (message.content === '!yeet') {
  126.         var yeetNum=Math.floor((Math.random() * 10) + 1);
  127.         for (var i = 0; i < yeetNum; i++) {
  128.             {message.reply('Yeet');
  129.     }   } }
  130.  
  131. const reactObject = {
  132. "Ok": "👌",
  133. "OK": "👌",
  134. "ok": "👌",
  135. "lol": "😂",
  136. "Lol": "😂",
  137. "LOL": "😂",
  138. "bible": "📖",
  139. "Bible": "📖",
  140. "BIBLE": "📖",
  141. "haha": "😂",
  142. "hahaha": "😂",
  143. "hahahaha": "😂",
  144. "Haha": "😂",
  145. "Hahaha": "😂",
  146. "Hahahaha": "😂",
  147. "HAHA": "😂",
  148. "HAHAHA": "😂",
  149. "HAHAHAHA": "😂"
  150. }
  151.  
  152.  
  153.     if(reactObject[message.content]) {
  154.       message.react(reactObject[message.content]);
  155.     }
  156.  
  157.     if(responseObject[message.content]) {
  158.       message.channel.send(responseObject[message.content]);
  159.     }
  160.  
  161. });
  162.  
  163.     client.on('messageReactionAdd', (reaction, user) => {
  164.         if(reaction.emoji.name === "⚔️") {
  165.             console.log(reaction.users.host);
  166.         }
  167.        
  168. });
  169.  
  170.  
  171.  
  172.     client.login('yayeeeeeeeeetifixedurdamncodeagainagainagain!');
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
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top