Advertisement
Wubzer

cool self bot

Aug 16th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const discord = require("discord.js");
  2. var bot = new discord.Client();
  3. const prefix = "*";
  4. var online = true;
  5. var blockedusers = [
  6.     288446214939082754, // Pruxis
  7.     277923231544115201, // Kiddie_Cannon
  8.     253731784288632832  // 911costguard
  9. ]
  10. var superusers = [
  11.     183270845857136641 // Wubz
  12. ]
  13. var blacklistedservers = [
  14.     306153640023031820, // S.CF
  15.     211228845771063296  // HD
  16. ]
  17. var haspears = []
  18.  
  19. bot.on("message", function(msg) {
  20.     if (!msg.content.startsWith(prefix) || UserBanned(msg.author.id) || ArrayContaining(blacklistedservers, msg.guild.id)) return;
  21.     CMDHandling(msg);
  22. })
  23.  
  24. function UserBanned(id) {
  25.     ArrayContaining(id);
  26. }
  27.  
  28. function GetArgs(m) {
  29.     return m.content.substring(prefix.length).split(" ");
  30. }
  31.  
  32. function ArrayContaining(a, x) {
  33.     for (i = 0; i < a.length; i++) {
  34.         if (a[i] == x) {
  35.             return true;
  36.             break;
  37.         }
  38.     }
  39.     return false;
  40. }
  41.  
  42. function CMDHandling(m) {
  43.     args = GetArgs(m);
  44.     console.log("UserID: " + m.author.id + " has attempted the command \"" + args[0] + "\" on the server: " + m.guild.id + "!");
  45.     switch (args[0].toLowerCase()) {
  46.         case "pear":
  47.             PearSending(m);
  48.     }
  49. }
  50.  
  51. function PearSending(m) {
  52.     setTimeout(function(){  
  53.         if (ArrayContaining(haspears, m.author.id) && !ArrayContaining(superusers, m.author.id)) {
  54.             var embed = new discord.RichEmbed()
  55.                 .setTitle("My Really Fast Keybaord (Not A Selfbot I Swear)")
  56.                 .setColor(0xCB2431)
  57.                 .setDescription("You already got a boneless pear, here is dis boned pear.")
  58.         m.channel.send({embed});
  59.         }
  60.         else {
  61.             haspears.push(m.author.id);
  62.             var embed = new discord.RichEmbed()
  63.                 .setTitle("My Really Fast Keybaord (Not A Selfbot I Swear)")
  64.                 .setColor(0x31AD15)
  65.                 .setDescription("Here you go :b: this is a legendary boneless pear.")
  66.             m.channel.send({embed});
  67.         }
  68.     }, 500);
  69. }
  70.  
  71. bot.on("ready", function() {
  72.     console.log("My mechanical keyboard for my fast typing skills is ready.");
  73. })
  74.  
  75. bot.login("kys lol");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement