const commando = require('discord.js-commando');
const Discord = require('discord.js');
var request = require('request');
var cheerio = require('cheerio');
var he = require('he');
var pluralize = require('pluralize')
var functions = require('../../functions.js');
require('@gouch/to-title-case')
var urlencode = require('urlencode');
var cc1 = {
"/wiki/Asar": "Iron Soldier",
"/wiki/Leeanne": "Iron Heavy Armor",
"/wiki/Valerie": "Iron Mage",
"/wiki/Soma" :"Iron Archer",
"/wiki/Mortimer" :"Iron Bandit",
"/wiki/Saizou" :"Iron Ninja"
}
var cc2 = {
"/wiki/Asar": "Silver Soldier",
"/wiki/Leeanne": "Silver Heavy Armor",
"/wiki/Valerie": "Silver Mage",
"/wiki/Niel" :"Silver Angel",
"/wiki/Soma" :"Silver Archer",
"/wiki/Mortimer" :"Silver Bandit",
"/wiki/Elaine" :"Silver Valkyrie",
"/wiki/Alissa" :"Silver Healer",
"/wiki/Saizou" :"Silver Ninja",
"/wiki/Calliope" :"Silver Witch",
"/wiki/Fudou" :"Silver Bishop",
"/wiki/Cecily" :"Silver Rogue",
"/wiki/Sanosuke" :"Silver Samurai",
"/wiki/Percis" :"Silver Gunner",
"/wiki/Ricardo" :"Silver Magic Fencer",
"/wiki/Khuri" :"Silver Vampire Hunter",
"/wiki/Giovanni" :"Silver Pirate",
"/wiki/Dan" :"Silver Monk",
"/wiki/Ertel" :"Silver Priest Warrior"
}
var aw1 = {
"/wiki/Asar": "**Gold Soldie**r \nOR \n**CC Silver Soldier**",
"/wiki/Leeanne": "**Gold Heavy Armor** \nOR \n**CC Silver Heavy Armor**",
"/wiki/Valerie": "**Gold Mage** \nOR \n**CC Silver Mage**",
"/wiki/Niel" :"**Gold Angel** \nOR \n**CC Silver Angel**",
"/wiki/Daniela" :"**Gold Archer** \nOR \n**CC Silver Archer**",
"/wiki/Eunice" :"**Gold Bandit** \nOR \n**CC Silver Bandit**",
"/wiki/Elaine" :"**Gold Valkyrie** \nOR \n**CC Silver Valkyrie**",
"/wiki/Alissa" :"**Gold Healer** \nOR \n**CC Silver Healer**",
"/wiki/Saizou" :"**Gold Ninja** \nOR \n**CC Silver Ninja**",
"/wiki/Calliope" :"**Gold Witch** \nOR \n**CC Silver Witch**",
"/wiki/Fudou" :"**Gold Bishop** \nOR \n**CC Silver Bishop**",
"/wiki/Cecily" :"**Gold Rogue** \nOR \n**CC Silver Rouge**",
"/wiki/Sanosuke" :"**Gold Samurai** \nOR \n**CC Silver Samurai**",
"/wiki/Percis" :"**Gold Gunner** \nOR \n**CC Silver Gunner**",
"/wiki/Ricardo" :"**Gold Magic Fencer** \nOR \n**CC Silver Magic Fencer**",
"/wiki/Khuri" :"**Gold Vampire Hunter** \nOR \n**CC Silver Vampire Hunter**",
"/wiki/Giovanni" :"**Gold Pirate** \nOR \n**CC Silver Pirate**",
"/wiki/Dan" :"**Gold Monk** \nOR \n**CC Silver Monk**",
"/wiki/Ertel" :"**Gold Priest Warrior** \nOR \n**CC Silver Priest Warrior**",
"/wiki/Gadoras" :"**Gold Dragon Soldier** \nOR** \nCC Silver Dragon Soldier**"
}
var aw1d = {
"/wiki/Asar": "1 x Iron Soldier \n1 x Iron Heavy Armor \n1 x Silver Soldier \n1 x Silver Spirit",
"/wiki/Leeanne": "1 x Iron Soldier \n1 x Iron Heavy Armor \n1 x Silver Heavy Armor \n1 x Silver Spirit",
"/wiki/Valerie": "1 x Iron Soldier \n1 x Iron Mage \n1 x Silver Mage \n1 x Silver Spirit",
"/wiki/Niel" :"1 x Iron Soldier \n1 x Iron Heavy Armor \n1 x Silver Angel \n1 x Silver Spirit",
"/wiki/Daniela" :"2 x Iron Archers \n1 x Silver Archer \n1 x Silver Spirit",
"/wiki/Eunice" :"1 x Iron Soldier \n1 x Iron Bandit \n1 x Silver Bandit \n1 x Silver Spirit",
"/wiki/Elaine" :"1 x Iron Soldier \n1 x Iron Heavy Armor \n1 x Silver Valkyrie \n1 x Silver Spirit",
"/wiki/Alissa" :"1 x Iron Archer \n1 x Iron Mage \n1 x Silver Healer \n1 x Silver Spirit",
"/wiki/Saizou" :"1 x Iron Soldier \n1 x Iron Bandit \n1 x Silver Ninja \n1 x Silver Spirit",
"/wiki/Calliope" :"1 x Iron Archer \n1 x Iron Mage \n1 x Silver Witch \n1 x Silver Spirit",
"/wiki/Fudou" :"2 x Iron Mages \n1 x Silver Healer \n1 x Silver Spirit",
"/wiki/Cecily" :"1 x Iron Soldier \n1 x Iron Archer \n1 x Silver Rouge \n1 x Silver Spirit",
"/wiki/Sanosuke" :"1 x Iron Soldier \n1 x Iron Mage \n1 x Silver Samurai \n1 x Silver Spirit",
"/wiki/Percis" :"1 x Iron Soldier \n1 x Iron Archer, \n1 x Silver Gunner \n1 x Silver Spirit",
"/wiki/Ricardo" :"1 x Iron Soldier \n1 x Iron Mage \n1 x Silver Magic Fencer \n1 x Silver Spirit",
"/wiki/Khuri" :"2 x Iron Archers \n1 x Silver Vampire Hunter \n1 x Silver Spirit",
"/wiki/Giovanni" :"1 x Iron Archer \n1 x Iron Bandit \n1 x Silver Pirate \n1 x Silver Spirit",
"/wiki/Dan" :"1 x Iron Soldier \n1 x Iron Archer \n1 x Silver Monk \n1 x Silver Spirit",
"/wiki/Ertel" :"1 x Iron Soldier \n1 x Iron Heavy Armor \n1 x Silver Priest Warrior \n1 x Silver Spirit",
"/wiki/Gadoras" :"1 x Iron Soldier \n1 x Iron Bandit \n1 x Silver Heavy Armor \n1 x Silver Spirit"
}
var awo = {
"Sniper Orb": "Sniper (Mon)",
"Dark Knight Orb": "Dark Knight (Mon)",
"Priest Orb": "Priest (Mon)",
"Rearguard Strategist Orb": "Rearguard Strategist (Mon)",
"Heavy Gunner Orb": "Heavy Gunner (Mon)",
"Unicorn Knight Orb": "Unicorn Knight (Tue)",
"Pegasus Knight Orb": "Pegasus Knight (Tue)",
"Master Monk Orb": "Master Monk (Tue)",
"Berserker Orb": "Berserker (Tue)",
"Feng Shui Master Orb": "Feng Shui Master (Tue)",
"Soldier Chief Orb": "Soldier Chief (Wed)",
"Assassin Orb": "Assassin (Wed)",
"Captain Orb": "Captain (Wed)",
"High Shaman Orb": "High Shaman (Wed)",
"High Bishop Orb": "High Bishop (Wed)",
"Battle Master Orb": "Battle Master (Thu)",
"Samurai Master Orb": "Samurai Master (Thu)",
"Rune Fencer Orb": "Rune Fencer (Thu)",
"Vampire Killer Orb": "Vampire Killer (Thu)",
"Sailor Chief Orb": "Sailor Chief (Thu)",
"Lord Witch Orb": "Lord Witch (Fri)",
"Warlock Orb": "Warlock (Fri)",
"Vanguard Strategist Orb": "Vanguard Strategist (Fri)",
"Ninja Master Orb": "Ninja Master (Fri)",
"Arch Angel Orb": "Arch Angel (Fri)",
"Battle Mage Orb": "Battle Mage (Sat)",
"High Ranger Orb": "High Ranger (Sat)",
"Top Dancer Orb": "Top Dancer (Sat)",
"Dragon Knight Orb": "Dragon Knight (Sat)",
"Priest Warrior Leader Orb": "Priest Warrior Leader (Sat)",
"High Alchemist Orb": "High Alchemist (Sun)",
"Witch Doctor Orb": "Witch Doctor (Sun)",
"Machinist Orb": "Machinist (Sun)",
"Master Thief Orb": "Master Thief (Sun)",
"Bowrider Chief Orb": "Bowrider Chief (Sun)",
"Sniper": "Sniper (Mon)",
"Dark Knight": "Dark Knight (Mon)",
"Priest": "Priest (Mon)",
"Rearguard Strategist": "Rearguard Strategist (Mon)",
"Heavy Gunner": "Heavy Gunner (Mon)",
"Unicorn Knight": "Unicorn Knight (Tue)",
"Pegasus Knight": "Pegasus Knight (Tue)",
"Master Monk": "Master Monk (Tue)",
"Berserker": "Berserker (Tue)",
"Feng Shui Master": "Feng Shui Master (Tue)",
"Soldier Chief": "Soldier Chief (Wed)",
"Assassin": "Assassin (Wed)",
"Captain": "Captain (Wed)",
"High Shaman": "High Shaman (Wed)",
"High Bishop": "High Bishop (Wed)",
"Battle Master": "Battle Master (Thu)",
"Samurai Master": "Samurai Master (Thu)",
"Rune Fencer": "Rune Fencer (Thu)",
"Vampire Killer": "Vampire Killer (Thu)",
"Sailor Chief": "Sailor Chief (Thu)",
"Lord Witch": "Lord Witch (Fri)",
"Warlock": "Warlock (Fri)",
"Vanguard Strategist": "Vanguard Strategist (Fri)",
"Ninja Master": "Ninja Master (Fri)",
"Arch Angel": "Arch Angel (Fri)",
"Battle Mage": "Battle Mage (Sat)",
"High Ranger": "High Ranger (Sat)",
"Top Dancer": "Top Dancer (Sat)",
"Dragon Knight": "Dragon Knight (Sat)",
"Priest Warrior Leader": "Priest Warrior Leader (Sat)",
"High Alchemist": "High Alchemist (Sun)",
"Witch Doctor": "Witch Doctor (Sun)",
"Machinist": "Machinist (Sun)",
"Master Thief": "Master Thief (Sun)",
"Bowrider Chief": "Bowrider Chief (Sun)"
}
class FindMat extends commando.Command {
constructor(client) {
super(client, {
name: 'mat',
aliases: ['m', 'material', 'materials'],
group: 'find',
memberName: 'mat',
description: 'find required materials to CC and AW an unit',
examples: ['&mat quill'],
args: [{
key: 'text',
prompt: 'What unit do you want to know about?',
type: 'string'
}]
});
}
async run(message, { text }) {
var unit = functions.nameChange(text)
var link = "https://aigis.fandom.com/wiki/" + urlencode(unit) + "/stats";
request(link, function(err, resp,
评论0