Advertisement
Guest User

Untitled

a guest
Sep 18th, 2019
197
0
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 Canvas = require('canvas');
  4. const Jimp = require('jimp');
  5. const embedConst = new Discord.RichEmbed()
  6. const GoogleImages = require('google-images');
  7. const gclient = new GoogleImages('015899125258643417944:yruyo2do_jy', 'AIzaSyBULJSphU2oBYESNfJfKEYxDgdOaFnVUTY');
  8. const ytdl = require('ytdl-core');
  9. const YouTube = require('simple-youtube-api');
  10. const youtube = new YouTube('AIzaSyBULJSphU2oBYESNfJfKEYxDgdOaFnVUTY'); //MickBot API 1
  11. //const youtube = new YouTube('AIzaSyCHyI71hb0UoS52G7b-Ede6_3kU6fedXhg'); //MickBot API 2
  12.  
  13. var name;
  14. var rmemeArg;
  15. var bossArg;
  16. var kqueenAuthor = "79j2ViVMpFAn0B7B0rYpfYcMRwEm0tKLO";
  17. var kqueenMessage = "79j2ViVMpFAn0B7B0rYpfYcMRwEm0tKLO";
  18. var player1 = "79j2ViVMpFAn0B7B0rYpfYcMRwEm0tKLO", player2 = "79j2ViVMpFAn0B7B0rYpfYcMRwEm0tKLO";
  19. var bomb = 0;
  20. var btdRec = 0;
  21. var consoleLog = 0;
  22. var turn = 1, standStart = 0;
  23. var starPlatHealth = 1000, starPlatDamage = 50, starPlatBlock = 50, worldHealth = 1000, worldDamage = 50, worldBlock = 50;
  24. var msgArray = [], userArray = [], timeArray = [];
  25. var btdArray = new Array (2)
  26. var queue = [], qtime = [], qtitle = [], qdescription = [], qchanneltitle = [], qid = [], qCommTitle = [];
  27. var i, j, k, l;
  28. var playing = false, qPlaying = false;
  29. var playfile = false;
  30.  
  31. connection => {
  32.   const dispatcher = connection.playStream(ytdl('https://www.youtube.com/watch?v=UdX4qoQ8xFU&loop=0',{filter:"audioonly"}));
  33. }
  34.  
  35. client.on('message', (message) => {
  36.   /*youtube.getVideo('https://www.youtube.com/watch?v=3odIdmuFfEY')
  37.   .then(video => {
  38.       console.log(`The video's title is ${video.durationSeconds}`);
  39.   })
  40.   .catch(console.log);*/
  41.  
  42.   client.user.setActivity('!help', { type: 'PLAYING' })
  43.  
  44.   if (message.author == client.user) { // Prevent bot from responding to its own messages
  45.     return
  46.   }
  47.  
  48.     /*if (message.author.username=='raccoon') {
  49.       deleteCommand(arguments, message)
  50.     }*/
  51.  
  52.     //Killer Queen First Bomb Deleting / Message Detection
  53.     if (bomb == 1) {
  54.         console.log("First Bomb Active")
  55.  
  56.       if (message.author.username.toLowerCase() == (name.toLowerCase())) {
  57.       kqueenAuthor = message.author.username
  58.       kqueenMessage = message.content
  59.           message.delete()
  60.       bomb = 0
  61.       console.log("Message: " + kqueenMessage)
  62.           console.log("First Bomb Disabled")
  63.       }
  64.   }
  65.  
  66.     //Bites the Dust
  67.     if (btdRec == 1) {
  68.         msgArray.push(message.content);
  69.         userArray.push(message.author.username);
  70.         timeArray.push(message.createdTimestamp);
  71.     }
  72.  
  73.   //Console Log
  74.   /*if (consoleLog == 1)
  75.   {
  76.     console.log(message)
  77.     message.attachments.array()
  78.     message.channel.send(attachments[0])
  79.     message.channel.send(message.attachments.toString())
  80.   }*/
  81.  
  82.     if (message.content.startsWith("!")) {
  83.         processCommand(message)
  84.     }
  85. })
  86.  
  87. function processCommand(message){
  88.     let fullCommand = message.content.substr(1) // Remove the leading exclamation mark
  89.     let splitCommand = fullCommand.split(" ") // Split the message up in to pieces for each space
  90.     let primaryCommand = splitCommand[0] // The first word directly after the exclamation is the command
  91.     let arguments = splitCommand.slice(1) // All other words are arguments/parameters/options for the command
  92.  
  93.     console.log("Command received: " + primaryCommand)
  94.     console.log("From: " + message.author.username)
  95.     console.log("Arguments: " + arguments)
  96.     console.log()
  97.  
  98.     if (primaryCommand.toLowerCase() == "help" || primaryCommand.toLowerCase() == "commands") {
  99.     helpCommand(arguments, message)
  100.     } else if (primaryCommand.toLowerCase() == "vore") {
  101.         voreCommand(arguments, message)
  102.     } else if (primaryCommand.toLowerCase() == "64") {
  103.         avgnCommand(arguments, message)
  104.     } else if (primaryCommand.toLowerCase() == "rmeme") {
  105.         rmemeCommand(arguments, message)
  106.     } else if (primaryCommand.toLowerCase() == "theworld" || primaryCommand.toLowerCase() == "zw" || primaryCommand.toLowerCase() == "zawarudo" || primaryCommand.toLowerCase() == "tw") {
  107.         theworldCommand(arguments, message)
  108.     } else if (primaryCommand.toLowerCase() == "yes") {
  109.         yesCommand(arguments, message)
  110.     } else if (primaryCommand.toLowerCase() == "no") {
  111.         noCommand(arguments, message)
  112.     } else if (primaryCommand.toLowerCase() == "thehand" || primaryCommand.toLowerCase() == "zahando" || primaryCommand.toLowerCase() == "th" || primaryCommand.toLowerCase() == "zh") {
  113.         thehandCommand(arguments, message)
  114.     } else if (primaryCommand.toLowerCase() == "killerqueen" || primaryCommand.toLowerCase() == "kq") {
  115.         killerqueenCommand(arguments, message)
  116.     } else if (primaryCommand.toLowerCase() == "btd" || primaryCommand.toLowerCase() == "bitesthedust") {
  117.         btdCommand(arguments, message)
  118.     } else if (primaryCommand.toLowerCase() == "btdend" || primaryCommand.toLowerCase() == "bitesthedustend") {
  119.         btdEndCommand(arguments, message)
  120.     } else if (primaryCommand.toLowerCase() == "info") {
  121.         infoCommand(arguments, message)
  122.     } else if (primaryCommand.toLowerCase() == "doof") {
  123.         doofCommand(arguments, message)
  124.     } else if (primaryCommand.toLowerCase() == "console") {
  125.         consoleCommand(arguments, message)
  126.     } else if (primaryCommand.toLowerCase() == "consoleoff") {
  127.         consoleOffCommand(arguments, message)
  128.     } else if (primaryCommand.toLowerCase() == "command") {
  129.     testCommand(arguments, message)
  130.   } else if (primaryCommand.toLowerCase() == "command2") {
  131.     test2Command(arguments, message)
  132.   } else if (primaryCommand.toLowerCase() == "command3") {
  133.     test3(arguments, message)
  134.   } else if (primaryCommand.toLowerCase() == "standattack" || primaryCommand.toLowerCase() == "standa") {
  135.     standAttackCommand(arguments, message, primaryCommand)
  136.   } else if (primaryCommand.toLowerCase() == "standhealth" || primaryCommand.toLowerCase() == "standh") {
  137.     standHealthCommand(arguments, message)
  138.   } else if (primaryCommand.toLowerCase() == "standenable" || primaryCommand.toLowerCase() == "standstart") {
  139.     standStartCommand(arguments, message)
  140.   } else if (primaryCommand.toLowerCase() == "standdisable" || primaryCommand.toLowerCase() == "standstop") {
  141.     standStopCommand(arguments, message)
  142.   } else if (primaryCommand.toLowerCase() == "stand" || primaryCommand.toLowerCase() == "standhelp") {
  143.     standHelpCommand(arguments, message)
  144.   } else if (primaryCommand.toLowerCase() == "crazydiamond" || primaryCommand.toLowerCase() == "crazyd" || primaryCommand.toLowerCase() == "cd") {
  145.     crazyDiamondCommand(arguments, message)
  146.   } else if (primaryCommand.toLowerCase() == "icon" || primaryCommand.toLowerCase() == "avatar") {
  147.     iconCommand(arguments, message)
  148.   } else if (primaryCommand.toLowerCase() == "google" || primaryCommand.toLowerCase() == "g") {
  149.     googleCommand(arguments, message)
  150.   } else if (primaryCommand.toLowerCase() == "ttt" || primaryCommand.toLowerCase() == "tictactoe") {
  151.     ticTacToeCommand(arguments, message)
  152.   } else if (primaryCommand.toLowerCase() == "monokumadance" || primaryCommand.toLowerCase() == "monodance" || primaryCommand.toLowerCase() == "md") {
  153.     monokumaDanceCommand(arguments, message)
  154.   } else if (primaryCommand.toLowerCase() == "punishment" || primaryCommand.toLowerCase() == "punishmenttime" || primaryCommand.toLowerCase() == "monokumapunishment" || primaryCommand.toLowerCase() == "monopunish" || primaryCommand.toLowerCase() == "mkpt" || primaryCommand.toLowerCase() == "pt" || primaryCommand.toLowerCase() == "mp") {
  155.     monokumaPunishmentCommand(arguments, message)
  156.   } else if (primaryCommand.toLowerCase() == "counter" || primaryCommand.toLowerCase() == "wrong") {
  157.     counterCommand(arguments, message)
  158.   } else if (primaryCommand.toLowerCase() == "consent" || primaryCommand.toLowerCase() == "agree" || primaryCommand.toLowerCase() == "right") {
  159.     consentCommand(arguments, message)
  160.   } else if (primaryCommand.toLowerCase() == "play" || primaryCommand.toLowerCase() == "p") {
  161.     playCommand(arguments, message)
  162.   } else if (primaryCommand.toLowerCase() == "playfile" || primaryCommand.toLowerCase() == "p") {
  163.     playCommand(arguments, message, primaryCommand)
  164.   } else if (primaryCommand.toLowerCase() == "skip" || primaryCommand.toLowerCase() == "s") {
  165.     playCommand(arguments, message, primaryCommand)
  166.   } else if (primaryCommand.toLowerCase() == "stop" || primaryCommand.toLowerCase() == "s") {
  167.     playCommand(arguments, message, primaryCommand)
  168.   } else if (primaryCommand.toLowerCase() == "pause" || primaryCommand.toLowerCase() == "pa") {
  169.     playCommand(arguments, message, primaryCommand)
  170.   } else if (primaryCommand.toLowerCase() == "resume" || primaryCommand.toLowerCase() == "r") {
  171.     playCommand(arguments, message, primaryCommand)
  172.   } else if (primaryCommand.toLowerCase() == "volume" || primaryCommand.toLowerCase() == "v") {
  173.     playCommand(arguments, message, primaryCommand)
  174.   } else if (primaryCommand.toLowerCase() == "queue" || primaryCommand.toLowerCase() == "v") {
  175.     playCommand(arguments, message, primaryCommand)
  176.   } else if (primaryCommand.toLowerCase() == "image" || primaryCommand.toLowerCase() == "imagesearch") {
  177.     imageCommand(arguments, message)
  178.   } else if (primaryCommand.toLowerCase() == "boss" || primaryCommand.toLowerCase() == "rboss") {
  179.     bossCommand(arguments, message)
  180.   } else if (primaryCommand.toLowerCase() == "ss" || primaryCommand.toLowerCase() == "screenshare") {
  181.     ssCommand(arguments, message)
  182.   } else if (primaryCommand.toLowerCase() == "flip" || primaryCommand.toLowerCase() == "mirror") {
  183.     flipCommand(arguments, message)
  184.   } else if (primaryCommand.toLowerCase() == "btd2" || primaryCommand.toLowerCase() == "btdtwo") {
  185.     btd2Command(arguments, message)
  186.   }
  187.       else {
  188.         //message.channel.send("YOU BUMBLING IDIOT, TYPE THAT SHIT AGAIN")
  189.         message.channel.send("Use `!help` for usable commands!")
  190.     }
  191. }
  192.  
  193. function helpCommand(arguments, message){
  194.   helpArg = arguments[0]
  195.  
  196.   if (arguments.length == 0)
  197.     message.channel.send("**Usage: ** *!help <section>*\nAvailable sections:\n**Music\nUtility\nReactions\nJoJo\nMemes**")
  198.     //message.channel.send("Available commands:\n**Stand / StandHelp\nZAWARUDO / THEWORLD\nZAHANDO / THEHAND\nKillerQueen\nCrazyDiamond / CrazyD\nBTD / BitesTheDust **&** BTDEND / BitesTheDustEnd\nGoogle\nYes\nNo\nCounter\nMonokumaDance\nPunishmentTime\nIcon\nVore\n64\nRMeme\nDoof\nInfo**")
  199.  
  200.   else if (arguments.length > 1)
  201.     message.channel.send("To see a list of commands, use `!help`. For help with a specific command, use `!help <command>`.")
  202.  
  203.   else if (helpArg.toLowerCase() == "music" || helpArg.toLowerCase() == "musiccommands" || helpArg.toLowerCase() == "musichelp") {
  204.     message.channel.send("Music Commands:\n**Play\nVolume\nPause **&** Resume\nStop\nSkip\nQueue**")
  205.   }
  206.   else if (helpArg.toLowerCase() == "utility" || helpArg.toLowerCase() == "utilitycommands" || helpArg.toLowerCase() == "utilityhelp") {
  207.     message.channel.send("Utility Commands:\n**Google\nIcon\nFlip\nInfo\nSS / ScreenShare**")
  208.   }
  209.   else if (helpArg.toLowerCase() == "reactions" || helpArg.toLowerCase() == "reactioncommands" || helpArg.toLowerCase() == "reactionscommands" || helpArg.toLowerCase() == "reactionshelp" || helpArg.toLowerCase() == "reactionhelp") {
  210.     message.channel.send("Reaction Commands:\n**Yes\nNo\nCounter\nConsent\nMonokumaDance\nPunishmentTime / Punishment**")
  211.   }
  212.   else if (helpArg.toLowerCase() == "jojo" || helpArg.toLowerCase() == "jojocommands" || helpArg.toLowerCase() == "jojohelp") {
  213.     message.channel.send("JoJo Commands:\n**Stand / StandHelp\nZAWARUDO / THEWORLD\nZAHANDO / THEHAND\nKillerQueen\nCrazyDiamond / CrazyD\nBTD / BitesTheDust **&** BTDEND / BitesTheDustEnd**")
  214.   }
  215.   else if (helpArg.toLowerCase() == "memes" || helpArg.toLowerCase() == "meme" || helpArg.toLowerCase() == "memecommands" || helpArg.toLowerCase() == "memehelp") {
  216.     message.channel.send("Meme Commands:\n**RMeme\nBoss\nVore\n64\nDoof**")
  217.   }
  218.  
  219.   //Sections â–² | Commands â–¼
  220.  
  221.   else if (helpArg.toLowerCase() == "rmeme") {
  222.     message.channel.send("**RMeme Usage:**\n`!RMeme` - Sends a random meme\n`!RMeme Count` - Shows the number of memes in the set")
  223.   }
  224.   else if (helpArg.toLowerCase() == "boss") {
  225.     message.channel.send("**Boss Usage:**\n`!Boss` - Summons a random boss (Not currently fightable)\n`!Boss Count` - Shows the number of possible bosses")
  226.   }
  227.   else if (helpArg.toLowerCase() == "thehand" || helpArg.toLowerCase() == "zahando" || helpArg.toLowerCase() == "th" || helpArg.toLowerCase() == "zh") {
  228.     message.channel.send("**THEHAND Usage:**\n`!TheHand` / `ZaHando` - Deletes !THEHAND message")
  229.   }
  230.   else if (helpArg.toLowerCase() == "killerqueen" || helpArg.toLowerCase() == "kq") {
  231.     message.channel.send("**KillerQueen Usage:**\n`!KillerQueen <Username>` - Deletes \"Username\"s next message")
  232.   }
  233.   else if (helpArg.toLowerCase() == "crazydiamond" || helpArg.toLowerCase() == "crazyd" || helpArg.toLowerCase() == "cd") {
  234.     message.channel.send("**CrazyDiamond Usage:**\n`!CrazyDiamond` / `!CrazyD` - Restores deleted message from !killerqueen")
  235.   }
  236.   else if (helpArg.toLowerCase() == "btd" || helpArg.toLowerCase() == "bitesthedust" || helpArg.toLowerCase() == "btdend" || helpArg.toLowerCase() == "bitesthedustend") {
  237.     message.channel.send("**BitesTheDust Usage:**\n`!BitesTheDust` / `!BTD` - Deploys Bites the Dust & starts recording messages\n`!BitesTheDustEnd` / `!BTDEnd` - Activates / Disables Bites the Dust & relays recorded messages")
  238.   }
  239.   else if (helpArg.toLowerCase() == "theworld" || helpArg.toLowerCase() == "zawarudo" || helpArg.toLowerCase() == "tw" || helpArg.toLowerCase() == "zw") {
  240.     message.channel.send("**ZAWARUDO Usage:**\n`!ZaWarudo` / `!TheWorld` - Freezes time for ten seconds in current channel")
  241.   }
  242.  
  243.   else {
  244.     message.channel.send("No help found for `!" + arguments[0] + "`!")
  245.   }
  246. }
  247.  
  248. function testCommand(arguments, message){
  249.   var fs = require("fs");
  250.   var poem = fs.readFileSync("C:\\Users\\carto\\Desktop\\url.txt", {"encoding": "utf-8"});
  251.   console.log(poem)
  252.   //embedConst.setImage(poem)
  253.   poem = poem.split('\n'[0]);
  254.   message.channel.send(poem[2]);
  255. }
  256.  
  257. async function test2Command(arguments, message){
  258.   const canvas = Canvas.createCanvas(700, 250);
  259.   const ctx = canvas.getContext('2d');
  260.   const background = await Canvas.loadImage('C:\\Users\\carto\\Desktop\\MickBot\\wallpaper.jpg');
  261.     ctx.drawImage(background, 0, 0, canvas.width, canvas.height);
  262.  
  263.     ctx.strokeStyle = '#74037b';
  264.   ctx.strokeRect(0, 0, canvas.width, canvas.height);
  265.   var member= message.mentions.users.first();
  266.   // Wait for Canvas to load the image
  267.     const avatar = await Canvas.loadImage(member.avatarURL);
  268.     // Draw a shape onto the main canvas
  269.     ctx.drawImage(avatar, 25, 0, 200, canvas.height);
  270.  
  271.   const attachment = new Discord.Attachment(canvas.toBuffer(), 'welcome-image.png');
  272.   message.channel.send(attachment)
  273. }
  274.  
  275. function test3(arguments, message){
  276.   Jimp.read('wallpaper.jpg')
  277.   .then(lenna => {
  278.     return lenna
  279.       .resize(256, 256) // resize
  280.       .quality(60) // set JPEG quality
  281.       .greyscale() // set greyscale
  282.       .write('lena-small-bw.jpg'); // save
  283.      
  284.   })
  285.   const localFileAttachment = new Discord.Attachment('C:\\Users\\carto\\Desktop\\MickBot\\lena-small-bw.jpg')
  286.       message.channel.send(localFileAttachment)
  287.   .catch(err => {
  288.     console.error(err);
  289.   });
  290. }
  291.  
  292. function flipCommand(arguments, message){
  293.   if (arguments.length != 1) {
  294.     message.channel.send("To use `!flip`, specify either `!flip h` or `!flip v` for horizontal or vertical, Or use `!flip hv` for both!")
  295.     return
  296.   }
  297.  
  298.   if (arguments[0] == "h") {
  299.     Jimp.read('https://cdn.discordapp.com/avatars/' + message.author.id + '/' + message.author.avatar + '.png?size=2048', (err, jimpimage) => {
  300.       if (err) throw err;
  301.       jimpimage
  302.         .flip(true, false)
  303.         .write('pfp.png')
  304.         const localFileAttachment = new Discord.Attachment('C:\\Users\\carto\\Desktop\\MickBot\\pfp.png')
  305.         message.channel.send(localFileAttachment)
  306.      });
  307.      return
  308.   }
  309.  
  310.   if (arguments[0] == "v") {
  311.     Jimp.read('https://cdn.discordapp.com/avatars/' + message.author.id + '/' + message.author.avatar + '.png?size=2048', (err, jimpimage) => {
  312.       if (err) throw err;
  313.       jimpimage
  314.         .flip(false, true)
  315.         .write('pfp.png')
  316.         const localFileAttachment = new Discord.Attachment('C:\\Users\\carto\\Desktop\\MickBot\\pfp.png')
  317.         message.channel.send(localFileAttachment)
  318.      });
  319.      return
  320.   }
  321.  
  322.   if (arguments[0] == "hv" || arguments[0] == "vh") {
  323.     Jimp.read('https://cdn.discordapp.com/avatars/' + message.author.id + '/' + message.author.avatar + '.png?size=2048', (err, jimpimage) => {
  324.       if (err) throw err;
  325.       jimpimage
  326.         .flip(true, true)
  327.         .write('pfp.png')
  328.         const localFileAttachment = new Discord.Attachment('C:\\Users\\carto\\Desktop\\MickBot\\pfp.png')
  329.         message.channel.send(localFileAttachment)
  330.      });
  331.      return
  332.   }
  333.  
  334.   message.channel.send("To use `!flip`, specify either `!flip h` or `!flip v` for horizontal or vertical, Or use `!flip hv` for both!")
  335. }
  336.  
  337. function iconCommand(arguments, message){
  338.   if (arguments.length == 0) {                       //? Technically Unnecessary. Deprecated by .avatarURL
  339.     embedConst.setImage('https://cdn.discordapp.com/avatars/' + message.author.id + '/' + message.author.avatar + '.png?size=2048')
  340.     message.channel.send(embedConst);
  341.   }
  342.   else if (arguments.length == 1) {                 //Icon Grabber
  343.     var member= message.mentions.users.first();
  344.     embedConst.setImage(member.avatarURL)
  345.     message.channel.send(embedConst);
  346.   }
  347. }
  348.  
  349. function ssCommand(arguments, message){
  350.   try {
  351.     message.channel.send("<https://discordapp.com/channels/" + message.guild.id + "/" + message.member.voiceChannel.id + ">")
  352.   }
  353.   catch {
  354.     message.channel.send("Join a voice channel to use `!screenshare`!")
  355.     console.log("User not in Voice Channel")
  356.   }
  357. }
  358.  
  359. function imageCommand(arguments, message){
  360.   /*gclient.search('Steam', {num: 1})
  361.     .then(images => {
  362.       console.log(images)
  363.     })*/
  364.  
  365.     GoogleImageSearch.searchImage("cats")
  366.       .then((res) => {
  367.         console.log(res); // This will return array of image URLs
  368.       })
  369. }
  370.  
  371. function youtubeCommand(arguments, message){
  372.   const youtube = new YouTube("AIzaSyBULJSphU2oBYESNfJfKEYxDgdOaFnVUTY");
  373.  
  374.   //const video1 = youtube.getVideo("https://www.youtube.com/watch?v=5NPBIwQyPWE");
  375.   console.log(video1)
  376. }
  377.  
  378. function playCommand(arguments, message, primaryCommand){
  379.   if (message.channel.type =='dm') {
  380.     message.channel.send("Use `!play` in a server voice channel to play music!")
  381.     return
  382.   }
  383.   if (primaryCommand == "pause" || primaryCommand == "resume" || primaryCommand == "stop" || primaryCommand == "queue" || primaryCommand == "volume" || primaryCommand == "skip" || primaryCommand == "playfile")
  384.     console.log("Registered " + primaryCommand)
  385.   else if (arguments.length == 0 || arguments.length < 1) {
  386.     message.channel.send("**Usage:** `!play <youtube url>`")
  387.     return
  388.   }
  389.  
  390.   if (primaryCommand == "pause" && playing) {
  391.     dispatcher.pause()
  392.     console.log("Paused")
  393.     return
  394.   }
  395.  
  396.   if (primaryCommand == "resume" && playing) {
  397.     dispatcher.resume()
  398.     console.log("Resumed")
  399.     return
  400.   }
  401.  
  402.   if (primaryCommand == "stop" && playing && !qPlaying) {
  403.     //activeVoiceChannel.leave()
  404.     console.log("Stopped")
  405.     if (queue.length > 0) {
  406.       queue.length = 0
  407.     }
  408.     dispatcher.end()
  409.     return
  410.   }
  411.  
  412.   if (primaryCommand == "stop" && playing && qPlaying) {
  413.     //queue = [];
  414.     queue.length = 0
  415.     dispatcher.end()
  416.     return
  417.   }
  418.  
  419.   if (primaryCommand == "stop" && playing == false) {
  420.     message.channel.send("Use `!stop` while the bot is already playing something with `!play`!")
  421.     return
  422.   }
  423.  
  424.   if (primaryCommand == "volume" && playing) {
  425.     if (arguments.length > 1) {
  426.       message.channel.send("**Usage:** `!volume <1-100>`")
  427.       return
  428.     }
  429.     else if (arguments.length == 0) {
  430.       message.channel.send("Current Volume is: " + (dispatcher.volume * 100) + "%")
  431.       return
  432.     }
  433.  
  434.     if (arguments[0] >= 100) {
  435.       dispatcher.setVolume(1)
  436.       message.channel.send("Volume: " + 100 + "%")
  437.       return
  438.     }
  439.     else
  440.       dispatcher.setVolume((arguments[0]/100))
  441.     console.log("Volume: " + arguments[0])
  442.     message.channel.send("Volume: " + (arguments[0] + "%"))
  443.     return
  444.   }
  445.  
  446.   if (primaryCommand == "volume" && playing == false) {
  447.     message.channel.send("Use `!play <youtube url>` while in a voice channel first!")
  448.     return
  449.   }
  450.  
  451.   if (primaryCommand == "skip" && queue.length > 0) {
  452.     dispatcher.end()
  453.     //activeVoiceChannel.leave()
  454.     console.log("Skipped")
  455.     return
  456.   }
  457.  
  458.   /*if (primaryCommand == "playfile" && !playing) {
  459.     console.log("Playing File")
  460.     activeVoiceChannel.join()
  461.     .then(connection => {
  462.  
  463.       dispatcher = connection.playFile('C:\\Users\\carto\\Desktop\\MickBot\\PlayFile\\' + arguments[0] + '.wav');
  464.       dispatcher.setVolume(.5)
  465.       playfile = true
  466.       playing = true
  467.       console.log("Playing = True")
  468.  
  469.       dispatcher.on("end", end => {
  470.         activeVoiceChannel.leave()
  471.         console.log("Playing = False")
  472.         playfile = false
  473.         playing = false
  474.         return
  475.       })
  476.     })
  477.   }*/
  478.  
  479.   if (primaryCommand == "queue") {
  480.     console.log("Queue URLs:")
  481.     for (var qloop = 0; qloop < queue.length; qloop++) {
  482.       console.log(queue[qloop])
  483.     }
  484.     if (queue.length > 0) {
  485.       message.channel.send("There are currently " + queue.length + ' videos in the queue!')
  486.  
  487.       queueString = ""
  488.  
  489.       for (var queueCLoop = 0; queueCLoop < queue.length; queueCLoop++) {
  490.         queueString += (title[queueCLoop] + "\n")
  491.       }
  492.       console.log(queueString)
  493.       message.channel.send(queueString)
  494.     }
  495.     else
  496.       message.channel.send("There is no current queue! Start one by playing a video while one is already playing!")
  497.     return
  498.   }
  499.  
  500.   var videoSearchTerm = arguments[0]
  501.   var videoTerms = "";
  502.  
  503.   for (var vidloop=0; vidloop<arguments.length; vidloop++) {
  504.     videoTerms += (arguments[vidloop] + " ")
  505.   }
  506.  
  507.   var activeVoiceChannel = message.member.voiceChannel;
  508.   if (!activeVoiceChannel)
  509.       return message.reply("Join a voice channel to play music!")
  510.  
  511.   if (playing) {
  512.     youtube.searchVideos(videoTerms, 1)
  513.       .then(results => {
  514.         queue.push(results[0].url)
  515.         qtitle.push(results[0].title)
  516.         qdescription.push(results[0].description)
  517.         qchanneltitle.push(results[0].channel.title)
  518.         qid.push(results[0].id)
  519.         qtime.push(results[0].durationSeconds)
  520.         return
  521.       })
  522.     return
  523.   }
  524.   //if (playfile == false){
  525.     activeVoiceChannel.join()
  526.       .then(connection => {
  527.         //PLAYS FILE //const dispatcher = connection.playFile('C:\\Users\\carto\\Desktop\\Misc\\shanties.mp3');
  528.      
  529.         if (!playing)
  530.           youtube.searchVideos(videoTerms, 1)
  531.             .then(results => {
  532.               var resultURL = results[0].url
  533.               dispatcher = connection.playStream(ytdl(resultURL,{filter:"audioonly"}));
  534.               dispatcher.setVolume(.35)
  535.               playing = true
  536.               console.log("Playing = True")
  537.               var title = results[0].title
  538.               console.log(results)
  539.               title = title.replace(/&#39;/g, "'")
  540.               title = title.replace(/&quot;/g, "\"")
  541.               console.log("Now Playing: " + title)
  542.  
  543.               const vidEmbed = new Discord.RichEmbed()
  544.               if (results[0].description == '')
  545.                 results[0].description = '`No Description`'
  546.               vidEmbed.setColor('#FF0000')
  547.               vidEmbed.setAuthor("Now playing:"/*, 'https://cdn.discordapp.com/attachments/596928630009888781/611165926695632916/YTLOGO.png'*/)
  548.               vidEmbed.addField(results[0].channel.title, results[0].description)
  549.               vidEmbed.setFooter('', 'https://i.imgur.com/wSTFkRM.png');
  550.               vidEmbed.setTitle(title)
  551.               vidEmbed.setURL(resultURL)
  552.               vidEmbed.setImage('https://img.youtube.com/vi/' + results[0].id + '/maxresdefault.jpg')
  553.               message.channel.send(vidEmbed);
  554.              
  555.               dispatcher.on("end", end => {
  556.                 if (queue.length > 0) {
  557.                   queueCommand(arguments, message, queue, results)
  558.                   return
  559.                 }
  560.                 activeVoiceChannel.leave()
  561.                 console.log("Playing = False")
  562.                 playing = false
  563.               });
  564.             })
  565.         //client.user.setActivity('Playing Music!')
  566.         })
  567.         .catch(console.error);
  568. }
  569. //}
  570.  
  571. function queueCommand(arguments, message, queue, results){
  572.   console.log("Started queue")
  573.   qPlaying = true
  574.   var activeVoiceChannel = message.member.voiceChannel;
  575.   /*activeVoiceChannel.leave()*/
  576.   activeVoiceChannel.join()
  577.       .then(connection => {
  578.  
  579.         dispatcher = connection.playStream(ytdl(queue[0], {filter: "audioonly"}));
  580.         dispatcher.setVolume(.35)
  581.         playing = true
  582.         console.log("Playing = True")
  583.  
  584.         var title = qtitle[0]
  585.         title = title.replace(/&#39;/g, "'")
  586.         title = title.replace(/&quot;/g, "\"")
  587.         console.log("Now Playing: " + title)
  588.  
  589.         const vidEmbed = new Discord.RichEmbed()
  590.         if (results[0].description == '')
  591.           results[0].description = '`No Description`'
  592.         vidEmbed.setColor('#FF0000')
  593.         vidEmbed.setAuthor("Now playing:"/*, 'https://cdn.discordapp.com/attachments/596928630009888781/611165926695632916/YTLOGO.png'*/)
  594.         vidEmbed.addField(qchanneltitle[0], qdescription[0])
  595.         vidEmbed.setFooter('', 'https://i.imgur.com/wSTFkRM.png');
  596.         vidEmbed.setTitle(title)
  597.         vidEmbed.setURL(queue[0])
  598.         vidEmbed.setImage('https://img.youtube.com/vi/' + qid[0] + '/maxresdefault.jpg')
  599.         message.channel.send(vidEmbed);
  600.  
  601.         queue.shift()
  602.         qtitle.shift()
  603.         qdescription.shift()
  604.         qchanneltitle.shift()
  605.         qid.shift()
  606.  
  607.         dispatcher.on("end", end => {
  608.           playing = false
  609.           if (queue.length > 0)
  610.             queueCommand(arguments, message, queue, results)
  611.           else {
  612.             activeVoiceChannel.leave()
  613.             qPlaying = false
  614.           }
  615.         })
  616.       })
  617. }
  618.  
  619. function stopCommand(arguments, message){
  620.   dispatcher.on("end", end => {activeVoiceChannel.leave()});
  621. }
  622.  
  623. function ticTacToeCommand(arguments, message){
  624.   var board = [
  625.     ["", "", ""],
  626.     ["", "", ""],
  627.     ["", "", ""]
  628.   ];
  629.   var winner = 2;
  630.   var c = 1;
  631.   var player;
  632.  
  633.   for(var setx=0; setx<board.length; setx++)
  634.             for(var sety=0; sety<board.length; sety++)
  635.         board[setx][sety]="[" + setx+1 + "]";
  636.  
  637.   printBoard(board, message)
  638.  
  639.   //while (winner == 2) {
  640.     if (c == 10) {
  641.       message.channel.send("GAME OVER: TIE")
  642.       return; //! COULD CAUSE PROBLEMS, CHANGE TO break;
  643.     }
  644.  
  645.     if (c % 2 == 0)
  646.       player = "[X]"
  647.     else
  648.       player = "[O]"
  649.  
  650.     message.channel.send("Choose X Coordinate, " + player + ": ")
  651.  
  652.     message.react('1⃣').then(() => message.react('2⃣')).then(() => message.react('3⃣')).then(() => message.react('4⃣')).then(() => message.react('5⃣')).then(() => message.react('6⃣')).then(() => message.react('7⃣')).then(() => message.react('8⃣')).then(() => message.react('9⃣'));
  653.  
  654.     const filter = (reaction, user) => {
  655.         return ['1⃣', '2⃣', '3⃣', '4⃣', '5⃣', '6⃣', '7⃣', '8⃣', '9⃣'].includes(reaction.emoji.name) && user.id === message.author.id;
  656.     };
  657.  
  658.     message.awaitReactions(filter, { max: 1, time: 60000, errors: ['time'] })
  659.         .then(collected => {
  660.         const reaction = collected.first();
  661.  
  662.         if (reaction.emoji.name === '1⃣') {
  663.               message.reply('1');
  664.         } else if (reaction.emoji.name === '2⃣') {
  665.               message.reply('2');
  666.     } else if (reaction.emoji.name === '3⃣') {
  667.               message.reply('3');
  668.     } else if (reaction.emoji.name === '4⃣') {
  669.               message.reply('4');
  670.     } else if (reaction.emoji.name === '5⃣') {
  671.               message.reply('5');
  672.     } else if (reaction.emoji.name === '6⃣') {
  673.               message.reply('6');
  674.     } else if (reaction.emoji.name === '7⃣') {
  675.             message.reply('7');
  676.     } else if (reaction.emoji.name === '8⃣') {
  677.             message.reply('8');
  678.     } else
  679.         message.reply('9')
  680.    
  681.     })
  682.       .catch(collected => {
  683.           message.reply('Timeout! React with one of the numbers!');
  684.     });
  685.   }
  686. //}
  687.  
  688. function printBoard(board, message){
  689.   var boardMsg = "";
  690.  
  691.   for(var boardloop=0; boardloop<9; boardloop++) {
  692.       boardMsg += "[" + (boardloop+1) +"]"
  693.       if (boardloop == 2 || boardloop == 5 || boardloop == 8)
  694.         boardMsg += "\n"
  695.   }
  696.   message.channel.send(boardMsg)
  697. }
  698.  
  699. function googleCommand(arguments, message){
  700.   if (arguments.length == 1)
  701.     message.channel.send("https://www.google.com/search?q=" + arguments[0])
  702.  
  703.   else if (arguments.length > 1) {
  704.     var searchString = arguments[0]
  705.     for(gloop = 1; gloop < arguments.length; gloop++) {
  706.       searchString += "+" + arguments[gloop]
  707.     }
  708.  
  709.     message.channel.send("https://www.google.com/search?q=" + searchString)
  710.   }
  711.  
  712.   else
  713.     message.channel.send("No Search Term detected! **Usage:** *!google* <Search Term>")
  714. }
  715.  
  716. function monokumaDanceCommand(arguments, message){
  717.   var temp = Math.floor(Math.random() * 4)
  718.  
  719.   if (temp == 0) {
  720.     embedConst.setImage('https://cdn.discordapp.com/attachments/577297695635537930/596925824956104714/monodance0.gif')
  721.     message.channel.send(embedConst);
  722.   }
  723.   else if (temp == 1) {
  724.     embedConst.setImage('https://cdn.discordapp.com/attachments/577297695635537930/596926406303416331/monodance1.gif')
  725.     message.channel.send(embedConst);
  726.   }
  727.   else if (temp == 2) {
  728.     embedConst.setImage('https://cdn.discordapp.com/attachments/577297695635537930/596926457868189697/monodance2.gif')
  729.     message.channel.send(embedConst);
  730.   }
  731.   else if (temp == 3) {
  732.     embedConst.setImage('https://cdn.discordapp.com/attachments/577297695635537930/596926548381270020/monodance3.gif')
  733.     message.channel.send(embedConst);
  734.   }
  735. }
  736.  
  737. function monokumaPunishmentCommand(arguments, message){
  738.   var temp = Math.floor(Math.random() * 2)
  739.  
  740.   if (temp == 0) {
  741.     embedConst.setImage('https://cdn.discordapp.com/attachments/596928630009888781/596929024555745280/monopunishment0.gif')
  742.     message.channel.send(embedConst);
  743.   }
  744.   else if (temp == 1) {
  745.     embedConst.setImage('https://cdn.discordapp.com/attachments/596928630009888781/596929025906180108/monopunishment1.gif')
  746.     message.channel.send(embedConst);
  747.   }
  748. }
  749.  
  750. function counterCommand(arguments, message){
  751.   var temp = Math.floor(Math.random() * 3)
  752.  
  753.   if (temp == 0) {
  754.     embedConst.setImage('https://cdn.discordapp.com/attachments/596928630009888781/596930057843376141/counter0.gif')
  755.     message.channel.send(embedConst);
  756.   }
  757.   else if (temp == 1) {
  758.     embedConst.setImage('https://cdn.discordapp.com/attachments/596928630009888781/596930058027794432/counter1.gif')
  759.     message.channel.send(embedConst);
  760.   }
  761.   else if (temp == 2) {
  762.     embedConst.setImage('https://cdn.discordapp.com/attachments/596928630009888781/596930056245215242/counter2.gif')
  763.     message.channel.send(embedConst);
  764.   }
  765. }
  766.  
  767. function consentCommand(arguments, message){
  768.   embedConst.setImage('https://cdn.discordapp.com/attachments/578261342344183808/597119480837046285/agree0.gif')
  769.   message.channel.send(embedConst);
  770. }
  771.  
  772. function consoleCommand(arguments, message){
  773.   consoleLog = 1
  774. }
  775.  
  776. function consoleOffCommand(arguments, message){
  777.   consoleLog = 0
  778. }
  779.  
  780. function infoCommand(arguments, message){
  781.   if (message.channel.type == 'text')
  782.     message.channel.send('**User Information:**\nFrom: ' + message.author.username + '\nDiscriminator: ' + message.author.discriminator + '\nTimestamp: ' + message.createdAt + '\n\n**Server Information:**\nServer Name: ' + message.guild.name  + '\nChannel: ' + message.channel.name + '\nMember Count: ' + message.guild.memberCount)
  783.  
  784.   else if (message.channel.type =='dm')
  785.     message.channel.send('**User Information:**\nFrom: ' + message.author.username + '\nDiscriminator: ' + message.author.discriminator + '\nTimestamp: ' + message.createdAt)
  786.  
  787.     var argString = arguments[0]
  788.   if (argString == "console")
  789.       console.log(message)
  790. }
  791.  
  792. function doofCommand(arguments, message){
  793.     embedConst.setImage('https://cdn.discordapp.com/attachments/583598930219237385/593040956144615427/doof.gif')
  794.   message.channel.send(embedConst);
  795.  
  796.     setTimeout(function() {
  797.        message.channel.send("**MY NAME IS DOOF AND YOU'LL DO WHAT I SAY\nWOOP WOOP**")
  798.     }, 1000)
  799. }
  800.  
  801. function voreCommand(arguments, message){
  802.   //Provide a path to a local file
  803.   var temp = Math.floor(Math.random() * 2)
  804.   const localFileAttachment = new Discord.Attachment('C:\\Users\\carto\\Desktop\\MickBot\\Attachments\\Vore\\'+(temp)+'.png')
  805.   console.log("Image: " + temp)
  806.   console.log()
  807.   message.channel.send(localFileAttachment)
  808. }
  809.  
  810. function deleteCommand(arguments, message){
  811.   message.delete()
  812. }
  813.  
  814. function crazyDiamondCommand(arguments, message){
  815.   if (kqueenMessage == "79j2ViVMpFAn0B7B0rYpfYcMRwEm0tKLO") {
  816.     message.channel.send("There's nothing to fix! Use after KillerQueen's first bomb!")
  817.     return;
  818.   }
  819.  
  820.   else{
  821.       embedConst.setImage('https://cdn.discordapp.com/attachments/583598930219237385/592909008222945280/crazydiamond.gif')
  822.     message.channel.send(embedConst);
  823.  
  824.     setTimeout(function() {
  825.       message.channel.send(kqueenAuthor + ": " + kqueenMessage)
  826.       kqueenAuthor = "79j2ViVMpFAn0B7B0rYpfYcMRwEm0tKLO"
  827.       kqueenMessage = "79j2ViVMpFAn0B7B0rYpfYcMRwEm0tKLO"
  828.    }, 500)
  829.  
  830.   }
  831. }
  832.  
  833. function killerqueenCommand(arguments, message){
  834.     name = arguments[0]
  835.  
  836.   if (arguments.length == 1) {
  837.     message.channel.send("KILLER QUEEN, SAISHO NO BAKUDAN!")
  838.     message.channel.send(name.toUpperCase() + ", THE CHAT IS NOW A BOMB!")
  839.  
  840.       bomb = 1
  841.       console.log("Killer Queen Activated")
  842.   }
  843.     else
  844.         message.channel.send("Write a username to target!")
  845. }
  846.  
  847. function setDelay(){
  848.   setTimeout(function(){
  849.  
  850.       console.log("Timeout")
  851.  
  852.   }, 10000);
  853. }
  854.  
  855. function doofDelay(){
  856.   setTimeout(function(){
  857.  
  858.     message.channel.send("**MY NAME IS DOOF AND YOU'LL DO WHAT I SAY\nWOOP WOOP**")
  859.  
  860.   }, 500);
  861. }
  862.  
  863. function btdCommand(arguments, message){
  864.   bigArray = []
  865.   nestedArray = [3]
  866.  
  867.   bigArray.push(nestedArray)
  868.  
  869.   bigArray[0][0] = 5
  870.  
  871.   console.log(nestedArray)
  872.  
  873.  
  874.   /*nestedArray = []
  875.   nestedArray2 = []
  876.  
  877.   bigArray.push(nestedArray)
  878.   bigArray[0].push("message")
  879.   bigArray[0].push("Mickman")
  880.   bigArray[0].push(325345787)
  881.  
  882.   bigArray.push(nestedArray2)
  883.   bigArray[1].push("message2")
  884.   bigArray[1].push("KeZeio")
  885.   bigArray[1].push(864767467)*/
  886.  
  887.   for (var i=0; i<bigArray.length; i++) {
  888.     for (var j=0; j<nestedArray.length; j++) {
  889.       console.log(bigArray[i][j])
  890.     }
  891.   }
  892. }
  893.  
  894. function btd2Command(arguments, message){
  895.   bigArray = []
  896.  
  897.   bigArray.push([])
  898.  
  899.   console.log(bigArray)
  900.  
  901.   /*for (var i=0; i<bigArray.length; i++) {
  902.     for (var j=0; j<nestedArray.length; j++) {
  903.       console.log(bigArray[i][j])
  904.     }
  905.   }*/
  906. }
  907.  
  908. function thehandCommand(arguments, message){
  909.     embedConst.setImage('https://cdn.discordapp.com/attachments/583598930219237385/593041517908721664/thehand.png')
  910.   message.channel.send(embedConst);
  911.  
  912.   message.channel.send("**THE HAND!**")
  913.  
  914.   setTimeout(function(){
  915.     message.delete()
  916.   }, 3000)
  917. }
  918.  
  919. function yesCommand(arguments, message){
  920.     embedConst.setImage('https://cdn.discordapp.com/attachments/583598930219237385/593040972879757312/yes.gif')
  921.   message.channel.send(embedConst);
  922. }
  923.  
  924. function noCommand(arguments, message){
  925.     embedConst.setImage('https://cdn.discordapp.com/attachments/583598930219237385/593040982245638154/no.gif')
  926.   message.channel.send(embedConst);
  927. }
  928.  
  929. function theworldCommand(arguments, message){
  930.   if (message.channel.type =='dm') {
  931.     message.channel.send("To use `!THEWORLD`, send the command from a server text channel!")
  932.     return
  933.   }
  934.   let channel = message.channel
  935.   channel.overwritePermissions(channel.guild.defaultRole, { SEND_MESSAGES: false })
  936.  
  937.   message.channel.send("TIME HAS STOPPED.")
  938.  
  939.   embedConst.setImage('https://cdn.discordapp.com/attachments/583598930219237385/593045367306584095/theworld.gif')
  940.   message.channel.send(embedConst);
  941.  
  942.     setTimeout(function(){
  943.       message.channel.send("5 SECONDS HAVE PASSED.")
  944.       console.log("5 SECONDS HAVE PASSED.")
  945.     }, 5000);
  946.  
  947.     setTimeout(function(){
  948.       embedConst.setImage('https://cdn.discordapp.com/attachments/583598930219237385/593045400911347712/resume.gif')
  949.       message.channel.send(embedConst);
  950.      
  951.       message.channel.send("10 SECONDS HAVE PASSED.")
  952.       console.log("10 SECONDS HAVE PASSED.")
  953.  
  954.       message.channel.send("TIME HAS BEGUN TO MOVE AGAIN.")
  955.       channel.overwritePermissions(channel.guild.defaultRole, { SEND_MESSAGES: true })
  956.     }, 10000);
  957. }
  958.  
  959. function avgnCommand(arguments, message){
  960.   message.channel.send("https://www.youtube.com/watch?v=VUcI0p04XJw")
  961. }
  962.  
  963. function rmemeCommand(arguments, message){
  964.   //Returns number of images in album (Manual change)
  965.   rmemeArg = arguments[0]
  966.  
  967.   if (arguments.length == 1) {
  968.     if (rmemeArg.toLowerCase() == "count"|| rmemeArg.toLowerCase() == "number"|| rmemeArg.toLowerCase() == "amount"|| rmemeArg.toLowerCase() == "images")
  969.       message.channel.send("There are **20** images in the set")
  970.  
  971.     return;
  972.   }
  973.  
  974.   //Math.Random to choose number in album sequence
  975.   var temp = Math.floor(Math.random() * 20)
  976.   const localFileAttachment = new Discord.Attachment('C:\\Users\\carto\\Desktop\\MickBot\\Album\\'+(temp)+'.png')
  977.   console.log("Image: " + temp)
  978.   console.log()
  979.     message.channel.send(localFileAttachment)
  980. }
  981.  
  982. function bossCommand(arguments, message){
  983.   const bossEmbed = new Discord.RichEmbed()
  984.   //Returns number of images in album (Manual change)
  985.   bossArg = arguments[0]
  986.  
  987.   if (arguments.length == 1) {
  988.     if (bossArg.toLowerCase() == "count"|| bossArg.toLowerCase() == "number"|| bossArg.toLowerCase() == "amount"|| bossArg.toLowerCase() == "images")
  989.       message.channel.send("There are **33** bosses in the run")
  990.  
  991.     return;
  992.   }
  993.  
  994.   bossEmbed.setImage('https://cdn.discordapp.com/attachments/314246588891398144/603078260703625217/BossPS.png')
  995.   bossEmbed.setColor('#95287C')
  996.   message.channel.send(bossEmbed);
  997.   bossEmbed.setColor('#4F545C')
  998.  
  999.   //Math.Random to choose number in album sequence
  1000.   var temp = Math.floor(Math.random() * 38)
  1001.  
  1002.   var fs = require("fs");
  1003.   var bosstxt = fs.readFileSync("C:\\Users\\carto\\Desktop\\MickBot\\Boss Album\\"+(temp)+".txt", {"encoding": "utf-8"});
  1004.   var bosslink = bosstxt.split('\n'[0]);
  1005.   var bossinfo = bosstxt.split('\n'[0]);
  1006.   bossEmbed.setImage(bosslink[0])
  1007.   bossEmbed.setAuthor(bossinfo[2], bossinfo[6])
  1008.   bossEmbed.setDescription(bossinfo[4])
  1009.   message.channel.send(bossEmbed)
  1010.   //bossEmbed.setAuthor()
  1011.   //bossEmbed.setDescription()
  1012.  
  1013.   /*setTimeout(function() {
  1014.     var bossinfo = bosstxt.split('\n'[0]);
  1015.     message.channel.send(bossinfo[2]);
  1016.  }, 500)*/
  1017.  
  1018.   //const localFileAttachment = new Discord.Attachment('C:\\Users\\carto\\Desktop\\MickBot\\Boss Album\\'+(temp)+'.png')
  1019.   console.log("Boss: " + temp)
  1020.   console.log()
  1021.     //message.channel.send(localFileAttachment)
  1022. }
  1023.  
  1024. function standHelpCommand(arguments, message){
  1025.   message.channel.send("To start a Stand Battle, use `!StandStart`\nDuring the battle, use `!StandAttack <StandName>` or `!StandA <StandName>` to attack a targeted stand.\nTo see the current Stand Health, use `!StandHealth` or `!StandH`\nTo end a battle, use `!StandStop`");
  1026. }
  1027.  
  1028. function standStartCommand(arguments, message){
  1029.   if (standStart == 1) {
  1030.     message.channel.send("Stand Battle already in progress! Use `!StandStop` to finish the battle");
  1031.     return;
  1032.   }
  1033.  
  1034.   else {
  1035.     //Starts Stands, resets stats
  1036.     starPlatHealth = 1000;
  1037.     starPlatDamage = 50;
  1038.     starPlatBlock = 50;
  1039.     worldHealth = 1000;
  1040.     worldDamage = 50;
  1041.     worldBlock = 50;
  1042.     //standStart = 1
  1043.     turn = 1;
  1044.  
  1045.     if (player1 == "79j2ViVMpFAn0B7B0rYpfYcMRwEm0tKLO") {
  1046.       player1 = message.author.username;
  1047.       message.channel.send("Player 1: " + player1);
  1048.       return;
  1049.     }
  1050.  
  1051.     if (player1 != message.author.username) {
  1052.       player2 = message.author.username;
  1053.       message.channel.send("Player 2: " + player2);
  1054.       standStart = 1;
  1055.       message.channel.send("Stand Battle Started!");
  1056.       console.log("Stand Battle Started");
  1057.  
  1058.       var standtemp = Math.floor(Math.random() * 2);
  1059.  
  1060.       if (standtemp == 0) {
  1061.         message.channel.send("It's " + player1 + "'s turn first!'");
  1062.         turn = 1;
  1063.       }
  1064.  
  1065.       if (standtemp == 1) {
  1066.         message.channel.send("It's " + player2 + "'s turn first!'");
  1067.         turn = 2;
  1068.       }
  1069.       //standChooseCommand(arguments, message)
  1070.       //For loop for both players? More compact
  1071.     }
  1072.  
  1073.     else {
  1074.       message.channel.send("Player 1 already chosen!");
  1075.     }
  1076.   }
  1077. }
  1078.  
  1079. function standStopCommand(arguments, message){
  1080.   //Stops Stands
  1081.   if (standStart == 0) {
  1082.     message.channel.send("There is no Stand Battle in progress! Start one with `!StandStart`!");
  1083.     return;
  1084.   }
  1085.  
  1086.   message.channel.send("STAR PLATINUM FINAL HEATH: " + starPlatHealth + "\nTHE WORLD FINAL HEALTH: " + worldHealth);
  1087.  
  1088.   standStart = 0;
  1089.   player1 = "79j2ViVMpFAn0B7B0rYpfYcMRwEm0tKLO";
  1090.   player2 = "79j2ViVMpFAn0B7B0rYpfYcMRwEm0tKLO";
  1091.   message.channel.send("Stand Battle Ended!");
  1092. }
  1093.  
  1094. function standHealthCommand(arguments, message){
  1095.   if (standStart == 1)
  1096.     message.channel.send("Current health of THE WORLD is: " + worldHealth + "\nCurrent health of STAR PLATINUM is: " + starPlatHealth);
  1097.   else
  1098.     message.channel.send("There is no Stand Battle in progress! Start one with `!StandStart`!");
  1099. }
  1100.  
  1101. function standAttackCommand(arguments, message, primaryCommand) {
  1102.   if (standStart == 1) {
  1103.     if (arguments.length == 1) {
  1104.       if (turn % 2 == 1) { //If player 1's turn
  1105.         console.log("Player 1's Turn");
  1106.       }
  1107.  
  1108.       var standName = arguments[0];
  1109.       if (standName.toLowerCase() == "starplat" || standName.toLowerCase() == "starplatinum" || standName.toLowerCase() == "starp") {
  1110.         message.channel.send("THE WORLD dealt " + worldDamage + " damage\nBut STAR PLATINUM blocked " + starPlatBlock + "%");
  1111.         starPlatHealth -= worldDamage * (starPlatBlock / 100);
  1112.         message.channel.send("Star Platinum's health is: " + starPlatHealth);
  1113.       }
  1114.  
  1115.       else if (standName.toLowerCase() == "theworld" || standName.toLowerCase() == "zawarudo") {
  1116.         message.channel.send("STAR PLATINUM dealt " + starPlatDamage + " damage\nBut THE WORLD blocked " + worldBlock + "%");
  1117.         worldHealth -= starPlatDamage * (worldBlock / 100);
  1118.         message.channel.send("The World's health is: " + worldHealth);
  1119.       }
  1120.  
  1121.       else
  1122.         message.channel.send("Invalid Stand Name\nAvailable Stands are:\n**StarPlatinum\nTheWorld**");
  1123.     }
  1124.  
  1125.     else {
  1126.       message.channel.send("Use `!StandAttack <Stand>` to select a stand!\nAvailable Stands are:\n**StarPlatinum\nTheWorld**");
  1127.     }
  1128.   }
  1129.   else
  1130.     message.channel.send("There is no Stand Battle in progress! Start one with `!StandStart`!");
  1131. }
  1132.  
  1133. client.login("NTc3Mjc2Mjc4OTY1Nzk2ODY0.XNwndw.JVjXWPqzyidjtZSmLI-bZAdO-6w")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement