Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const Discord = require('discord.js')
- const client = new Discord.Client()
- const Canvas = require('canvas');
- const Jimp = require('jimp');
- const embedConst = new Discord.RichEmbed()
- const GoogleImages = require('google-images');
- const gclient = new GoogleImages('015899125258643417944:yruyo2do_jy', 'AIzaSyBULJSphU2oBYESNfJfKEYxDgdOaFnVUTY');
- const ytdl = require('ytdl-core');
- const YouTube = require('simple-youtube-api');
- const youtube = new YouTube('AIzaSyBULJSphU2oBYESNfJfKEYxDgdOaFnVUTY'); //MickBot API 1
- //const youtube = new YouTube('AIzaSyCHyI71hb0UoS52G7b-Ede6_3kU6fedXhg'); //MickBot API 2
- var name;
- var rmemeArg;
- var bossArg;
- var kqueenAuthor = "79j2ViVMpFAn0B7B0rYpfYcMRwEm0tKLO";
- var kqueenMessage = "79j2ViVMpFAn0B7B0rYpfYcMRwEm0tKLO";
- var player1 = "79j2ViVMpFAn0B7B0rYpfYcMRwEm0tKLO", player2 = "79j2ViVMpFAn0B7B0rYpfYcMRwEm0tKLO";
- var bomb = 0;
- var btdRec = 0;
- var consoleLog = 0;
- var turn = 1, standStart = 0;
- var starPlatHealth = 1000, starPlatDamage = 50, starPlatBlock = 50, worldHealth = 1000, worldDamage = 50, worldBlock = 50;
- var msgArray = [], userArray = [], timeArray = [];
- var btdArray = new Array (2)
- var queue = [], qtime = [], qtitle = [], qdescription = [], qchanneltitle = [], qid = [], qCommTitle = [];
- var i, j, k, l;
- var playing = false, qPlaying = false;
- var playfile = false;
- connection => {
- const dispatcher = connection.playStream(ytdl('https://www.youtube.com/watch?v=UdX4qoQ8xFU&loop=0',{filter:"audioonly"}));
- }
- client.on('message', (message) => {
- /*youtube.getVideo('https://www.youtube.com/watch?v=3odIdmuFfEY')
- .then(video => {
- console.log(`The video's title is ${video.durationSeconds}`);
- })
- .catch(console.log);*/
- client.user.setActivity('!help', { type: 'PLAYING' })
- if (message.author == client.user) { // Prevent bot from responding to its own messages
- return
- }
- /*if (message.author.username=='raccoon') {
- deleteCommand(arguments, message)
- }*/
- //Killer Queen First Bomb Deleting / Message Detection
- if (bomb == 1) {
- console.log("First Bomb Active")
- if (message.author.username.toLowerCase() == (name.toLowerCase())) {
- kqueenAuthor = message.author.username
- kqueenMessage = message.content
- message.delete()
- bomb = 0
- console.log("Message: " + kqueenMessage)
- console.log("First Bomb Disabled")
- }
- }
- //Bites the Dust
- if (btdRec == 1) {
- msgArray.push(message.content);
- userArray.push(message.author.username);
- timeArray.push(message.createdTimestamp);
- }
- //Console Log
- /*if (consoleLog == 1)
- {
- console.log(message)
- message.attachments.array()
- message.channel.send(attachments[0])
- message.channel.send(message.attachments.toString())
- }*/
- if (message.content.startsWith("!")) {
- processCommand(message)
- }
- })
- function processCommand(message){
- let fullCommand = message.content.substr(1) // Remove the leading exclamation mark
- let splitCommand = fullCommand.split(" ") // Split the message up in to pieces for each space
- let primaryCommand = splitCommand[0] // The first word directly after the exclamation is the command
- let arguments = splitCommand.slice(1) // All other words are arguments/parameters/options for the command
- console.log("Command received: " + primaryCommand)
- console.log("From: " + message.author.username)
- console.log("Arguments: " + arguments)
- console.log()
- if (primaryCommand.toLowerCase() == "help" || primaryCommand.toLowerCase() == "commands") {
- helpCommand(arguments, message)
- } else if (primaryCommand.toLowerCase() == "vore") {
- voreCommand(arguments, message)
- } else if (primaryCommand.toLowerCase() == "64") {
- avgnCommand(arguments, message)
- } else if (primaryCommand.toLowerCase() == "rmeme") {
- rmemeCommand(arguments, message)
- } else if (primaryCommand.toLowerCase() == "theworld" || primaryCommand.toLowerCase() == "zw" || primaryCommand.toLowerCase() == "zawarudo" || primaryCommand.toLowerCase() == "tw") {
- theworldCommand(arguments, message)
- } else if (primaryCommand.toLowerCase() == "yes") {
- yesCommand(arguments, message)
- } else if (primaryCommand.toLowerCase() == "no") {
- noCommand(arguments, message)
- } else if (primaryCommand.toLowerCase() == "thehand" || primaryCommand.toLowerCase() == "zahando" || primaryCommand.toLowerCase() == "th" || primaryCommand.toLowerCase() == "zh") {
- thehandCommand(arguments, message)
- } else if (primaryCommand.toLowerCase() == "killerqueen" || primaryCommand.toLowerCase() == "kq") {
- killerqueenCommand(arguments, message)
- } else if (primaryCommand.toLowerCase() == "btd" || primaryCommand.toLowerCase() == "bitesthedust") {
- btdCommand(arguments, message)
- } else if (primaryCommand.toLowerCase() == "btdend" || primaryCommand.toLowerCase() == "bitesthedustend") {
- btdEndCommand(arguments, message)
- } else if (primaryCommand.toLowerCase() == "info") {
- infoCommand(arguments, message)
- } else if (primaryCommand.toLowerCase() == "doof") {
- doofCommand(arguments, message)
- } else if (primaryCommand.toLowerCase() == "console") {
- consoleCommand(arguments, message)
- } else if (primaryCommand.toLowerCase() == "consoleoff") {
- consoleOffCommand(arguments, message)
- } else if (primaryCommand.toLowerCase() == "command") {
- testCommand(arguments, message)
- } else if (primaryCommand.toLowerCase() == "command2") {
- test2Command(arguments, message)
- } else if (primaryCommand.toLowerCase() == "command3") {
- test3(arguments, message)
- } else if (primaryCommand.toLowerCase() == "standattack" || primaryCommand.toLowerCase() == "standa") {
- standAttackCommand(arguments, message, primaryCommand)
- } else if (primaryCommand.toLowerCase() == "standhealth" || primaryCommand.toLowerCase() == "standh") {
- standHealthCommand(arguments, message)
- } else if (primaryCommand.toLowerCase() == "standenable" || primaryCommand.toLowerCase() == "standstart") {
- standStartCommand(arguments, message)
- } else if (primaryCommand.toLowerCase() == "standdisable" || primaryCommand.toLowerCase() == "standstop") {
- standStopCommand(arguments, message)
- } else if (primaryCommand.toLowerCase() == "stand" || primaryCommand.toLowerCase() == "standhelp") {
- standHelpCommand(arguments, message)
- } else if (primaryCommand.toLowerCase() == "crazydiamond" || primaryCommand.toLowerCase() == "crazyd" || primaryCommand.toLowerCase() == "cd") {
- crazyDiamondCommand(arguments, message)
- } else if (primaryCommand.toLowerCase() == "icon" || primaryCommand.toLowerCase() == "avatar") {
- iconCommand(arguments, message)
- } else if (primaryCommand.toLowerCase() == "google" || primaryCommand.toLowerCase() == "g") {
- googleCommand(arguments, message)
- } else if (primaryCommand.toLowerCase() == "ttt" || primaryCommand.toLowerCase() == "tictactoe") {
- ticTacToeCommand(arguments, message)
- } else if (primaryCommand.toLowerCase() == "monokumadance" || primaryCommand.toLowerCase() == "monodance" || primaryCommand.toLowerCase() == "md") {
- monokumaDanceCommand(arguments, message)
- } else if (primaryCommand.toLowerCase() == "punishment" || primaryCommand.toLowerCase() == "punishmenttime" || primaryCommand.toLowerCase() == "monokumapunishment" || primaryCommand.toLowerCase() == "monopunish" || primaryCommand.toLowerCase() == "mkpt" || primaryCommand.toLowerCase() == "pt" || primaryCommand.toLowerCase() == "mp") {
- monokumaPunishmentCommand(arguments, message)
- } else if (primaryCommand.toLowerCase() == "counter" || primaryCommand.toLowerCase() == "wrong") {
- counterCommand(arguments, message)
- } else if (primaryCommand.toLowerCase() == "consent" || primaryCommand.toLowerCase() == "agree" || primaryCommand.toLowerCase() == "right") {
- consentCommand(arguments, message)
- } else if (primaryCommand.toLowerCase() == "play" || primaryCommand.toLowerCase() == "p") {
- playCommand(arguments, message)
- } else if (primaryCommand.toLowerCase() == "playfile" || primaryCommand.toLowerCase() == "p") {
- playCommand(arguments, message, primaryCommand)
- } else if (primaryCommand.toLowerCase() == "skip" || primaryCommand.toLowerCase() == "s") {
- playCommand(arguments, message, primaryCommand)
- } else if (primaryCommand.toLowerCase() == "stop" || primaryCommand.toLowerCase() == "s") {
- playCommand(arguments, message, primaryCommand)
- } else if (primaryCommand.toLowerCase() == "pause" || primaryCommand.toLowerCase() == "pa") {
- playCommand(arguments, message, primaryCommand)
- } else if (primaryCommand.toLowerCase() == "resume" || primaryCommand.toLowerCase() == "r") {
- playCommand(arguments, message, primaryCommand)
- } else if (primaryCommand.toLowerCase() == "volume" || primaryCommand.toLowerCase() == "v") {
- playCommand(arguments, message, primaryCommand)
- } else if (primaryCommand.toLowerCase() == "queue" || primaryCommand.toLowerCase() == "v") {
- playCommand(arguments, message, primaryCommand)
- } else if (primaryCommand.toLowerCase() == "image" || primaryCommand.toLowerCase() == "imagesearch") {
- imageCommand(arguments, message)
- } else if (primaryCommand.toLowerCase() == "boss" || primaryCommand.toLowerCase() == "rboss") {
- bossCommand(arguments, message)
- } else if (primaryCommand.toLowerCase() == "ss" || primaryCommand.toLowerCase() == "screenshare") {
- ssCommand(arguments, message)
- } else if (primaryCommand.toLowerCase() == "flip" || primaryCommand.toLowerCase() == "mirror") {
- flipCommand(arguments, message)
- } else if (primaryCommand.toLowerCase() == "btd2" || primaryCommand.toLowerCase() == "btdtwo") {
- btd2Command(arguments, message)
- }
- else {
- //message.channel.send("YOU BUMBLING IDIOT, TYPE THAT SHIT AGAIN")
- message.channel.send("Use `!help` for usable commands!")
- }
- }
- function helpCommand(arguments, message){
- helpArg = arguments[0]
- if (arguments.length == 0)
- message.channel.send("**Usage: ** *!help <section>*\nAvailable sections:\n**Music\nUtility\nReactions\nJoJo\nMemes**")
- //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**")
- else if (arguments.length > 1)
- message.channel.send("To see a list of commands, use `!help`. For help with a specific command, use `!help <command>`.")
- else if (helpArg.toLowerCase() == "music" || helpArg.toLowerCase() == "musiccommands" || helpArg.toLowerCase() == "musichelp") {
- message.channel.send("Music Commands:\n**Play\nVolume\nPause **&** Resume\nStop\nSkip\nQueue**")
- }
- else if (helpArg.toLowerCase() == "utility" || helpArg.toLowerCase() == "utilitycommands" || helpArg.toLowerCase() == "utilityhelp") {
- message.channel.send("Utility Commands:\n**Google\nIcon\nFlip\nInfo\nSS / ScreenShare**")
- }
- else if (helpArg.toLowerCase() == "reactions" || helpArg.toLowerCase() == "reactioncommands" || helpArg.toLowerCase() == "reactionscommands" || helpArg.toLowerCase() == "reactionshelp" || helpArg.toLowerCase() == "reactionhelp") {
- message.channel.send("Reaction Commands:\n**Yes\nNo\nCounter\nConsent\nMonokumaDance\nPunishmentTime / Punishment**")
- }
- else if (helpArg.toLowerCase() == "jojo" || helpArg.toLowerCase() == "jojocommands" || helpArg.toLowerCase() == "jojohelp") {
- message.channel.send("JoJo Commands:\n**Stand / StandHelp\nZAWARUDO / THEWORLD\nZAHANDO / THEHAND\nKillerQueen\nCrazyDiamond / CrazyD\nBTD / BitesTheDust **&** BTDEND / BitesTheDustEnd**")
- }
- else if (helpArg.toLowerCase() == "memes" || helpArg.toLowerCase() == "meme" || helpArg.toLowerCase() == "memecommands" || helpArg.toLowerCase() == "memehelp") {
- message.channel.send("Meme Commands:\n**RMeme\nBoss\nVore\n64\nDoof**")
- }
- //Sections â–² | Commands â–¼
- else if (helpArg.toLowerCase() == "rmeme") {
- message.channel.send("**RMeme Usage:**\n`!RMeme` - Sends a random meme\n`!RMeme Count` - Shows the number of memes in the set")
- }
- else if (helpArg.toLowerCase() == "boss") {
- message.channel.send("**Boss Usage:**\n`!Boss` - Summons a random boss (Not currently fightable)\n`!Boss Count` - Shows the number of possible bosses")
- }
- else if (helpArg.toLowerCase() == "thehand" || helpArg.toLowerCase() == "zahando" || helpArg.toLowerCase() == "th" || helpArg.toLowerCase() == "zh") {
- message.channel.send("**THEHAND Usage:**\n`!TheHand` / `ZaHando` - Deletes !THEHAND message")
- }
- else if (helpArg.toLowerCase() == "killerqueen" || helpArg.toLowerCase() == "kq") {
- message.channel.send("**KillerQueen Usage:**\n`!KillerQueen <Username>` - Deletes \"Username\"s next message")
- }
- else if (helpArg.toLowerCase() == "crazydiamond" || helpArg.toLowerCase() == "crazyd" || helpArg.toLowerCase() == "cd") {
- message.channel.send("**CrazyDiamond Usage:**\n`!CrazyDiamond` / `!CrazyD` - Restores deleted message from !killerqueen")
- }
- else if (helpArg.toLowerCase() == "btd" || helpArg.toLowerCase() == "bitesthedust" || helpArg.toLowerCase() == "btdend" || helpArg.toLowerCase() == "bitesthedustend") {
- 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")
- }
- else if (helpArg.toLowerCase() == "theworld" || helpArg.toLowerCase() == "zawarudo" || helpArg.toLowerCase() == "tw" || helpArg.toLowerCase() == "zw") {
- message.channel.send("**ZAWARUDO Usage:**\n`!ZaWarudo` / `!TheWorld` - Freezes time for ten seconds in current channel")
- }
- else {
- message.channel.send("No help found for `!" + arguments[0] + "`!")
- }
- }
- function testCommand(arguments, message){
- var fs = require("fs");
- var poem = fs.readFileSync("C:\\Users\\carto\\Desktop\\url.txt", {"encoding": "utf-8"});
- console.log(poem)
- //embedConst.setImage(poem)
- poem = poem.split('\n'[0]);
- message.channel.send(poem[2]);
- }
- async function test2Command(arguments, message){
- const canvas = Canvas.createCanvas(700, 250);
- const ctx = canvas.getContext('2d');
- const background = await Canvas.loadImage('C:\\Users\\carto\\Desktop\\MickBot\\wallpaper.jpg');
- ctx.drawImage(background, 0, 0, canvas.width, canvas.height);
- ctx.strokeStyle = '#74037b';
- ctx.strokeRect(0, 0, canvas.width, canvas.height);
- var member= message.mentions.users.first();
- // Wait for Canvas to load the image
- const avatar = await Canvas.loadImage(member.avatarURL);
- // Draw a shape onto the main canvas
- ctx.drawImage(avatar, 25, 0, 200, canvas.height);
- const attachment = new Discord.Attachment(canvas.toBuffer(), 'welcome-image.png');
- message.channel.send(attachment)
- }
- function test3(arguments, message){
- Jimp.read('wallpaper.jpg')
- .then(lenna => {
- return lenna
- .resize(256, 256) // resize
- .quality(60) // set JPEG quality
- .greyscale() // set greyscale
- .write('lena-small-bw.jpg'); // save
- })
- const localFileAttachment = new Discord.Attachment('C:\\Users\\carto\\Desktop\\MickBot\\lena-small-bw.jpg')
- message.channel.send(localFileAttachment)
- .catch(err => {
- console.error(err);
- });
- }
- function flipCommand(arguments, message){
- if (arguments.length != 1) {
- message.channel.send("To use `!flip`, specify either `!flip h` or `!flip v` for horizontal or vertical, Or use `!flip hv` for both!")
- return
- }
- if (arguments[0] == "h") {
- Jimp.read('https://cdn.discordapp.com/avatars/' + message.author.id + '/' + message.author.avatar + '.png?size=2048', (err, jimpimage) => {
- if (err) throw err;
- jimpimage
- .flip(true, false)
- .write('pfp.png')
- const localFileAttachment = new Discord.Attachment('C:\\Users\\carto\\Desktop\\MickBot\\pfp.png')
- message.channel.send(localFileAttachment)
- });
- return
- }
- if (arguments[0] == "v") {
- Jimp.read('https://cdn.discordapp.com/avatars/' + message.author.id + '/' + message.author.avatar + '.png?size=2048', (err, jimpimage) => {
- if (err) throw err;
- jimpimage
- .flip(false, true)
- .write('pfp.png')
- const localFileAttachment = new Discord.Attachment('C:\\Users\\carto\\Desktop\\MickBot\\pfp.png')
- message.channel.send(localFileAttachment)
- });
- return
- }
- if (arguments[0] == "hv" || arguments[0] == "vh") {
- Jimp.read('https://cdn.discordapp.com/avatars/' + message.author.id + '/' + message.author.avatar + '.png?size=2048', (err, jimpimage) => {
- if (err) throw err;
- jimpimage
- .flip(true, true)
- .write('pfp.png')
- const localFileAttachment = new Discord.Attachment('C:\\Users\\carto\\Desktop\\MickBot\\pfp.png')
- message.channel.send(localFileAttachment)
- });
- return
- }
- message.channel.send("To use `!flip`, specify either `!flip h` or `!flip v` for horizontal or vertical, Or use `!flip hv` for both!")
- }
- function iconCommand(arguments, message){
- if (arguments.length == 0) { //? Technically Unnecessary. Deprecated by .avatarURL
- embedConst.setImage('https://cdn.discordapp.com/avatars/' + message.author.id + '/' + message.author.avatar + '.png?size=2048')
- message.channel.send(embedConst);
- }
- else if (arguments.length == 1) { //Icon Grabber
- var member= message.mentions.users.first();
- embedConst.setImage(member.avatarURL)
- message.channel.send(embedConst);
- }
- }
- function ssCommand(arguments, message){
- try {
- message.channel.send("<https://discordapp.com/channels/" + message.guild.id + "/" + message.member.voiceChannel.id + ">")
- }
- catch {
- message.channel.send("Join a voice channel to use `!screenshare`!")
- console.log("User not in Voice Channel")
- }
- }
- function imageCommand(arguments, message){
- /*gclient.search('Steam', {num: 1})
- .then(images => {
- console.log(images)
- })*/
- GoogleImageSearch.searchImage("cats")
- .then((res) => {
- console.log(res); // This will return array of image URLs
- })
- }
- function youtubeCommand(arguments, message){
- const youtube = new YouTube("AIzaSyBULJSphU2oBYESNfJfKEYxDgdOaFnVUTY");
- //const video1 = youtube.getVideo("https://www.youtube.com/watch?v=5NPBIwQyPWE");
- console.log(video1)
- }
- function playCommand(arguments, message, primaryCommand){
- if (message.channel.type =='dm') {
- message.channel.send("Use `!play` in a server voice channel to play music!")
- return
- }
- if (primaryCommand == "pause" || primaryCommand == "resume" || primaryCommand == "stop" || primaryCommand == "queue" || primaryCommand == "volume" || primaryCommand == "skip" || primaryCommand == "playfile")
- console.log("Registered " + primaryCommand)
- else if (arguments.length == 0 || arguments.length < 1) {
- message.channel.send("**Usage:** `!play <youtube url>`")
- return
- }
- if (primaryCommand == "pause" && playing) {
- dispatcher.pause()
- console.log("Paused")
- return
- }
- if (primaryCommand == "resume" && playing) {
- dispatcher.resume()
- console.log("Resumed")
- return
- }
- if (primaryCommand == "stop" && playing && !qPlaying) {
- //activeVoiceChannel.leave()
- console.log("Stopped")
- if (queue.length > 0) {
- queue.length = 0
- }
- dispatcher.end()
- return
- }
- if (primaryCommand == "stop" && playing && qPlaying) {
- //queue = [];
- queue.length = 0
- dispatcher.end()
- return
- }
- if (primaryCommand == "stop" && playing == false) {
- message.channel.send("Use `!stop` while the bot is already playing something with `!play`!")
- return
- }
- if (primaryCommand == "volume" && playing) {
- if (arguments.length > 1) {
- message.channel.send("**Usage:** `!volume <1-100>`")
- return
- }
- else if (arguments.length == 0) {
- message.channel.send("Current Volume is: " + (dispatcher.volume * 100) + "%")
- return
- }
- if (arguments[0] >= 100) {
- dispatcher.setVolume(1)
- message.channel.send("Volume: " + 100 + "%")
- return
- }
- else
- dispatcher.setVolume((arguments[0]/100))
- console.log("Volume: " + arguments[0])
- message.channel.send("Volume: " + (arguments[0] + "%"))
- return
- }
- if (primaryCommand == "volume" && playing == false) {
- message.channel.send("Use `!play <youtube url>` while in a voice channel first!")
- return
- }
- if (primaryCommand == "skip" && queue.length > 0) {
- dispatcher.end()
- //activeVoiceChannel.leave()
- console.log("Skipped")
- return
- }
- /*if (primaryCommand == "playfile" && !playing) {
- console.log("Playing File")
- activeVoiceChannel.join()
- .then(connection => {
- dispatcher = connection.playFile('C:\\Users\\carto\\Desktop\\MickBot\\PlayFile\\' + arguments[0] + '.wav');
- dispatcher.setVolume(.5)
- playfile = true
- playing = true
- console.log("Playing = True")
- dispatcher.on("end", end => {
- activeVoiceChannel.leave()
- console.log("Playing = False")
- playfile = false
- playing = false
- return
- })
- })
- }*/
- if (primaryCommand == "queue") {
- console.log("Queue URLs:")
- for (var qloop = 0; qloop < queue.length; qloop++) {
- console.log(queue[qloop])
- }
- if (queue.length > 0) {
- message.channel.send("There are currently " + queue.length + ' videos in the queue!')
- queueString = ""
- for (var queueCLoop = 0; queueCLoop < queue.length; queueCLoop++) {
- queueString += (title[queueCLoop] + "\n")
- }
- console.log(queueString)
- message.channel.send(queueString)
- }
- else
- message.channel.send("There is no current queue! Start one by playing a video while one is already playing!")
- return
- }
- var videoSearchTerm = arguments[0]
- var videoTerms = "";
- for (var vidloop=0; vidloop<arguments.length; vidloop++) {
- videoTerms += (arguments[vidloop] + " ")
- }
- var activeVoiceChannel = message.member.voiceChannel;
- if (!activeVoiceChannel)
- return message.reply("Join a voice channel to play music!")
- if (playing) {
- youtube.searchVideos(videoTerms, 1)
- .then(results => {
- queue.push(results[0].url)
- qtitle.push(results[0].title)
- qdescription.push(results[0].description)
- qchanneltitle.push(results[0].channel.title)
- qid.push(results[0].id)
- qtime.push(results[0].durationSeconds)
- return
- })
- return
- }
- //if (playfile == false){
- activeVoiceChannel.join()
- .then(connection => {
- //PLAYS FILE //const dispatcher = connection.playFile('C:\\Users\\carto\\Desktop\\Misc\\shanties.mp3');
- if (!playing)
- youtube.searchVideos(videoTerms, 1)
- .then(results => {
- var resultURL = results[0].url
- dispatcher = connection.playStream(ytdl(resultURL,{filter:"audioonly"}));
- dispatcher.setVolume(.35)
- playing = true
- console.log("Playing = True")
- var title = results[0].title
- console.log(results)
- title = title.replace(/'/g, "'")
- title = title.replace(/"/g, "\"")
- console.log("Now Playing: " + title)
- const vidEmbed = new Discord.RichEmbed()
- if (results[0].description == '')
- results[0].description = '`No Description`'
- vidEmbed.setColor('#FF0000')
- vidEmbed.setAuthor("Now playing:"/*, 'https://cdn.discordapp.com/attachments/596928630009888781/611165926695632916/YTLOGO.png'*/)
- vidEmbed.addField(results[0].channel.title, results[0].description)
- vidEmbed.setFooter('', 'https://i.imgur.com/wSTFkRM.png');
- vidEmbed.setTitle(title)
- vidEmbed.setURL(resultURL)
- vidEmbed.setImage('https://img.youtube.com/vi/' + results[0].id + '/maxresdefault.jpg')
- message.channel.send(vidEmbed);
- dispatcher.on("end", end => {
- if (queue.length > 0) {
- queueCommand(arguments, message, queue, results)
- return
- }
- activeVoiceChannel.leave()
- console.log("Playing = False")
- playing = false
- });
- })
- //client.user.setActivity('Playing Music!')
- })
- .catch(console.error);
- }
- //}
- function queueCommand(arguments, message, queue, results){
- console.log("Started queue")
- qPlaying = true
- var activeVoiceChannel = message.member.voiceChannel;
- /*activeVoiceChannel.leave()*/
- activeVoiceChannel.join()
- .then(connection => {
- dispatcher = connection.playStream(ytdl(queue[0], {filter: "audioonly"}));
- dispatcher.setVolume(.35)
- playing = true
- console.log("Playing = True")
- var title = qtitle[0]
- title = title.replace(/'/g, "'")
- title = title.replace(/"/g, "\"")
- console.log("Now Playing: " + title)
- const vidEmbed = new Discord.RichEmbed()
- if (results[0].description == '')
- results[0].description = '`No Description`'
- vidEmbed.setColor('#FF0000')
- vidEmbed.setAuthor("Now playing:"/*, 'https://cdn.discordapp.com/attachments/596928630009888781/611165926695632916/YTLOGO.png'*/)
- vidEmbed.addField(qchanneltitle[0], qdescription[0])
- vidEmbed.setFooter('', 'https://i.imgur.com/wSTFkRM.png');
- vidEmbed.setTitle(title)
- vidEmbed.setURL(queue[0])
- vidEmbed.setImage('https://img.youtube.com/vi/' + qid[0] + '/maxresdefault.jpg')
- message.channel.send(vidEmbed);
- queue.shift()
- qtitle.shift()
- qdescription.shift()
- qchanneltitle.shift()
- qid.shift()
- dispatcher.on("end", end => {
- playing = false
- if (queue.length > 0)
- queueCommand(arguments, message, queue, results)
- else {
- activeVoiceChannel.leave()
- qPlaying = false
- }
- })
- })
- }
- function stopCommand(arguments, message){
- dispatcher.on("end", end => {activeVoiceChannel.leave()});
- }
- function ticTacToeCommand(arguments, message){
- var board = [
- ["", "", ""],
- ["", "", ""],
- ["", "", ""]
- ];
- var winner = 2;
- var c = 1;
- var player;
- for(var setx=0; setx<board.length; setx++)
- for(var sety=0; sety<board.length; sety++)
- board[setx][sety]="[" + setx+1 + "]";
- printBoard(board, message)
- //while (winner == 2) {
- if (c == 10) {
- message.channel.send("GAME OVER: TIE")
- return; //! COULD CAUSE PROBLEMS, CHANGE TO break;
- }
- if (c % 2 == 0)
- player = "[X]"
- else
- player = "[O]"
- message.channel.send("Choose X Coordinate, " + player + ": ")
- 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⃣'));
- const filter = (reaction, user) => {
- return ['1⃣', '2⃣', '3⃣', '4⃣', '5⃣', '6⃣', '7⃣', '8⃣', '9⃣'].includes(reaction.emoji.name) && user.id === message.author.id;
- };
- message.awaitReactions(filter, { max: 1, time: 60000, errors: ['time'] })
- .then(collected => {
- const reaction = collected.first();
- if (reaction.emoji.name === '1⃣') {
- message.reply('1');
- } else if (reaction.emoji.name === '2⃣') {
- message.reply('2');
- } else if (reaction.emoji.name === '3⃣') {
- message.reply('3');
- } else if (reaction.emoji.name === '4⃣') {
- message.reply('4');
- } else if (reaction.emoji.name === '5⃣') {
- message.reply('5');
- } else if (reaction.emoji.name === '6⃣') {
- message.reply('6');
- } else if (reaction.emoji.name === '7⃣') {
- message.reply('7');
- } else if (reaction.emoji.name === '8⃣') {
- message.reply('8');
- } else
- message.reply('9')
- })
- .catch(collected => {
- message.reply('Timeout! React with one of the numbers!');
- });
- }
- //}
- function printBoard(board, message){
- var boardMsg = "";
- for(var boardloop=0; boardloop<9; boardloop++) {
- boardMsg += "[" + (boardloop+1) +"]"
- if (boardloop == 2 || boardloop == 5 || boardloop == 8)
- boardMsg += "\n"
- }
- message.channel.send(boardMsg)
- }
- function googleCommand(arguments, message){
- if (arguments.length == 1)
- message.channel.send("https://www.google.com/search?q=" + arguments[0])
- else if (arguments.length > 1) {
- var searchString = arguments[0]
- for(gloop = 1; gloop < arguments.length; gloop++) {
- searchString += "+" + arguments[gloop]
- }
- message.channel.send("https://www.google.com/search?q=" + searchString)
- }
- else
- message.channel.send("No Search Term detected! **Usage:** *!google* <Search Term>")
- }
- function monokumaDanceCommand(arguments, message){
- var temp = Math.floor(Math.random() * 4)
- if (temp == 0) {
- embedConst.setImage('https://cdn.discordapp.com/attachments/577297695635537930/596925824956104714/monodance0.gif')
- message.channel.send(embedConst);
- }
- else if (temp == 1) {
- embedConst.setImage('https://cdn.discordapp.com/attachments/577297695635537930/596926406303416331/monodance1.gif')
- message.channel.send(embedConst);
- }
- else if (temp == 2) {
- embedConst.setImage('https://cdn.discordapp.com/attachments/577297695635537930/596926457868189697/monodance2.gif')
- message.channel.send(embedConst);
- }
- else if (temp == 3) {
- embedConst.setImage('https://cdn.discordapp.com/attachments/577297695635537930/596926548381270020/monodance3.gif')
- message.channel.send(embedConst);
- }
- }
- function monokumaPunishmentCommand(arguments, message){
- var temp = Math.floor(Math.random() * 2)
- if (temp == 0) {
- embedConst.setImage('https://cdn.discordapp.com/attachments/596928630009888781/596929024555745280/monopunishment0.gif')
- message.channel.send(embedConst);
- }
- else if (temp == 1) {
- embedConst.setImage('https://cdn.discordapp.com/attachments/596928630009888781/596929025906180108/monopunishment1.gif')
- message.channel.send(embedConst);
- }
- }
- function counterCommand(arguments, message){
- var temp = Math.floor(Math.random() * 3)
- if (temp == 0) {
- embedConst.setImage('https://cdn.discordapp.com/attachments/596928630009888781/596930057843376141/counter0.gif')
- message.channel.send(embedConst);
- }
- else if (temp == 1) {
- embedConst.setImage('https://cdn.discordapp.com/attachments/596928630009888781/596930058027794432/counter1.gif')
- message.channel.send(embedConst);
- }
- else if (temp == 2) {
- embedConst.setImage('https://cdn.discordapp.com/attachments/596928630009888781/596930056245215242/counter2.gif')
- message.channel.send(embedConst);
- }
- }
- function consentCommand(arguments, message){
- embedConst.setImage('https://cdn.discordapp.com/attachments/578261342344183808/597119480837046285/agree0.gif')
- message.channel.send(embedConst);
- }
- function consoleCommand(arguments, message){
- consoleLog = 1
- }
- function consoleOffCommand(arguments, message){
- consoleLog = 0
- }
- function infoCommand(arguments, message){
- if (message.channel.type == 'text')
- 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)
- else if (message.channel.type =='dm')
- message.channel.send('**User Information:**\nFrom: ' + message.author.username + '\nDiscriminator: ' + message.author.discriminator + '\nTimestamp: ' + message.createdAt)
- var argString = arguments[0]
- if (argString == "console")
- console.log(message)
- }
- function doofCommand(arguments, message){
- embedConst.setImage('https://cdn.discordapp.com/attachments/583598930219237385/593040956144615427/doof.gif')
- message.channel.send(embedConst);
- setTimeout(function() {
- message.channel.send("**MY NAME IS DOOF AND YOU'LL DO WHAT I SAY\nWOOP WOOP**")
- }, 1000)
- }
- function voreCommand(arguments, message){
- //Provide a path to a local file
- var temp = Math.floor(Math.random() * 2)
- const localFileAttachment = new Discord.Attachment('C:\\Users\\carto\\Desktop\\MickBot\\Attachments\\Vore\\'+(temp)+'.png')
- console.log("Image: " + temp)
- console.log()
- message.channel.send(localFileAttachment)
- }
- function deleteCommand(arguments, message){
- message.delete()
- }
- function crazyDiamondCommand(arguments, message){
- if (kqueenMessage == "79j2ViVMpFAn0B7B0rYpfYcMRwEm0tKLO") {
- message.channel.send("There's nothing to fix! Use after KillerQueen's first bomb!")
- return;
- }
- else{
- embedConst.setImage('https://cdn.discordapp.com/attachments/583598930219237385/592909008222945280/crazydiamond.gif')
- message.channel.send(embedConst);
- setTimeout(function() {
- message.channel.send(kqueenAuthor + ": " + kqueenMessage)
- kqueenAuthor = "79j2ViVMpFAn0B7B0rYpfYcMRwEm0tKLO"
- kqueenMessage = "79j2ViVMpFAn0B7B0rYpfYcMRwEm0tKLO"
- }, 500)
- }
- }
- function killerqueenCommand(arguments, message){
- name = arguments[0]
- if (arguments.length == 1) {
- message.channel.send("KILLER QUEEN, SAISHO NO BAKUDAN!")
- message.channel.send(name.toUpperCase() + ", THE CHAT IS NOW A BOMB!")
- bomb = 1
- console.log("Killer Queen Activated")
- }
- else
- message.channel.send("Write a username to target!")
- }
- function setDelay(){
- setTimeout(function(){
- console.log("Timeout")
- }, 10000);
- }
- function doofDelay(){
- setTimeout(function(){
- message.channel.send("**MY NAME IS DOOF AND YOU'LL DO WHAT I SAY\nWOOP WOOP**")
- }, 500);
- }
- function btdCommand(arguments, message){
- bigArray = []
- nestedArray = [3]
- bigArray.push(nestedArray)
- bigArray[0][0] = 5
- console.log(nestedArray)
- /*nestedArray = []
- nestedArray2 = []
- bigArray.push(nestedArray)
- bigArray[0].push("message")
- bigArray[0].push("Mickman")
- bigArray[0].push(325345787)
- bigArray.push(nestedArray2)
- bigArray[1].push("message2")
- bigArray[1].push("KeZeio")
- bigArray[1].push(864767467)*/
- for (var i=0; i<bigArray.length; i++) {
- for (var j=0; j<nestedArray.length; j++) {
- console.log(bigArray[i][j])
- }
- }
- }
- function btd2Command(arguments, message){
- bigArray = []
- bigArray.push([])
- console.log(bigArray)
- /*for (var i=0; i<bigArray.length; i++) {
- for (var j=0; j<nestedArray.length; j++) {
- console.log(bigArray[i][j])
- }
- }*/
- }
- function thehandCommand(arguments, message){
- embedConst.setImage('https://cdn.discordapp.com/attachments/583598930219237385/593041517908721664/thehand.png')
- message.channel.send(embedConst);
- message.channel.send("**THE HAND!**")
- setTimeout(function(){
- message.delete()
- }, 3000)
- }
- function yesCommand(arguments, message){
- embedConst.setImage('https://cdn.discordapp.com/attachments/583598930219237385/593040972879757312/yes.gif')
- message.channel.send(embedConst);
- }
- function noCommand(arguments, message){
- embedConst.setImage('https://cdn.discordapp.com/attachments/583598930219237385/593040982245638154/no.gif')
- message.channel.send(embedConst);
- }
- function theworldCommand(arguments, message){
- if (message.channel.type =='dm') {
- message.channel.send("To use `!THEWORLD`, send the command from a server text channel!")
- return
- }
- let channel = message.channel
- channel.overwritePermissions(channel.guild.defaultRole, { SEND_MESSAGES: false })
- message.channel.send("TIME HAS STOPPED.")
- embedConst.setImage('https://cdn.discordapp.com/attachments/583598930219237385/593045367306584095/theworld.gif')
- message.channel.send(embedConst);
- setTimeout(function(){
- message.channel.send("5 SECONDS HAVE PASSED.")
- console.log("5 SECONDS HAVE PASSED.")
- }, 5000);
- setTimeout(function(){
- embedConst.setImage('https://cdn.discordapp.com/attachments/583598930219237385/593045400911347712/resume.gif')
- message.channel.send(embedConst);
- message.channel.send("10 SECONDS HAVE PASSED.")
- console.log("10 SECONDS HAVE PASSED.")
- message.channel.send("TIME HAS BEGUN TO MOVE AGAIN.")
- channel.overwritePermissions(channel.guild.defaultRole, { SEND_MESSAGES: true })
- }, 10000);
- }
- function avgnCommand(arguments, message){
- message.channel.send("https://www.youtube.com/watch?v=VUcI0p04XJw")
- }
- function rmemeCommand(arguments, message){
- //Returns number of images in album (Manual change)
- rmemeArg = arguments[0]
- if (arguments.length == 1) {
- if (rmemeArg.toLowerCase() == "count"|| rmemeArg.toLowerCase() == "number"|| rmemeArg.toLowerCase() == "amount"|| rmemeArg.toLowerCase() == "images")
- message.channel.send("There are **20** images in the set")
- return;
- }
- //Math.Random to choose number in album sequence
- var temp = Math.floor(Math.random() * 20)
- const localFileAttachment = new Discord.Attachment('C:\\Users\\carto\\Desktop\\MickBot\\Album\\'+(temp)+'.png')
- console.log("Image: " + temp)
- console.log()
- message.channel.send(localFileAttachment)
- }
- function bossCommand(arguments, message){
- const bossEmbed = new Discord.RichEmbed()
- //Returns number of images in album (Manual change)
- bossArg = arguments[0]
- if (arguments.length == 1) {
- if (bossArg.toLowerCase() == "count"|| bossArg.toLowerCase() == "number"|| bossArg.toLowerCase() == "amount"|| bossArg.toLowerCase() == "images")
- message.channel.send("There are **33** bosses in the run")
- return;
- }
- bossEmbed.setImage('https://cdn.discordapp.com/attachments/314246588891398144/603078260703625217/BossPS.png')
- bossEmbed.setColor('#95287C')
- message.channel.send(bossEmbed);
- bossEmbed.setColor('#4F545C')
- //Math.Random to choose number in album sequence
- var temp = Math.floor(Math.random() * 38)
- var fs = require("fs");
- var bosstxt = fs.readFileSync("C:\\Users\\carto\\Desktop\\MickBot\\Boss Album\\"+(temp)+".txt", {"encoding": "utf-8"});
- var bosslink = bosstxt.split('\n'[0]);
- var bossinfo = bosstxt.split('\n'[0]);
- bossEmbed.setImage(bosslink[0])
- bossEmbed.setAuthor(bossinfo[2], bossinfo[6])
- bossEmbed.setDescription(bossinfo[4])
- message.channel.send(bossEmbed)
- //bossEmbed.setAuthor()
- //bossEmbed.setDescription()
- /*setTimeout(function() {
- var bossinfo = bosstxt.split('\n'[0]);
- message.channel.send(bossinfo[2]);
- }, 500)*/
- //const localFileAttachment = new Discord.Attachment('C:\\Users\\carto\\Desktop\\MickBot\\Boss Album\\'+(temp)+'.png')
- console.log("Boss: " + temp)
- console.log()
- //message.channel.send(localFileAttachment)
- }
- function standHelpCommand(arguments, message){
- 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`");
- }
- function standStartCommand(arguments, message){
- if (standStart == 1) {
- message.channel.send("Stand Battle already in progress! Use `!StandStop` to finish the battle");
- return;
- }
- else {
- //Starts Stands, resets stats
- starPlatHealth = 1000;
- starPlatDamage = 50;
- starPlatBlock = 50;
- worldHealth = 1000;
- worldDamage = 50;
- worldBlock = 50;
- //standStart = 1
- turn = 1;
- if (player1 == "79j2ViVMpFAn0B7B0rYpfYcMRwEm0tKLO") {
- player1 = message.author.username;
- message.channel.send("Player 1: " + player1);
- return;
- }
- if (player1 != message.author.username) {
- player2 = message.author.username;
- message.channel.send("Player 2: " + player2);
- standStart = 1;
- message.channel.send("Stand Battle Started!");
- console.log("Stand Battle Started");
- var standtemp = Math.floor(Math.random() * 2);
- if (standtemp == 0) {
- message.channel.send("It's " + player1 + "'s turn first!'");
- turn = 1;
- }
- if (standtemp == 1) {
- message.channel.send("It's " + player2 + "'s turn first!'");
- turn = 2;
- }
- //standChooseCommand(arguments, message)
- //For loop for both players? More compact
- }
- else {
- message.channel.send("Player 1 already chosen!");
- }
- }
- }
- function standStopCommand(arguments, message){
- //Stops Stands
- if (standStart == 0) {
- message.channel.send("There is no Stand Battle in progress! Start one with `!StandStart`!");
- return;
- }
- message.channel.send("STAR PLATINUM FINAL HEATH: " + starPlatHealth + "\nTHE WORLD FINAL HEALTH: " + worldHealth);
- standStart = 0;
- player1 = "79j2ViVMpFAn0B7B0rYpfYcMRwEm0tKLO";
- player2 = "79j2ViVMpFAn0B7B0rYpfYcMRwEm0tKLO";
- message.channel.send("Stand Battle Ended!");
- }
- function standHealthCommand(arguments, message){
- if (standStart == 1)
- message.channel.send("Current health of THE WORLD is: " + worldHealth + "\nCurrent health of STAR PLATINUM is: " + starPlatHealth);
- else
- message.channel.send("There is no Stand Battle in progress! Start one with `!StandStart`!");
- }
- function standAttackCommand(arguments, message, primaryCommand) {
- if (standStart == 1) {
- if (arguments.length == 1) {
- if (turn % 2 == 1) { //If player 1's turn
- console.log("Player 1's Turn");
- }
- var standName = arguments[0];
- if (standName.toLowerCase() == "starplat" || standName.toLowerCase() == "starplatinum" || standName.toLowerCase() == "starp") {
- message.channel.send("THE WORLD dealt " + worldDamage + " damage\nBut STAR PLATINUM blocked " + starPlatBlock + "%");
- starPlatHealth -= worldDamage * (starPlatBlock / 100);
- message.channel.send("Star Platinum's health is: " + starPlatHealth);
- }
- else if (standName.toLowerCase() == "theworld" || standName.toLowerCase() == "zawarudo") {
- message.channel.send("STAR PLATINUM dealt " + starPlatDamage + " damage\nBut THE WORLD blocked " + worldBlock + "%");
- worldHealth -= starPlatDamage * (worldBlock / 100);
- message.channel.send("The World's health is: " + worldHealth);
- }
- else
- message.channel.send("Invalid Stand Name\nAvailable Stands are:\n**StarPlatinum\nTheWorld**");
- }
- else {
- message.channel.send("Use `!StandAttack <Stand>` to select a stand!\nAvailable Stands are:\n**StarPlatinum\nTheWorld**");
- }
- }
- else
- message.channel.send("There is no Stand Battle in progress! Start one with `!StandStart`!");
- }
- client.login("NTc3Mjc2Mjc4OTY1Nzk2ODY0.XNwndw.JVjXWPqzyidjtZSmLI-bZAdO-6w")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement