mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-23 18:05:01 +02:00
Move some things around
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -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;
|
||||
@@ -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:**',
|
||||
|
||||
Reference in New Issue
Block a user