From 90d93f2a3fbb43e02334a69ab954666c82f2cdd4 Mon Sep 17 00:00:00 2001 From: Tacobell Date: Fri, 31 May 2019 00:20:06 -0400 Subject: [PATCH 1/2] Modified wf file v1 --- commands/wf.js | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 commands/wf.js diff --git a/commands/wf.js b/commands/wf.js new file mode 100644 index 0000000..a472478 --- /dev/null +++ b/commands/wf.js @@ -0,0 +1,55 @@ +const cheerio = require('cheerio'); +const request = require('request'); +const fetch = require('node-fetch'); +const Discord = require('discord.js'); +//const cheerioTableparser = require('cheerio-tableparser') + +//So the discord wrapper runs without problems which is nice. Nothing happens of course because I think it has to be ran on the server +module.exports = { + name: 'Warframe Weapons, maybe frames?', + description: 'Find weapons', + execute(message, args) { + + const url = 'https://warframe.fandom.com/wiki/'+ args[0]; + +request(url, (error, response, html) => { + if (!error && response.statusCode == 200) { + const $ = cheerio.load(html); + const gunName = $('h1').html() + const body = $('body') + const labelArr = {} + const valueArr = {} + const value = body.find($('.pi-data-value')).each(function (i, elem) { + valueArr[i] = $(this).text() + }) + const label = body.find($('.pi-data-label')).each(function (i, elem) { + labelArr[i] = $(this).text() + }) + console.log(labelArr[6]); + const embed = new Discord.RichEmbed() + .addField("Some bullshit",valueArr[1],true) + .addField("Another bullshit",labelArr[2],true) + message.channel.send({embed}) + + } +}) +}, +}; + + +/* +=================***********=================****************=================***********================= +=================***********=================Test Shit Ignore=================***********================= +=================***********=================****************=================***********================= +url = 'https://warframe.fandom.com/wiki/Boltor Prime' + +request(url, (error, response, html) => { + if(!error && response.statusCode == 200) { + const $ = cheerio.load(html); + const body = $('body') + + } +}*/ + + + From 55af24a5d135271c7a634411c364ccaef99c67a5 Mon Sep 17 00:00:00 2001 From: alachhman Date: Sat, 31 Aug 2019 15:38:54 -0400 Subject: [PATCH 2/2] Update --- TempCommandStorage/drag.js | 435 ++++++++++++++ TempCommandStorage/help.js | 15 + TempCommandStorage/masters.js | 346 +++++++++++ TempCommandStorage/poke.js | 1019 +++++++++++++++++++++++++++++++++ TempCommandStorage/test.js | 7 + bot.js | 109 +++- commands/mastersTest.js | 172 ++++++ commands/mastersTest2.js | 39 ++ package.json | 10 + 9 files changed, 2148 insertions(+), 4 deletions(-) create mode 100644 TempCommandStorage/drag.js create mode 100644 TempCommandStorage/help.js create mode 100644 TempCommandStorage/masters.js create mode 100644 TempCommandStorage/poke.js create mode 100644 TempCommandStorage/test.js create mode 100644 commands/mastersTest.js create mode 100644 commands/mastersTest2.js diff --git a/TempCommandStorage/drag.js b/TempCommandStorage/drag.js new file mode 100644 index 0000000..a559ec5 --- /dev/null +++ b/TempCommandStorage/drag.js @@ -0,0 +1,435 @@ +const cheerio = require('cheerio'); +const request = require('request'); +const Discord = require('discord.js'); +const paginationEmbed = require('discord.js-pagination'); +const { MessageEmbed } = require('discord.js'); +const cheerioTableparser = require('cheerio-tableparser'); +module.exports = { + name: 'drag', + description: 'view the drag wiki', + execute(message, args) { + var appendFinal = ""; + try { + var isDragon = false; + var isWeapon = false; + var isPrint = false; + if (args[0] == null) { + // + // + // Construction Zone: passing in no argument will return general info about the game ie: event countdown timer + // + // + url = 'https://dragalialost.gamepress.gg/'; + request(url, (error, response, html) => { + if (!error && response.statusCode === 200) { + const $ = cheerio.load(html); + const body = $('body'); + cheerioTableparser($); + const running = body.find($('table')).find($('.event-countdown-table')); + console.log(running.find($('tbody')).text()); + } + }); + // + // + // + // + // + } + else { + //solve edge cases of apostrophe and spaces in the unit's name + var append = ""; + var capitalizationIgnoreDict = ['of', 'the']; + for (var x = 0; x < args.length; x++) { + if (x !== 0) { + append += "_"; + } + var match = false; + for(var y in capitalizationIgnoreDict){ + if(args[x] === capitalizationIgnoreDict[y]){ + match = true; + } + } + if(match){ + append += args[x].charAt(0).toLowerCase() + args[x].slice(1); + }else{ + append += args[x].charAt(0).toUpperCase() + args[x].slice(1); + } + } + append = append.replace('\'', '%27'); + appendFinal = append; + var url = 'https://dragalialost.gamepedia.com/' + append.replace(" ", "_"); + request(url, (error, response, html) => { + if (!error && response.statusCode === 200) { + message.channel.startTyping(); + const $ = cheerio.load(html); + const body = $('body'); + const infoArr = {}; + const unitName = $('h1').html(); + var elementColor; + //get unit element + const elem = body.find($('.panel-heading')).children().find($('img')).attr('src'); + //get unit info array + const info = body.find($('.dd-description')).each(function (i, elem) { + infoArr[i] = $(this).text() + }); + //set embed color + switch (elem) { + case 'https://gamepedia.cursecdn.com/dragalialost_gamepedia_en/thumb/5/57/Icon_Element_Flame.png/19px-Icon_Element_Flame.png?version=93869689432f028c9512a1ee3b10f615': + elementColor = "#ff0000"; + break; + case 'https://gamepedia.cursecdn.com/dragalialost_gamepedia_en/thumb/8/80/Icon_Element_Water.png/19px-Icon_Element_Water.png?version=f3dd8ff8dc143d3c60d4b59a62bcf317': + elementColor = "#3366cc"; + break; + case 'https://gamepedia.cursecdn.com/dragalialost_gamepedia_en/thumb/6/62/Icon_Element_Wind.png/19px-Icon_Element_Wind.png?version=0b1d41ad1bd00a810f13e583622b34c0': + elementColor = "#33cc33"; + break; + case 'https://gamepedia.cursecdn.com/dragalialost_gamepedia_en/thumb/0/0d/Icon_Element_Shadow.png/19px-Icon_Element_Shadow.png?version=84a3a06f13b0e4fd51006fdadd97f944': + elementColor = "#660066"; + break; + case 'https://gamepedia.cursecdn.com/dragalialost_gamepedia_en/thumb/1/19/Icon_Element_Light.png/19px-Icon_Element_Light.png?version=e09c55012f71496a9234c49a37d02793': + elementColor = "#ffff66"; + break; + } + //get unit portrait + var image = body.find($('.adv-portrait')).children().find($('img')).attr('src'); + if (image == null) { + var check = body.find($('.tabbertab')).children().find($('img')); + image = check.attr('src'); + if(check.attr('width') === '160' || check.attr('height') === '160'){ + isWeapon = true; + }else if(check.attr('width') === '400' || check.attr('height') === '400'){ + var printCheck = false; + var identifier = body.find($('.mw-normal-catlinks')).children().find($('a')).attr('href'); + if(identifier === '/Category:Wyrmprints'){ + printCheck = true; + } + if(printCheck){ + isPrint = true; + }else{ + isDragon = true; + } + } + else{ + isDragon = true; + } + } + //get unit type + const title = body.find($('.panel-heading div[style]')).text(); + //get unit rarity + var rarity; + if(isWeapon || isPrint){ + rarity = body.find($('.dd-description')).find($('img')).attr('src'); + }else{ + rarity = body.find($('.dd-description div[style]')).find($('img')).last().attr('src'); + } + var stars; + var starsColor; + switch (rarity) { + case "https://gamepedia.cursecdn.com/dragalialost_gamepedia_en/thumb/2/2e/Icon_Rarity_Row_5.png/90px-Icon_Rarity_Row_5.png?version=7b9cbdb84207b0b299ee8ecc364606dc": + stars = 5; + starsColor = "#ffd300"; + break; + case "https://gamepedia.cursecdn.com/dragalialost_gamepedia_en/thumb/9/9e/Icon_Rarity_Row_4.png/90px-Icon_Rarity_Row_4.png?version=a5fa99709cd101b1ac26e6a5101ebde3": + stars = 4; + starsColor = "#f1edff"; + break; + case "https://gamepedia.cursecdn.com/dragalialost_gamepedia_en/thumb/2/21/Icon_Rarity_Row_3.png/90px-Icon_Rarity_Row_3.png?version=9e6ddb955467dfade7f770dce533d5f8": + stars = 3; + starsColor = "#ff9a00"; + break; + case "https://gamepedia.cursecdn.com/dragalialost_gamepedia_en/thumb/6/64/Icon_Rarity_Row_2.png/90px-Icon_Rarity_Row_2.png?version=40d5d39303b0862adde4671185941d4c": + stars = 2; + starsColor = "#01ff9b"; + break; + } + + var rarityStr = ""; + var i; + for (i = 0; i < stars; i++) { + rarityStr = rarityStr + "⭐"; + } + //initialize and set up table parser + cheerioTableparser($); + const unitTable = $('table'); + const data = $(unitTable).parsetable(true, true, true); + // + // + // + //Units + // + // + // + if (!isDragon && !isWeapon && !isPrint) { + //what to execute if the specified argument is a unit + var s1, s2, coab, p1, p2, p3; + try { + s1 = ["**" + data[0][0] + ": **", data[0][1].substring(data[0][1].indexOf('Lv. 3'), data[0][1].length).replace('Lv. 3', '')]; + s2 = ["**" + data[0][2] + ": **", data[0][3].substring(data[0][3].indexOf('Lv. 2'), data[0][3].length).replace('Lv. 2', '')]; + coab = ["**" + data[0][4] + "**", data[0][5].substring(data[0][5].lastIndexOf('\n') + 1)]; + p1 = ["**" + data[0][6] + ": **", data[0][7].substring(data[0][7].lastIndexOf('\t') + 1)]; + p2 = ["**" + data[0][8] + ": **", data[0][9].substring(data[0][9].lastIndexOf('\t') + 1)]; + p3 = ["**" + data[0][10] + ": **", data[0][11].substring(data[0][11].lastIndexOf('\t') + 1)]; + }catch (e) { + message.channel.send('<@!115270563349528579>, help this guy out...'); + message.channel.stopTyping(true); + return; + } + try{ + const embed1 = new Discord.RichEmbed() + .setColor(elementColor) + .setAuthor(unitName + ": " + title + " | " + rarityStr, elem) + .setImage(image) + .addField("ENG VA", infoArr[9], true) + .addField("JP VA", infoArr[10], true) + .addField("---Co-Ability:---", coab) + .addField("-----Skills:-----", s1[0] + s1[1] + "\n" + s2[0] + s2[1]); + const embed2 = new Discord.RichEmbed() + .setColor(elementColor) + .setAuthor(unitName + ": " + title + " " + rarityStr, elem) + .setImage(image) + .addField("ENG VA", infoArr[9], true) + .addField("JP VA", infoArr[10], true) + .addField("---Co-Ability:---", coab) + .addField("-----Ability:-----", p1[0] + p1[1] + "\n" + p2[0] + p2[1] + "\n" + p3[0] + p3[1]); + var pages = [ + embed1, + embed2, + ]; + paginationEmbed(message, pages, ['⏪', '⏩'], 60000); + }catch (e) { + message.channel.send("Try Again"); + } + // + // + // + //Dragons + // + // + // + } else if(!(data[0][1] == null) && isDragon){ + //what to execute if the specified argument is a dragon + var modset, abilities; + if (data[0][4] != "Attack") { + abilities = (data[0][2] + ": **" + data[0][3].substring(data[0][3].lastIndexOf('\t') + 1)) + "\n**" + data[0][4] + ": **" + data[0][5].substring(data[0][5].lastIndexOf('\t') + 1); + modset = [7, 8, 9]; + } + else { + abilities = (data[0][2] + ": **" + data[0][3].substring(data[0][3].lastIndexOf('\t') + 1)); + modset = [5, 6, 7]; + } + var h001 = data[1][modset[0]]; + var h002 = data[1][modset[1]]; + var h003 = data[1][modset[2]]; + if (h001.length < 4) { + h001 += " "; + } + if (h002.length < 4) { + h002 += " "; + } + if (h003.length < 4) { + h003 += " "; + } + var date; + //console.log(infoArr[4]); + var today = new Date().getDay(); + switch (infoArr[4]) { + case " Juicy Meat": + date = "Monday"; + break; + case " Kaleidoscope": + date = "Tuesday"; + break; + case " Floral Circlet": + date = "Wednesday"; + break; + case " Compelling Book": + date = "Thursday"; + break; + case " Mana Essence": + date = "Friday"; + break; + } + var food = infoArr[4]; + switch (date) { + case "Monday": if (today === 1) {food += " 👑";}break; + case "Tuesday": if (today === 2) {food += " 👑";}break; + case "Wednesday": if (today === 3) {food += " 👑";}break; + case "Thursday": if (today === 4) {food += " 👑";}break; + case "Friday": if (today === 5) {food += " 👑";}break; + case "Saturday": if (today === 6) {food += " 👑";}break; + case "Sunday": if (today === 7) {food += " 👑";}break; + } + const embed = new Discord.RichEmbed() + .setColor(elementColor) + .setAuthor(unitName + ": " + title + " | " + rarityStr, elem) + .setImage(image) + //.setThumbnail(rarity) + .addField("Favorite gift", food, true) + .addField("Feeding Day:", date, true) + .addField("-----Skill:-----", "**" + data[0][0] + ": **" + data[0][1].substring(data[0][1].indexOf('Lv. 2'), data[0][1].length).replace('Lv. 2', '')) + .addField("----Ability:----", "**" + abilities) + .addField("---Modifiers:---", "```╔═════════╦══════════╦═════════╗\n" + + "║ Attack ║ Mod ║ #Hits ║\n" + + "╠═════════╬══════════╬═════════╣\n" + + "║ Combo1 ║ " + h001 + " ║ " + data[2][modset[0]] + " ║\n" + + "║ Combo2 ║ " + h002 + " ║ " + data[2][modset[1]] + " ║\n" + + "║ Combo3 ║ " + h003 + " ║ " + data[2][modset[2]] + " ║\n" + + "╚═════════╩══════════╩═════════╝```"); + message.channel.send({embed}) + } + // + // + // + //Weapons + // + // + // + else if(isWeapon){ + try{ + var treeLocation; + var statArr; + for(var x in data) { + for(var y in data[x]){ + /* + if(data[x][y].split('\n')[0] === unitName){ + treeLocation = data[x][y]; + }*/ + var temp = data[x][y].split('\n'); + for(var z in temp){ + if(temp[z] === unitName){ + treeLocation = data[x][y]; + } + } + } + } + var treeInfo = treeLocation.split(unitName); + for(x in treeInfo){ + if(treeInfo[x][0] === '\n'){ + statArr = treeInfo[x].split('\n'); + } + } + var isVoid = true; + var HP = statArr[1].split(":")[1]; + var STR = statArr[2].split(":")[1]; + if(statArr[4].split(":")[0] !== "Abilities"){ + abilities = statArr[5].split(", "); + }else{ + abilities = statArr[4].split(", "); + } + var abilitiesCleanedStage1 = []; + var abilitiesCleanedFinal = []; + if(abilities[1] !== "None"){ + abilitiesCleanedStage1.push(abilities[0].substring(abilities[0].indexOf("Abilities: ") + 12, abilities[0].length).split("\n").join("")); + try{ + abilitiesCleanedStage1.push(abilities[1].split("\n").join("")); + }catch(e){ + isVoid = false; + } + for(x in abilitiesCleanedStage1){ + var temp = abilitiesCleanedStage1[x].split('Lv. '); + var tempOutput = "**" + temp[0] + "** Lv. " + temp[1]; + abilitiesCleanedFinal.push(tempOutput); + } + } + if(!isVoid){ + const embed = new Discord.RichEmbed() + .setColor(elementColor) + .setAuthor(unitName + " | Core Weapon | " + rarityStr, elem) + .setThumbnail(image) + .addField('HP', HP, true) + .addField('STR', STR, true) + .addField("-----Skill:-----", "**" + data[0][0] + ": **" + data[0][1].substring(data[0][1].indexOf('Lv. 2'), data[0][1].length).replace('Lv. 2', '')); + message.channel.send({embed}) + }else{ + const embed = new Discord.RichEmbed() + .setColor(elementColor) + .setAuthor(unitName + " | Void Weapon | " + rarityStr, elem) + .setThumbnail(image) + .addField('HP', HP, true) + .addField('STR', STR, true) + .addField('-----Skill:-----', abilitiesCleanedFinal.join("\n")); + message.channel.send({embed}); + } + }catch (e) { + message.channel.send(":p"); + } + } + else if(isPrint){ + var refinedImage = body.find($('.tabbertab')).children().find($('img')).last().attr('src'); + var printName = unitName.replace("'", "'").replace("_", " "); + var HP = infoArr[0]; + var STR = infoArr[1]; + var isName = true; + var skills = []; + for(var l = 0; l < (data[0].length/2); l++){ + skills.push([]); + } + var count = 0; + for(x in data[0]){ + //console.log(x + " : " + data[0][x]); + if(isName){ + if(data[0][x].includes('(Event)')){ + skills[count].push(data[0][x].substring(0, data[0][x].indexOf('(Event)'))); + }else{ + skills[count].push(data[0][x]); + } + isName = !isName; + }else{ + skills[count].push(data[0][x].substring(data[0][x].lastIndexOf('\t') + 1, data[0][x].length)); + isName = !isName; + count++; + } + } + var skillsOut = ""; + for(x in skills){ + var isFirst = true; + for(y in skills[x]){ + if(isFirst){ + var append = "**" + skills[x][y] + ": **"; + skillsOut += append; + isFirst = false; + } + else{ + skillsOut += skills[x][y]; + skillsOut += '\n'; + } + } + } + try{ + const embed = new Discord.RichEmbed() + .setColor(starsColor) + .setAuthor(printName + " | " + rarityStr, elem) + .addField('HP', HP, true) + .addField('STR', STR, true) + .addField('-----Skill:-----', skillsOut) + .setImage(image); + const embed2 = new Discord.RichEmbed() + .setColor(starsColor) + .setAuthor(printName + " | " + rarityStr, elem) + .addField('HP', HP, true) + .addField('STR', STR, true) + .addField('-----Skill:-----', skillsOut) + .setImage(refinedImage); + var pages = [ + embed, + embed2, + ]; + paginationEmbed(message, pages, ['⏪', '⏩'], 60000); + }catch (e) { + message.channel.send("Contact Antnee"); + } + } + if(data[0][1] == null){ + message.channel.send("The information for the unit you've requested is not ready yet."); + } + message.channel.stopTyping(true); + } + }); + } + }catch (e) { + message.channel.send('<@!115270563349528579>, help this guy out...'); + } + console.log(`DRAG || ${message.author.username} requested ${appendFinal}`); + }, +}; + diff --git a/TempCommandStorage/help.js b/TempCommandStorage/help.js new file mode 100644 index 0000000..a4650a4 --- /dev/null +++ b/TempCommandStorage/help.js @@ -0,0 +1,15 @@ +const Discord = require('discord.js'); +module.exports = { + name: 'helpt', + description: 'help', + execute(message, args) { + const embed = new Discord.RichEmbed() + .setColor("BLUE") + .setAuthor("Commands") + .addField(">drag", "Returns information about any Dragalia Lost Unit, Weapon, or Dragon.") + .addField(">pm", "Returns information about any Pokemon Masters sync pair (UNDER CONSTRUCTION).") + .addField(">poke", "Returns information about any pokemon.") + .addField(">flip", "Flip a coin."); + message.channel.send({embed}) + }, +}; \ No newline at end of file diff --git a/TempCommandStorage/masters.js b/TempCommandStorage/masters.js new file mode 100644 index 0000000..1c50b91 --- /dev/null +++ b/TempCommandStorage/masters.js @@ -0,0 +1,346 @@ +const cheerio = require('cheerio'); +const request = require('request'); +const Discord = require('discord.js'); +const cheerioTableparser = require('cheerio-tableparser'); +const paginationEmbed = require('discord.js-pagination'); +module.exports = { + name: 'pm', + description: 'Masters', + execute(message, args) { + console.log("PKMAS || " + message.author.username + " has requested " + args.join(" ")); + var url = 'https://www.serebii.net/pokemonmasters/syncpairs/' + args[0].toLowerCase() + '.shtml'; + request(url, (error, response, html) => { + if (!error && response.statusCode === 200) { + const $ = cheerio.load(html); + cheerioTableparser($); + const body = $('body'); + const general = body.find($('.tab')); + const data = $(general).parsetable(true,true,true); + var name = data[0]; + var isSygna = false; + if(name[33] && name[32]){ + if(name[33].includes("Sygna") || name[32].includes("Sygna")){ + isSygna = true; + }if(name[33].includes("Mega") || name[32].includes("Mega")){ + isSygna = true; + } + } + var trainerImage = "https://www.serebii.net/pokemonmasters/syncpairs/" + general.find('img').attr('src'); + const pokeInfo = body.find($('.cen')); + const pokeData = $(pokeInfo).parsetable(true,true,true); + var typeImage = "https://www.serebii.net/" + pokeInfo.find('img').attr('src'); + // + //code block to handle getting and formatting the unit passives + // + var passiveIndexes = findPassiveIndex(name); + var passivesOut = []; + for(var j in passiveIndexes){ + var passives = name[passiveIndexes[j]]; + var re = /[^A-Z\s]([A-Z])[^A-Z\s]/g; + while ((match = re.exec(passives)) !== null) { + passives = passives.substring(0,match.index+1) + "\n" + passives.substring(match.index+1,passives.length+1); + } + var passivearray = passives.split("\n"); + for(x in passivearray){ + var temper = passivearray[x].split(":"); + passivearray[x] = "**" + temper[0] + ":**" + temper[1]; + } + passives = passivearray.join("\n"); + passivesOut.push(passives); + } + + // + //code block to handle getting move and sync move information + // + var isFirstNameElem = true; + var isSecondNameElem = false; + var isThirdNameElem = false; + var moves = [[],[],[],[]]; + var moves2 = [[],[],[],[]]; + var moves3 = [[],[],[],[]]; + for(var x in name){ + var count; + var index; + if(name[x] === "Name" && isFirstNameElem && name[parseInt(x)-1] !== "Sync Moves" && name[x]){ + count = 1; + index = parseInt(x); + for(var i = 0; i < moves.length; i++){ + moves[i].push("**" + name[index + count] + ":**"); + if(data[3][index + count]){ + moves[i].push("Power: " + data[3][index + count] + " **|** " + "Accuracy: " + data[4][index + count] + " **|** " + "Cost: " + data[5][index + count] + " **|** " + "Target: " + data[6][index + count]); + }else if(data[5][index + count]){ + moves[i].push("Cost: " + data[5][index + count] + " **|** " + "Target: " + data[6][index + count]); + }else if(data[5][index + count] === ""){ + moves[i].push("Target: " + data[6][index + count]); + } + moves[i].push(data[1][index + count + 1]); + count = count + 2; + } + isFirstNameElem = false; + } + if(name[x] === "Name" && isSecondNameElem && name[parseInt(x)-1] !== "Sync Moves" && name[x]) { + count = 1; + index = parseInt(x); + for(i = 0; i < moves.length; i++){ + moves2[i].push("**" + name[index + count] + ":**"); + if(data[3][index + count]){ + moves2[i].push("Power: " + data[3][index + count] + " **|** " + "Accuracy: " + data[4][index + count] + " **|** " + "Cost: " + data[5][index + count] + " **|** " + "Target: " + data[6][index + count]); + }else if(data[5][index + count]){ + moves2[i].push("Cost: " + data[5][index + count] + " **|** " + "Target: " + data[6][index + count]); + }else if(data[5][index + count] === ""){ + moves2[i].push("Target: " + data[6][index + count]); + } + moves2[i].push(data[1][index + count + 1]); + count = count + 2; + } + isSecondNameElem = false; + } + if(name[x] === "Name" && isThirdNameElem && name[parseInt(x)-1] !== "Sync Moves" && name[x]) { + count = 1; + index = parseInt(x); + for(i = 0; i < moves.length; i++){ + moves3[i].push("**" + name[index + count] + ":**"); + if(data[3][index + count]){ + moves3[i].push("Power: " + data[3][index + count] + " **|** " + "Accuracy: " + data[4][index + count] + " **|** " + "Cost: " + data[5][index + count] + " **|** " + "Target: " + data[6][index + count]); + }else if(data[5][index + count]){ + moves3[i].push("Cost: " + data[5][index + count] + " **|** " + "Target: " + data[6][index + count]); + }else if(data[5][index + count] === ""){ + moves3[i].push("Target: " + data[6][index + count]); + } + moves3[i].push(data[1][index + count + 1]); + count = count + 2; + } + isThirdNameElem = false; + } + if(!isFirstNameElem){ + isSecondNameElem = true; + if(!isFirstNameElem && !isSecondNameElem){ + isThirdNameElem = true; + if(!isFirstNameElem && !isSecondNameElem && !isThirdNameElem){ + //eventual 4th case + } + } + } + } + var movesOut = ""; + for(x in moves){ + var movesTemp = moves[x].join("\n") + "\n"; + movesOut = movesOut + movesTemp; + } + var movesOut2 = ""; + for(x in moves2){ + var movesTemp2 = moves2[x].join("\n") + "\n"; + movesOut2 = movesOut2 + movesTemp2; + } + var movesOut3 = ""; + for(x in moves3){ + var movesTemp3 = moves3[x].join("\n") + "\n"; + movesOut3 = movesOut3 + movesTemp3; + } + + if(!isSygna){ + movesOut2 = movesOut; + movesOut3 = movesOut; + } + + var sync = []; + var syncOut; + var syncLocations = []; + var sync1 = []; + var syncOut1; + var sync2 = []; + var syncOut2; + for(x in name){ + if(name[x] === "Sync Moves"){ + syncLocations.push(parseInt(x)+2); + } + } + sync.push("**" + name[syncLocations[0] + 1] + "**"); + sync.push("Power: " + data[3][syncLocations[0]] + " **|** " + "Target: " + data[4][syncLocations[0]]); + sync.push(data[3][syncLocations[0] + 1]); + syncOut = sync.join("\n"); + sync1.push("**" + name[syncLocations[1] + 1] + "**"); + sync1.push("Power: " + data[3][syncLocations[1]] + " **|** " + "Target: " + data[4][syncLocations[1]]); + sync1.push(data[3][syncLocations[1] + 1]); + syncOut1 = sync1.join("\n"); + //console.log(sync1); + sync2.push("**" + name[syncLocations[2] + 1] + "**"); + sync2.push("Power: " + data[3][syncLocations[2]] + " **|** " + "Target: " + data[4][syncLocations[2]]); + sync2.push(data[3][syncLocations[2] + 1]); + syncOut2 = sync2.join("\n"); + //console.log(sync2); + //console.log(movesOut1); + /* + var debugindex = 0; + for(var x in data[debugindex]) { + console.log(x + " : " + data[debugindex][x]); + } + */ + var namesArr = []; + if(name[6] !== "Picture"){ + namesArr.push(name[6]); + namesArr.push(name[33]); + namesArr.push(name[60]); + } + else{ + namesArr.push(name[5]); + namesArr.push(name[32]); + namesArr.push(name[59]); + } + // + //Get Stats + // + var HP = buildStatArray("HP", data[0]); + var ATK = buildStatArray("Attack", data[1]); + var DEF = buildStatArray("Defense", data[2]); + var SPATK = buildStatArray("Sp. Atk", data[3]); + var SPDEF = buildStatArray("Sp. Def", data[4]); + var SPD = buildStatArray("Speed", data[5]); + try{ + var embed; var embed2; var embed3; + try{ + embed = new Discord.RichEmbed() + .setAuthor(namesArr[0]) + .setImage(trainerImage) + .setThumbnail(typeImage) + //.addField("Weakness","") + .addField("HP",HP[0],true) + .addField("ATK",ATK[0],true) + .addField("DEF",DEF[0],true) + .addField("SPATK",SPATK[0],true) + .addField("SPDEF",SPDEF[0],true) + .addField("SPD",SPD[0],true) + .addField("---Passives---", passivesOut[0]) + .addField("---Moves---", movesOut) + .addField("---Sync Move---", syncOut) + .setColor(getColor(typeImage)) + .setFooter("Stats reflect their values at max level (UNDER CONSTRUCTION)"); + }catch (e) { + + } + try{ + embed2 = new Discord.RichEmbed() + .setAuthor(namesArr[1]) + .setImage(trainerImage) + .setThumbnail(typeImage) + //.addField("Weakness","") + .addField("HP",HP[1],true) + .addField("ATK",ATK[1],true) + .addField("DEF",DEF[1],true) + .addField("SPATK",SPATK[1],true) + .addField("SPDEF",SPDEF[1],true) + .addField("SPD",SPD[1],true) + .addField("---Passives---", passivesOut[1]) + .addField("---Moves---", movesOut2) + .addField("---Sync Move---", syncOut1) + .setColor(getColor(typeImage)) + .setFooter("Stats reflect their values at max level (UNDER CONSTRUCTION)"); + }catch (e) { + + } + try{ + embed3 = new Discord.RichEmbed() + .setAuthor(namesArr[2]) + .setImage(trainerImage) + .setThumbnail(typeImage) + //.addField("Weakness","") + .addField("HP",HP[2],true) + .addField("ATK",ATK[2],true) + .addField("DEF",DEF[2],true) + .addField("SPATK",SPATK[2],true) + .addField("SPDEF",SPDEF[2],true) + .addField("SPD",SPD[2],true) + .addField("---Passives---", passivesOut[2]) + .addField("---Moves---", movesOut3) + .addField("---Sync Move---", syncOut2) + .setColor(getColor(typeImage)) + .setFooter("Stats reflect their values at max level (UNDER CONSTRUCTION)"); + }catch (e) { + + } + var pages = []; + if(sync2[0] !== "**undefined**"){ + pages = [ + embed, + embed2, + embed3 + ]; + paginationEmbed(message, pages, ['⏪', '⏩'], 60000); + }else if(sync1[0] !== "**undefined**"){ + pages = [ + embed, + embed2, + ]; + paginationEmbed(message, pages, ['⏪', '⏩'], 60000); + }else{ + message.channel.send({embed}); + } + }catch (e) { + message.channel.send(`Sorry ${message.author.username}, but that trainer isn't in the game yet.`) + } + }else{ + message.channel.send(`Sorry ${message.author.username}, but that trainer isn't in the game yet.`) + } + }) + }, +}; +function getColor(type){ + var elementColor; + switch (type.substring(type.lastIndexOf("/",type.lastIndexOf("."))).replace("/","").replace(".gif","")) { + case 'normal': + elementColor = "#ffffff"; break; + case 'fire': + elementColor = "#ff0000"; break; + case 'water': + elementColor = "#4286f4"; break; + case 'electric': + elementColor = "#fffa00"; break; + case 'grass': + elementColor = "#1daf0f"; break; + case 'ice': + elementColor = "#00ffe5"; break; + case 'fighting': + elementColor = "#7a3b3b"; break; + case 'poison': + elementColor = "#9a06aa"; break; + case 'ground': + elementColor = "#351818"; break; + case 'flying': + elementColor = "#a2c1c1"; break; + case 'psychic': + elementColor = "#b56cab"; break; + case 'bug': + elementColor = "#87c69f"; break; + case 'rock': + elementColor = "#9e7356"; break; + case 'ghost': + elementColor = "#65558c"; break; + case 'dragon': + elementColor = "#00487f"; break; + case 'dark': + elementColor = "#23021e"; break; + case 'steel': + elementColor = "#6b6b6b"; break; + case 'fairy': + elementColor = "#ffb7d7"; break; + } + return elementColor; +} +function buildStatArray(stat, data){ + var stats = []; + for(var x in data){ + if(data[x] === stat){ + stats.push(data[parseInt(x)+1]); + } + } + return stats; +} +function findPassiveIndex(data){ + var passiveIndexes = []; + for(var x in data){ + if(data[x] === "Passive Skills"){ + passiveIndexes.push(parseInt(x) + 1); + } + } + return passiveIndexes; +} diff --git a/TempCommandStorage/poke.js b/TempCommandStorage/poke.js new file mode 100644 index 0000000..ae153c6 --- /dev/null +++ b/TempCommandStorage/poke.js @@ -0,0 +1,1019 @@ +const cheerio = require('cheerio'); +const request = require('request'); +const Discord = require('discord.js'); +const cheerioTableparser = require('cheerio-tableparser'); +module.exports = { + name: 'poke', + description: 'Parses Serebii.net', + execute(message, args) { + var dexfinal; + if(args[0] === "random"){ + var dexentry = Math.floor(Math.random() * 1000)- 193; + if(dexentry.length === 1){ + dexentry = "00" + dexentry; + }else if(dexentry.length === 2){ + dexentry = "0" + dexentry; + } + dexfinal = dexentry; + }else{ + var name = args[0][0].toLocaleUpperCase() + args[0].substring(1,args[0].length); + dexfinal = dexnumMap[name]; + } + console.log(`POKE || ${message.author.username} requested ${args[0]}`); + url = 'https://serebii.net/pokedex-sm/' + dexfinal + '.shtml'; + request(url, (error, response, html) => { + if (!error && response.statusCode === 200) { + const $ = cheerio.load(html); + const body = $('body'); + var title = $("title").text(); + var name = title.split(" - ")[0]; + cheerioTableparser($); + const dex = body.find($('.dextable')); + const types = []; + const type = body.find($('.cen')).find('img').each(function (i, elem) { + types[i] = $(this).attr('src'); + }); + var typesToPrint; + var singletype = types[0].substring(types[0].lastIndexOf("/",types[0].lastIndexOf("."))).replace("/","").replace(".gif",""); + var secondtype = types[1].substring(types[1].lastIndexOf("/",types[1].lastIndexOf("."))).replace("/","").replace(".gif",""); + if(types[1].indexOf(".png") === -1){ + typesToPrint = singletype[0].toLocaleUpperCase() + singletype.substring(1, singletype.length) + " / " + secondtype[0].toLocaleUpperCase() + secondtype.substring(1, secondtype.length); + } + else{ + typesToPrint = singletype[0].toLocaleUpperCase() + singletype.substring(1, singletype.length); + } + if(singletype === secondtype){ + typesToPrint = singletype[0].toLocaleUpperCase() + singletype.substring(1, singletype.length); + } + var elementColor; + switch (types[0].substring(types[0].lastIndexOf("/",types[0].lastIndexOf("."))).replace("/","").replace(".gif","")) { + case 'normal': + elementColor = "#ffffff"; break; + case 'fire': + elementColor = "#ff0000"; break; + case 'water': + elementColor = "#4286f4"; break; + case 'electric': + elementColor = "#fffa00"; break; + case 'grass': + elementColor = "#1daf0f"; break; + case 'ice': + elementColor = "#00ffe5"; break; + case 'fighting': + elementColor = "#7a3b3b"; break; + case 'poison': + elementColor = "#9a06aa"; break; + case 'ground': + elementColor = "#351818"; break; + case 'flying': + elementColor = "#a2c1c1"; break; + case 'psychic': + elementColor = "#b56cab"; break; + case 'bug': + elementColor = "#87c69f"; break; + case 'rock': + elementColor = "#9e7356"; break; + case 'ghost': + elementColor = "#65558c"; break; + case 'dragon': + elementColor = "#00487f"; break; + case 'dark': + elementColor = "#23021e"; break; + case 'steel': + elementColor = "#6b6b6b"; break; + case 'fairy': + elementColor = "#ffb7d7"; break; + } + const image = "https://serebii.net/" + body.find($('.dextab')).find('img').attr('src'); + const thumb = "https://pokemon-trainer.com/images/sprite/xyorasani/"+dexfinal+".gif"; + const portrait = "https://serebii.net/sunmoon/pokemon/"+dexfinal+".png"; + const data = $(dex).parsetable(true,true,true); + for(var x in data[0]){ + //console.log(x + " : " + data[0][x]); + } + var abilities; + var dexnum = data[1][7]; + var classification = ""; + var stats = []; + var weak = []; + var strong = []; + var immune = []; + var bst = 0; + var statAdded = false; + var typesAdded = false; + for(var z = 0; z < 18; z ++){ + statAdded = false; + typesAdded = false; + for(var v = 0; v < data[0].length; v++){ + if(!statAdded && (z > 1 && z < 8) && data[z][v] === "Stats"){ + //console.log("(" + z + "," + v+2 + ") : " + data[z][v+2]); + var temp = data[z][parseInt(v)+2]; + stats.push(temp); + bst += parseInt(temp); + statAdded = true; + } + if(data[z][v] === "Classification"){ + classification = data[z][v+1]; + abilities = data[z][v+2]; + } + if(!typesAdded && data[z][v] === "Damage Taken"){ + var temper = data[z][v+2]; + if(temper === "*0.5"){ + strong.push(idToType(z)); + typesAdded = true; + } + if(temper === "*2"){ + weak.push(idToType(z)); + typesAdded = true; + } + if(temper === "*4"){ + weak.push("**" + idToType(z) + "**"); + typesAdded = true; + } + if(temper === "*0"){ + immune.push(idToType(z)); + typesAdded = true; + } + } + } + } + //console.log(abilities) + var ability = abilities.split(": "); + if(!weak.length){ + weak.push("None"); + } + if(!strong.length){ + strong.push("None"); + } + if(!immune.length){ + immune.push("None"); + } + /* + console.log(dexnum + ": " + name + " the " + classification + "\n" + + "weak to: " + weak.join(", ") +"\n"+ + "resists: " + strong.join(", ") +"\n"+ + "immune: " + immune.join(", ") +"\n"+ + "HP " + stats[0] +"\n"+ + "ATK " + stats[1] +"\n"+ + "DEF " + stats[2] +"\n"+ + "SPATK " + stats[3] +"\n"+ + "SPDEF " + stats[4] +"\n"+ + "SPD " + stats[5] +"\n"); + */ + const embed = new Discord.RichEmbed() + .setColor(elementColor) + .setAuthor(dexnum + ": " + name + " the " + classification + " | " + typesToPrint, image) + .setImage(portrait) + //.setThumbnail(thumb) + .addField("Abilities:",ability[1].replace(" - ", ", ")) + .addField("Weak to:",weak.join(", ")) + .addField("Resists:",strong.join(", ")) + .addField("Immune to:",immune.join(", ")) + .addField("HP",stats[0],true) + .addField("ATK",stats[1],true) + .addField("DEF",stats[2],true) + .addField("SPATK",stats[3],true) + .addField("SPDEF",stats[4],true) + .addField("SPD",stats[5],true) + .setFooter("Powered by Serebii.net","https://www.serebii.net/pokedex-sm/icon/251.png"); + message.channel.send({embed}) + } + }); + } +}; +function idToType(id) { + switch (id) { + case 0: return "Normal"; + case 1: return "Fire"; + case 2: return "Water"; + case 3: return "Electric"; + case 4: return "Grass"; + case 5: return "Ice"; + case 6: return "Fighting"; + case 7: return "Poison"; + case 8: return "Ground"; + case 9: return "Flying"; + case 10: return "Psychic"; + case 11: return "Bug"; + case 12: return "Rock"; + case 13: return "Ghost"; + case 14: return "Dragon"; + case 15: return "Dark"; + case 16: return "Steel"; + case 17: return "Fairy"; + } +} + +const dexnumMap = { + "Bulbasaur" : "001", + "Ivysaur" : "002", + "Venusaur" : "003", + "Charmander" : "004", + "Charmeleon" : "005", + "Charizard" : "006", + "Squirtle" : "007", + "Wartortle" : "008", + "Blastoise" : "009", + "Caterpie" : "010", + "Metapod" : "011", + "Butterfree" : "012", + "Weedle" : "013", + "Kakuna" : "014", + "Beedrill" : "015", + "Pidgey" : "016", + "Pidgeotto" : "017", + "Pidgeot" : "018", + "Rattata" : "019", + "Raticate" : "020", + "Spearow" : "021", + "Fearow" : "022", + "Ekans" : "023", + "Arbok" : "024", + "Pikachu" : "025", + "Raichu" : "026", + "Sandshrew" : "027", + "Sandslash" : "028", + "Nidoran-F" : "029", + "Nidorina" : "030", + "Nidoqueen" : "031", + "Nidoran-M" : "032", + "Nidorino" : "033", + "Nidoking" : "034", + "Clefairy" : "035", + "Clefable" : "036", + "Vulpix" : "037", + "Ninetales" : "038", + "Jigglypuff" : "039", + "Wigglytuff" : "040", + "Zubat" : "041", + "Golbat" : "042", + "Oddish" : "043", + "Gloom" : "044", + "Vileplume" : "045", + "Paras" : "046", + "Parasect" : "047", + "Venonat" : "048", + "Venomoth" : "049", + "Diglett" : "050", + "Dugtrio" : "051", + "Meowth" : "052", + "Persian" : "053", + "Psyduck" : "054", + "Golduck" : "055", + "Mankey" : "056", + "Primeape" : "057", + "Growlithe" : "058", + "Arcanine" : "059", + "Poliwag" : "060", + "Poliwhirl" : "061", + "Poliwrath" : "062", + "Abra" : "063", + "Kadabra" : "064", + "Alakazam" : "065", + "Machop" : "066", + "Machoke" : "067", + "Machamp" : "068", + "Bellsprout" : "069", + "Weepinbell" : "070", + "Victreebel" : "071", + "Tentacool" : "072", + "Tentacruel" : "073", + "Geodude" : "074", + "Graveler" : "075", + "Golem" : "076", + "Ponyta" : "077", + "Rapidash" : "078", + "Slowpoke" : "079", + "Slowbro" : "080", + "Magnemite" : "081", + "Magneton" : "082", + "Farfetch'd" : "083", + "Doduo" : "084", + "Dodrio" : "085", + "Seel" : "086", + "Dewgong" : "087", + "Grimer" : "088", + "Muk" : "089", + "Shellder" : "090", + "Cloyster" : "091", + "Gastly" : "092", + "Haunter" : "093", + "Gengar" : "094", + "Onix" : "095", + "Drowzee" : "096", + "Hypno" : "097", + "Krabby" : "098", + "Kingler" : "099", + "Voltorb" : "100", + "Electrode" : "101", + "Exeggcute" : "102", + "Exeggutor" : "103", + "Cubone" : "104", + "Marowak" : "105", + "Hitmonlee" : "106", + "Hitmonchan" : "107", + "Lickitung" : "108", + "Koffing" : "109", + "Weezing" : "110", + "Rhyhorn" : "111", + "Rhydon" : "112", + "Chansey" : "113", + "Tangela" : "114", + "Kangaskhan" : "115", + "Horsea" : "116", + "Seadra" : "117", + "Goldeen" : "118", + "Seaking" : "119", + "Staryu" : "120", + "Starmie" : "121", + "Mr.Mime" : "122", + "Scyther" : "123", + "Jynx" : "124", + "Electabuzz" : "125", + "Magmar" : "126", + "Pinsir" : "127", + "Tauros" : "128", + "Magikarp" : "129", + "Gyarados" : "130", + "Lapras" : "131", + "Ditto" : "132", + "Eevee" : "133", + "Vaporeon" : "134", + "Jolteon" : "135", + "Flareon" : "136", + "Porygon" : "137", + "Omanyte" : "138", + "Omastar" : "139", + "Kabuto" : "140", + "Kabutops" : "141", + "Aerodactyl" : "142", + "Snorlax" : "143", + "Articuno" : "144", + "Zapdos" : "145", + "Moltres" : "146", + "Dratini" : "147", + "Dragonair" : "148", + "Dragonite" : "149", + "Mewtwo" : "150", + "Mew" : "151", + "Chikorita" : "152", + "Bayleef" : "153", + "Meganium" : "154", + "Cyndaquil" : "155", + "Quilava" : "156", + "Typhlosion" : "157", + "Totodile" : "158", + "Croconaw" : "159", + "Feraligatr" : "160", + "Sentret" : "161", + "Furret" : "162", + "Hoothoot" : "163", + "Noctowl" : "164", + "Ledyba" : "165", + "Ledian" : "166", + "Spinarak" : "167", + "Ariados" : "168", + "Crobat" : "169", + "Chinchou" : "170", + "Lanturn" : "171", + "Pichu" : "172", + "Cleffa" : "173", + "Igglybuff" : "174", + "Togepi" : "175", + "Togetic" : "176", + "Natu" : "177", + "Xatu" : "178", + "Mareep" : "179", + "Flaaffy" : "180", + "Ampharos" : "181", + "Bellossom" : "182", + "Marill" : "183", + "Azumarill" : "184", + "Sudowoodo" : "185", + "Politoed" : "186", + "Hoppip" : "187", + "Skiploom" : "188", + "Jumpluff" : "189", + "Aipom" : "190", + "Sunkern" : "191", + "Sunflora" : "192", + "Yanma" : "193", + "Wooper" : "194", + "Quagsire" : "195", + "Espeon" : "196", + "Umbreon" : "197", + "Murkrow" : "198", + "Slowking" : "199", + "Misdreavus" : "200", + "Unown" : "201", + "Wobbuffet" : "202", + "Girafarig" : "203", + "Pineco" : "204", + "Forretress" : "205", + "Dunsparce" : "206", + "Gligar" : "207", + "Steelix" : "208", + "Snubbull" : "209", + "Granbull" : "210", + "Qwilfish" : "211", + "Scizor" : "212", + "Shuckle" : "213", + "Heracross" : "214", + "Sneasel" : "215", + "Teddiursa" : "216", + "Ursaring" : "217", + "Slugma" : "218", + "Magcargo" : "219", + "Swinub" : "220", + "Piloswine" : "221", + "Corsola" : "222", + "Remoraid" : "223", + "Octillery" : "224", + "Delibird" : "225", + "Mantine" : "226", + "Skarmory" : "227", + "Houndour" : "228", + "Houndoom" : "229", + "Kingdra" : "230", + "Phanpy" : "231", + "Donphan" : "232", + "Porygon2" : "233", + "Stantler" : "234", + "Smeargle" : "235", + "Tyrogue" : "236", + "Hitmontop" : "237", + "Smoochum" : "238", + "Elekid" : "239", + "Magby" : "240", + "Miltank" : "241", + "Blissey" : "242", + "Raikou" : "243", + "Entei" : "244", + "Suicune" : "245", + "Larvitar" : "246", + "Pupitar" : "247", + "Tyranitar" : "248", + "Lugia" : "249", + "Ho-oh" : "250", + "Celebi" : "251", + "Treecko" : "252", + "Grovyle" : "253", + "Sceptile" : "254", + "Torchic" : "255", + "Combusken" : "256", + "Blaziken" : "257", + "Mudkip" : "258", + "Marshtomp" : "259", + "Swampert" : "260", + "Poochyena" : "261", + "Mightyena" : "262", + "Zigzagoon" : "263", + "Linoone" : "264", + "Wurmple" : "265", + "Silcoon" : "266", + "Beautifly" : "267", + "Cascoon" : "268", + "Dustox" : "269", + "Lotad" : "270", + "Lombre" : "271", + "Ludicolo" : "272", + "Seedot" : "273", + "Nuzleaf" : "274", + "Shiftry" : "275", + "Taillow" : "276", + "Swellow" : "277", + "Wingull" : "278", + "Pelipper" : "279", + "Ralts" : "280", + "Kirlia" : "281", + "Gardevoir" : "282", + "Surskit" : "283", + "Masquerain" : "284", + "Shroomish" : "285", + "Breloom" : "286", + "Slakoth" : "287", + "Vigoroth" : "288", + "Slaking" : "289", + "Nincada" : "290", + "Ninjask" : "291", + "Shedinja" : "292", + "Whismur" : "293", + "Loudred" : "294", + "Exploud" : "295", + "Makuhita" : "296", + "Hariyama" : "297", + "Azurill" : "298", + "Nosepass" : "299", + "Skitty" : "300", + "Delcatty" : "301", + "Sableye" : "302", + "Mawile" : "303", + "Aron" : "304", + "Lairon" : "305", + "Aggron" : "306", + "Meditite" : "307", + "Medicham" : "308", + "Electrike" : "309", + "Manectric" : "310", + "Plusle" : "311", + "Minun" : "312", + "Volbeat" : "313", + "Illumise" : "314", + "Roselia" : "315", + "Gulpin" : "316", + "Swalot" : "317", + "Carvanha" : "318", + "Sharpedo" : "319", + "Wailmer" : "320", + "Wailord" : "321", + "Numel" : "322", + "Camerupt" : "323", + "Torkoal" : "324", + "Spoink" : "325", + "Grumpig" : "326", + "Spinda" : "327", + "Trapinch" : "328", + "Vibrava" : "329", + "Flygon" : "330", + "Cacnea" : "331", + "Cacturne" : "332", + "Swablu" : "333", + "Altaria" : "334", + "Zangoose" : "335", + "Seviper" : "336", + "Lunatone" : "337", + "Solrock" : "338", + "Barboach" : "339", + "Whiscash" : "340", + "Corphish" : "341", + "Crawdaunt" : "342", + "Baltoy" : "343", + "Claydol" : "344", + "Lileep" : "345", + "Cradily" : "346", + "Anorith" : "347", + "Armaldo" : "348", + "Feebas" : "349", + "Milotic" : "350", + "Castform" : "351", + "Kecleon" : "352", + "Shuppet" : "353", + "Banette" : "354", + "Duskull" : "355", + "Dusclops" : "356", + "Tropius" : "357", + "Chimecho" : "358", + "Absol" : "359", + "Wynaut" : "360", + "Snorunt" : "361", + "Glalie" : "362", + "Spheal" : "363", + "Sealeo" : "364", + "Walrein" : "365", + "Clamperl" : "366", + "Huntail" : "367", + "Gorebyss" : "368", + "Relicanth" : "369", + "Luvdisc" : "370", + "Bagon" : "371", + "Shelgon" : "372", + "Salamence" : "373", + "Beldum" : "374", + "Metang" : "375", + "Metagross" : "376", + "Regirock" : "377", + "Regice" : "378", + "Registeel" : "379", + "Latias" : "380", + "Latios" : "381", + "Kyogre" : "382", + "Groudon" : "383", + "Rayquaza" : "384", + "Jirachi" : "385", + "Deoxys" : "386", + "Turtwig" : "387", + "Grotle" : "388", + "Torterra" : "389", + "Chimchar" : "390", + "Monferno" : "391", + "Infernape" : "392", + "Piplup" : "393", + "Prinplup" : "394", + "Empoleon" : "395", + "Starly" : "396", + "Staravia" : "397", + "Staraptor" : "398", + "Bidoof" : "399", + "Bibarel" : "400", + "Kricketot" : "401", + "Kricketune" : "402", + "Shinx" : "403", + "Luxio" : "404", + "Luxray" : "405", + "Budew" : "406", + "Roserade" : "407", + "Cranidos" : "408", + "Rampardos" : "409", + "Shieldon" : "410", + "Bastiodon" : "411", + "Burmy" : "412", + "Wormadam" : "413", + "Mothim" : "414", + "Combee" : "415", + "Vespiquen" : "416", + "Pachirisu" : "417", + "Buizel" : "418", + "Floatzel" : "419", + "Cherubi" : "420", + "Cherrim" : "421", + "Shellos" : "422", + "Gastrodon" : "423", + "Ambipom" : "424", + "Drifloon" : "425", + "Drifblim" : "426", + "Buneary" : "427", + "Lopunny" : "428", + "Mismagius" : "429", + "Honchkrow" : "430", + "Glameow" : "431", + "Purugly" : "432", + "Chingling" : "433", + "Stunky" : "434", + "Skuntank" : "435", + "Bronzor" : "436", + "Bronzong" : "437", + "Bonsly" : "438", + "MimeJr. " : "439", + "Happiny" : "440", + "Chatot" : "441", + "Spiritomb" : "442", + "Gible" : "443", + "Gabite" : "444", + "Garchomp" : "445", + "Munchlax" : "446", + "Riolu" : "447", + "Lucario" : "448", + "Hippopotas" : "449", + "Hippowdon" : "450", + "Skorupi" : "451", + "Drapion" : "452", + "Croagunk" : "453", + "Toxicroak" : "454", + "Carnivine" : "455", + "Finneon" : "456", + "Lumineon" : "457", + "Mantyke" : "458", + "Snover" : "459", + "Abomasnow" : "460", + "Weavile" : "461", + "Magnezone" : "462", + "Lickilicky" : "463", + "Rhyperior" : "464", + "Tangrowth" : "465", + "Electivire" : "466", + "Magmortar" : "467", + "Togekiss" : "468", + "Yanmega" : "469", + "Leafeon" : "470", + "Glaceon" : "471", + "Gliscor" : "472", + "Mamoswine" : "473", + "Porygon-Z" : "474", + "Gallade" : "475", + "Probopass" : "476", + "Dusknoir" : "477", + "Froslass" : "478", + "Rotom" : "479", + "Uxie" : "480", + "Mesprit" : "481", + "Azelf" : "482", + "Dialga" : "483", + "Palkia" : "484", + "Heatran" : "485", + "Regigigas" : "486", + "Giratina" : "487", + "Cresselia" : "488", + "Phione" : "489", + "Manaphy" : "490", + "Darkrai" : "491", + "Shaymin" : "492", + "Arceus" : "493", + "Victini" : "494", + "Snivy" : "495", + "Servine" : "496", + "Serperior" : "497", + "Tepig" : "498", + "Pignite" : "499", + "Emboar" : "500", + "Oshawott" : "501", + "Dewott" : "502", + "Samurott" : "503", + "Patrat" : "504", + "Watchog" : "505", + "Lillipup" : "506", + "Herdier" : "507", + "Stoutland" : "508", + "Purrloin" : "509", + "Liepard" : "510", + "Pansage" : "511", + "Simisage" : "512", + "Pansear" : "513", + "Simisear" : "514", + "Panpour" : "515", + "Simipour" : "516", + "Munna" : "517", + "Musharna" : "518", + "Pidove" : "519", + "Tranquill" : "520", + "Unfezant" : "521", + "Blitzle" : "522", + "Zebstrika" : "523", + "Roggenrola" : "524", + "Boldore" : "525", + "Gigalith" : "526", + "Woobat" : "527", + "Swoobat" : "528", + "Drilbur" : "529", + "Excadrill" : "530", + "Audino" : "531", + "Timburr" : "532", + "Gurdurr" : "533", + "Conkeldurr" : "534", + "Tympole" : "535", + "Palpitoad" : "536", + "Seismitoad" : "537", + "Throh" : "538", + "Sawk" : "539", + "Sewaddle" : "540", + "Swadloon" : "541", + "Leavanny" : "542", + "Venipede" : "543", + "Whirlipede" : "544", + "Scolipede" : "545", + "Cottonee" : "546", + "Whimsicott" : "547", + "Petilil" : "548", + "Lilligant" : "549", + "Basculin" : "550", + "Sandile" : "551", + "Krokorok" : "552", + "Krookodile" : "553", + "Darumaka" : "554", + "Darmanitan" : "555", + "Maractus" : "556", + "Dwebble" : "557", + "Crustle" : "558", + "Scraggy" : "559", + "Scrafty" : "560", + "Sigilyph" : "561", + "Yamask" : "562", + "Cofagrigus" : "563", + "Tirtouga" : "564", + "Carracosta" : "565", + "Archen" : "566", + "Archeops" : "567", + "Trubbish" : "568", + "Garbodor" : "569", + "Zorua" : "570", + "Zoroark" : "571", + "Minccino" : "572", + "Cinccino" : "573", + "Gothita" : "574", + "Gothorita" : "575", + "Gothitelle" : "576", + "Solosis" : "577", + "Duosion" : "578", + "Reuniclus" : "579", + "Ducklett" : "580", + "Swanna" : "581", + "Vanillite" : "582", + "Vanillish" : "583", + "Vanilluxe" : "584", + "Deerling" : "585", + "Sawsbuck" : "586", + "Emolga" : "587", + "Karrablast" : "588", + "Escavalier" : "589", + "Foongus" : "590", + "Amoonguss" : "591", + "Frillish" : "592", + "Jellicent" : "593", + "Alomomola" : "594", + "Joltik" : "595", + "Galvantula" : "596", + "Ferroseed" : "597", + "Ferrothorn" : "598", + "Klink" : "599", + "Klang" : "600", + "Klinklang" : "601", + "Tynamo" : "602", + "Eelektrik" : "603", + "Eelektross" : "604", + "Elgyem" : "605", + "Beheeyem" : "606", + "Litwick" : "607", + "Lampent" : "608", + "Chandelure" : "609", + "Axew" : "610", + "Fraxure" : "611", + "Haxorus" : "612", + "Cubchoo" : "613", + "Beartic" : "614", + "Cryogonal" : "615", + "Shelmet" : "616", + "Accelgor" : "617", + "Stunfisk" : "618", + "Mienfoo" : "619", + "Mienshao" : "620", + "Druddigon" : "621", + "Golett" : "622", + "Golurk" : "623", + "Pawniard" : "624", + "Bisharp" : "625", + "Bouffalant" : "626", + "Rufflet" : "627", + "Braviary" : "628", + "Vullaby" : "629", + "Mandibuzz" : "630", + "Heatmor" : "631", + "Durant" : "632", + "Deino" : "633", + "Zweilous" : "634", + "Hydreigon" : "635", + "Larvesta" : "636", + "Volcarona" : "637", + "Cobalion" : "638", + "Terrakion" : "639", + "Virizion" : "640", + "Tornadus" : "641", + "Thundurus" : "642", + "Reshiram" : "643", + "Zekrom" : "644", + "Landorus" : "645", + "Kyurem" : "646", + "Keldeo" : "647", + "Meloetta" : "648", + "Genesect" : "649", + "s:650-721" : "Kalo", + "Chespin" : "650", + "Quilladin" : "651", + "Chesnaught" : "652", + "Fennekin" : "653", + "Braixen" : "654", + "Delphox" : "655", + "Froakie" : "656", + "Frogadier" : "657", + "Greninja" : "658", + "Bunnelby" : "659", + "Diggersby" : "660", + "Fletchling" : "661", + "Fletchinder" : "662", + "Talonflame" : "663", + "Scatterbug" : "664", + "Spewpa" : "665", + "Vivillon" : "666", + "Litleo" : "667", + "Pyroar" : "668", + "Flabebe" : "669", + "Floette" : "670", + "Florges" : "671", + "Skiddo" : "672", + "Gogoat" : "673", + "Pancham" : "674", + "Pangoro" : "675", + "Furfrou" : "676", + "Espurr" : "677", + "Meowstic" : "678", + "Honedge" : "679", + "Doublade" : "680", + "Aegislash" : "681", + "Spritzee" : "682", + "Aromatisse" : "683", + "Swirlix" : "684", + "Slurpuff" : "685", + "Inkay" : "686", + "Malamar" : "687", + "Binacle" : "688", + "Barbaracle" : "689", + "Skrelp" : "690", + "Dragalge" : "691", + "Clauncher" : "692", + "Clawitzer" : "693", + "Helioptile" : "694", + "Heliolisk" : "695", + "Tyrunt" : "696", + "Tyrantrum" : "697", + "Amaura" : "698", + "Aurorus" : "699", + "Sylveon" : "700", + "Hawlucha" : "701", + "Dedenne" : "702", + "Carbink" : "703", + "Goomy" : "704", + "Sliggoo" : "705", + "Goodra" : "706", + "Klefki" : "707", + "Phantump" : "708", + "Trevenant" : "709", + "Pumpkaboo" : "710", + "Gourgeist" : "711", + "Bergmite" : "712", + "Avalugg" : "713", + "Noibat" : "714", + "Noivern" : "715", + "Xerneas" : "716", + "Yveltal" : "717", + "Zygarde" : "718", + "Diancie" : "719", + "Hoopa" : "720", + "Volcanion" : "721", + "a:722-809" : "Alol", + "Rowlet" : "722", + "Dartrix" : "723", + "Decidueye" : "724", + "Litten" : "725", + "Torracat" : "726", + "Incineroar" : "727", + "Popplio" : "728", + "Brionne" : "729", + "Primarina" : "730", + "Pikipek" : "731", + "Trumbeak" : "732", + "Toucannon" : "733", + "Yungoos" : "734", + "Gumshoos" : "735", + "Grubbin" : "736", + "Charjabug" : "737", + "Vikavolt" : "738", + "Crabrawler" : "739", + "Crabominable" : "740", + "Oricorio" : "741", + "Cutiefly" : "742", + "Ribombee" : "743", + "Rockruff" : "744", + "Lycanroc" : "745", + "Wishiwashi" : "746", + "Mareanie" : "747", + "Toxapex" : "748", + "Mudbray" : "749", + "Mudsdale" : "750", + "Dewpider" : "751", + "Araquanid" : "752", + "Fomantis" : "753", + "Lurantis" : "754", + "Morelull" : "755", + "Shiinotic" : "756", + "Salandit" : "757", + "Salazzle" : "758", + "Stufful" : "759", + "Bewear" : "760", + "Bounsweet" : "761", + "Steenee" : "762", + "Tsareena" : "763", + "Comfey" : "764", + "Oranguru" : "765", + "Passimian" : "766", + "Wimpod" : "767", + "Golisopod" : "768", + "Sandygast" : "769", + "Palossand" : "770", + "Pyukumuku" : "771", + "Type: Null" : "772", + "Silvally" : "773", + "Minior" : "774", + "Komala" : "775", + "Turtonator" : "776", + "Togedemaru" : "777", + "Mimikyu" : "778", + "Bruxish" : "779", + "Drampa" : "780", + "Dhelmise" : "781", + "Jangmo-o" : "782", + "Hakamo-o" : "783", + "Kommo-o" : "784", + "Tapu Koko" : "785", + "Tapu Lele" : "786", + "Tapu Bulu" : "787", + "Tapu Fini" : "788", + "Cosmog" : "789", + "Cosmoem" : "790", + "Solgaleo" : "791", + "Lunala" : "792", + "Nihilego" : "793", + "Buzzwole" : "794", + "Pheromosa" : "795", + "Xurkitree" : "796", + "Celesteela" : "797", + "Kartana" : "798", + "Guzzlord" : "799", + "Necrozma" : "800", + "Magearna" : "801", + "Marshadow" : "802", + "Poipole" : "803", + "Naganadel" : "804", + "Stakataka" : "805", + "Blacephalon" : "806", + "Zeraora" : "807", + "Meltan" : "808", + "Melmetal" : "809" +}; \ No newline at end of file diff --git a/TempCommandStorage/test.js b/TempCommandStorage/test.js new file mode 100644 index 0000000..bc77942 --- /dev/null +++ b/TempCommandStorage/test.js @@ -0,0 +1,7 @@ +module.exports = { + name: 'test', + description: 'whatever you want', + execute(message, args) { + console.log(message.channel.guild.roles); + }, +}; \ No newline at end of file diff --git a/bot.js b/bot.js index e590a57..dd53e16 100644 --- a/bot.js +++ b/bot.js @@ -1,6 +1,6 @@ const fs = require('fs'); const Discord = require('discord.js'); -const { prefix, token } = require('./auth.json'); +const {prefix, token} = require('./auth.json'); const client = new Discord.Client(); client.commands = new Discord.Collection(); @@ -8,15 +8,55 @@ client.commands = new Discord.Collection(); const commandFiles = fs.readdirSync('./commands').filter(file => file.endsWith('.js')); for (const file of commandFiles) { - const command = require(`./commands/${file}`); - client.commands.set(command.name, command); + const command = require(`./commands/${file}`); + client.commands.set(command.name, command); } +<<<<<<< Updated upstream client.once('ready', () => { console.log('Bot is running'); }); +======= +//code which is done on bot's start up. As of now only logs that the bot is running and sets the activty. +client.once('ready', () => { + console.log(`Bot is running on ${client.guilds.size} servers`); + client.user.setActivity('>help'); +}); + +client.on('messageReactionAdd', (reaction, user) => { + if (reaction.emoji.name === '🤝' && reaction.message.id === "606589614123384843") { + try { + let role = reaction.message.guild.roles.get('606594867136823316'); + let member = reaction.message.guild.members.find(member => (member.user.id === user.id)); + console.log(`CO-OP || ${user.username} has requested the Co-op Role.`); + if (member !== null && role !== null) { + if (!member.roles.has(role.id)) { + member.addRole(role).catch(console.error); + } + } + } catch (e) { + //ToDo: Figure somethin out. + } + } +}); +client.on('messageReactionRemove', (reaction, user) => { + if (reaction.emoji.name === '🤝' && reaction.message.id === "606589614123384843") { + try { + let role = reaction.message.guild.roles.get('606594867136823316'); + let member = reaction.message.guild.members.find(member => (member.user.id === user.id)); + console.log(`CO-OP || ${user.username} has un-requested the Co-op Role.`); + if (member !== null && role !== null) { + if (member.roles.has(role.id)) { + member.removeRole(role).catch(console.error); + } + } + } catch (e) { + //ToDo: Figure somethin out. + } +>>>>>>> Stashed changes client.on('message', message => { +<<<<<<< Updated upstream if (!message.content.startsWith(prefix) || message.author.bot) return; const args = message.content.slice(prefix.length).split(/ +/); @@ -30,4 +70,65 @@ client.on('message', message => { message.reply('Cannot run command!'); } }); -client.login(token); \ No newline at end of file +client.login(token); +======= + if (message.guild.id === '583120259708616715') { + if (message.channel.id === '603818219131764736' || message.channel.id === '604281012901511178') { + return; + } + } + //handles >enter command + try { + if (message.channel.id === '611678630925565972') { + if (message.channel.guild.id !== '583120259708616715') return; + addTrainerRole(message); + } + if (message.channel.guild.id === '259802877269245952') { + if (message.attachments != null) { + var img = message.attachments.first().url; + console.log("SNOOP || " + message.author.username + " => " + img); + } else { + console.log("SNOOP || " + message.author.username + " => " + message.content); + } + } + } catch (e) { + // + } + //if the message is sent by a bot, ignore it. + if (message.author.bot) return; + //checks the message's first character for the > prefix, if the prefix isnt found the function returns. + if (!message.content.startsWith(prefix) || message.author.bot) return; + //if the prefix IS found, the command call is split with the word immediately following the prefix becoming command and everything after it becoming the space delimitted args array + const args = message.content.slice(prefix.length).split(/ +/); + const command = args.shift().toLowerCase(); + //if the commaand is not found within the commands collection (ie. it doesnt exist) then the function returns. otherwise it will execute the function defined in the commands specific .js file in the commands folder + if (!client.commands.has(command)) return; + try { + client.commands.get(command).execute(message, args); + } catch (error) { + console.error(error); + message.reply('Cannot run command!'); + } +}); +client.login(token); + +async function addTrainerRole(message) { + if (message.content === ">enter") { + try { + let member = message.member; + let trainerRole = message.guild.roles.get('611638752015679596'); + if (member !== null && trainerRole !== null) { + if (!member.roles.has(trainerRole.id)) { + await member.addRole(trainerRole).catch(console.error); + } + } + message.delete(2000).catch(console.error); + message.channel.send(`Trainer role given to ${message.author.username}`) + } catch (e) { + // + } + } else { + message.delete(10000).catch(console.error); + } +} +>>>>>>> Stashed changes diff --git a/commands/mastersTest.js b/commands/mastersTest.js new file mode 100644 index 0000000..8c0a134 --- /dev/null +++ b/commands/mastersTest.js @@ -0,0 +1,172 @@ +const Units = require("Data/PKMSUnits"); +const Moves = require("Data/PKMSMoves"); +const Passives = require("Data/PKMSPassives"); +const units = Units.Units; +const moves = Moves.Moves; +const passives = Passives.Passives; +const Discord = require('discord.js'); +const paginationEmbed = require('discord.js-pagination'); +module.exports = { + name: 't', + description: 'whatever you want', + execute(message, args) { + var searchName = args[0].toLowerCase(); + var unit = []; + for(var x in units){ + if(units[x].title.Trainer.toLowerCase() === searchName){ + unit.push(units[x].title); + } + } + unit.sort((a,b)=>{ + if(a.EvolutionStage > b.EvolutionStage){ + return 1; + }else{ + return -1; + } + }); + var embeds = unit.map((unit)=>objToEmbed(unit)); + paginationEmbed(message, embeds, ['⏪', '⏩'], 60000); + }, +}; + +function getColor(type){ + var elementColor; + switch (type.toLowerCase()) { + case 'normal': + elementColor = "#ffffff"; break; + case 'fire': + elementColor = "#ff0000"; break; + case 'water': + elementColor = "#4286f4"; break; + case 'electric': + elementColor = "#fffa00"; break; + case 'grass': + elementColor = "#1daf0f"; break; + case 'ice': + elementColor = "#00ffe5"; break; + case 'fighting': + elementColor = "#7a3b3b"; break; + case 'poison': + elementColor = "#9a06aa"; break; + case 'ground': + elementColor = "#351818"; break; + case 'flying': + elementColor = "#a2c1c1"; break; + case 'psychic': + elementColor = "#b56cab"; break; + case 'bug': + elementColor = "#87c69f"; break; + case 'rock': + elementColor = "#9e7356"; break; + case 'ghost': + elementColor = "#65558c"; break; + case 'dragon': + elementColor = "#00487f"; break; + case 'dark': + elementColor = "#23021e"; break; + case 'steel': + elementColor = "#6b6b6b"; break; + case 'fairy': + elementColor = "#ffb7d7"; break; + } + return elementColor; +} + +function objToEmbed(unit){ + var embed; + var movesOut = getMoves([unit.Move1, unit.Move2, unit.Move3, unit.Move4]); + var passivesOut = getPassives([unit.Passive1, unit.Passive2, unit.Passive3]); + var syncOut = getSync(unit.SyncMove); + var type; + if(unit.Type2 !== ""){ + type = unit.Type2.toLowerCase() + }else{ + type = unit.Type.toLowerCase() + } + embed = new Discord.RichEmbed() + .setAuthor(unit.Trainer + " & " + unit.Name) + .setImage('https://www.serebii.net/pokemonmasters/syncpairs/' + unit.Trainer.toLowerCase() + '.png') + .setThumbnail('https://www.serebii.net/pokedex-bw/type/' + type + '.gif') + .addField("Weakness", unit.Weakness) + .addField("HP", unit.MaxHP,true) + .addField("ATK", unit.MaxAttack,true) + .addField("DEF", unit.MaxDefense,true) + .addField("SPATK", unit.MaxSpAtk,true) + .addField("SPDEF", unit.MaxSpDef,true) + .addField("SPD", unit.MaxSpeed,true) + .addField("---Passives---", passivesOut) + .addField("---Moves---", movesOut) + .addField("---Sync Move---", syncOut) + .setColor(getColor(type)) + .setFooter("Stats reflect their values at max level (UNDER CONSTRUCTION)"); + return embed; +} + +function getMoves(unitMoveArr){ + var movesList = []; + for(var x in unitMoveArr){ + for(var y in moves){ + if(unitMoveArr[x] === moves[y].title.Name){ + var move = moves[y].title; + movesList.push(generateMoveOut(move)); + } + } + } + return movesList.join("\n"); +} + +function getPassives(unitPassiveArr){ + var passiveList = []; + for(var x in unitPassiveArr){ + for(var y in passives){ + if(unitPassiveArr[x] === passives[y].title.Name){ + var passive = passives[y].title; + var passiveOut = '**' + passive.Name + ':** ' + passive.Description + '\n'; + passiveList.push(passiveOut); + } + } + } + return passiveList; +} + +function getSync(sync){ + var syncOut = ""; + for(var x in moves){ + if(moves[x].title.IsSyncMove === "1"){ + if(sync === moves[x].title.Name){ + var move = moves[x].title; + syncOut = generateMoveOut(move); + } + } + } + return syncOut; +} + +function generateMoveOut(move){ + var isTrainerMove = false; + var moveOut = "**" + move.Name + "**\n"; + if(move.UsageLimit !== ""){ + moveOut += "Uses: " + move.UsageLimit + " | "; + isTrainerMove = true; + }else if(move.MoveGaugeCost !== ""){ + moveOut += "Cost: " + move.MoveGaugeCost + " | "; + } + if(move.Type !== ""){ + moveOut += 'Type: ' + move.Type + ' | '; + } + moveOut += 'Category: ' + move.Category + ' | Target: ' + move.Target + '\n'; + if(!isTrainerMove){ + moveOut += 'Power: ' + move.MaxPower; + if(move.Accuracy !== ""){ + moveOut += ' | Accuracy: ' + move.Accuracy; + } + if(move.EffectTag !== ""){ + moveOut += ' | Effect: ' + move.EffectTag + '\n'; + }else{ + moveOut += '\n'; + } + } + moveOut += move.Description; + return moveOut; +} + diff --git a/commands/mastersTest2.js b/commands/mastersTest2.js new file mode 100644 index 0000000..a005311 --- /dev/null +++ b/commands/mastersTest2.js @@ -0,0 +1,39 @@ +const fetch = require("node-fetch"); +module.exports = { + name: 'f', + description: 'whatever you want', + execute(message, args) { + getUnit(message, args[0]); + }, +}; + +async function getUnit(message, args) { + var data, unit; + await fetch('https://gamepress.gg/sites/default/files/aggregatedjson/TrainersList.json?15813222081239323912') + .then(response => response.json()) + .then(trainers => data = trainers); + if(data){ + for (var x in data) { + if (data[x].title.toUpperCase() === args.toUpperCase()) { + unit = data[x]; + } + } + } + getPokemon(unit) +} + +async function getPokemon(unit){ + var data; + var pokemon = []; + await fetch('https://gamepress.gg/sites/default/files/aggregatedjson/PokemonMastersPokemonList.json?11374694561864648517') + .then(response => response.json()) + .then(trainers => data = trainers); + if(data){ + for (var x in data) { + if (data[x].title_plain.toUpperCase().substring(0,data[x].title_plain.indexOf(" ")) === unit.title.toUpperCase()) { + pokemon.push(data[x]); + } + } + } + +} \ No newline at end of file diff --git a/package.json b/package.json index a44b614..56cec43 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,17 @@ "author": "Anthony Lachhman", "dependencies": { "discord.io": "https://github.com/woor/discord.io/tarball/gateway_v6", +<<<<<<< Updated upstream "enmap": "^4.8.7", "winston": "^3.2.1" +======= + "discord.js": "^11.5.1", + "discord.js-pagination": "^1.0.2", + "fetch": "^1.1.0", + "node-fetch": "^2.6.0", + "request": "^2.88.0", + "winston": "^3.2.1", + "Data": "latest" +>>>>>>> Stashed changes } }