Move some things around

This commit is contained in:
dragonfire535
2017-03-04 18:13:53 -05:00
parent 9966b24946
commit e4c10ade07
4 changed files with 5 additions and 4 deletions
File diff suppressed because it is too large Load Diff
+43
View File
@@ -0,0 +1,43 @@
const commando = require('discord.js-commando');
const Discord = require('discord.js');
const pokedex = require('./pkdex.json');
class PokedexCommand extends commando.Command {
constructor(Client){
super(Client, {
name: 'pokedex',
group: 'search',
memberName: 'pokedex',
description: 'Gives the pokedex entry for a Pokemon. (;pokedex Pikachu)',
examples: [';pokedex Pikachu']
});
}
async run(message, args) {
if(message.channel.type !== 'dm') {
if(!message.channel.permissionsFor(this.client.user).hasPermission('SEND_MESSAGES')) return;
if(!message.channel.permissionsFor(this.client.user).hasPermission('READ_MESSAGES')) return;
if(!message.channel.permissionsFor(this.client.user).hasPermission('EMBED_LINKS')) return;
}
console.log("[Command] " + message.content);
let pokemon = message.content.toLowerCase().split(" ").slice(1).join(" ");
if (pokedex.name[pokemon]) {
const embed = new Discord.RichEmbed()
.setTitle('Information')
.setAuthor(pokedex.name[pokemon], pokedex.sprite[pokemon])
.setColor(0xFF0000)
.setDescription(pokedex.species[pokemon])
.setFooter(pokedex.dexname, pokedex.dexicon)
.setThumbnail(pokedex.picture[pokemon])
.addField('Entry',
pokedex.entry[pokemon])
.addField('Type',
pokedex.type[pokemon]);
message.channel.sendEmbed(embed).catch(console.error);
} else {
message.channel.sendMessage(":x: This Pokémon either doesn't exist, or isn't implemented yet.");
}
}
}
module.exports = PokedexCommand;
+1 -1
View File
@@ -24,7 +24,7 @@ class WeatherCommand extends commando.Command {
weather(locationtosearch, 'f').then(info => {
const embed = new Discord.RichEmbed()
.setColor(0x0000FF)
.setAuthor(info.title, 'http://static.dnaindia.com/sites/default/files/2015/08/21/367776-yahoo2.jpg')
.setAuthor(info.title, 'http://media.idownloadblog.com/wp-content/uploads/2013/12/yahoo-weather-213x220.png')
.setURL(info.link)
.setTimestamp()
.addField('**City:**',