This commit is contained in:
Emily 2020-11-07 11:12:49 +11:00
parent 305dfe6541
commit 8f0df99a9d
2 changed files with 9 additions and 7 deletions

View file

@ -38,6 +38,7 @@ module.exports = class {
getAbilityDetailsByFuzzy(ability: "${query}") { getAbilityDetailsByFuzzy(ability: "${query}") {
name name
desc desc
shortDesc
bulbapediaPage bulbapediaPage
serebiiPage serebiiPage
smogonPage smogonPage
@ -62,14 +63,15 @@ module.exports = class {
} }
const ability = json.data.getAbilityDetailsByFuzzy; const ability = json.data.getAbilityDetailsByFuzzy;
if (!ability.desc) return message.channel.createMessage(
`${client.constants.emojis.botError} I'm missing data for this ability so I can't show it to you, sorry! ;w;`
)
const embed = new Embed() const embed = new Embed()
.setColour(client.functions.displayHexColour(message.channel.guild, client.user.id)) .setColour(client.functions.displayHexColour(message.channel.guild, client.user.id))
.setTitle(ability.name.toProperCase()) .setTitle(ability.name.toProperCase());
.setDescription(ability.desc) if (ability.desc) {
.addField('External Resources:', `[Bulbapedia](${ability.bulbapediaPage}) | [Serebii](${ability.serebiiPage}) | [Smogon](${ability.smogonPage})`); embed.setDescription(ability.desc);
} else {
embed.setDescription(ability.shortDesc);
}
embed.addField('External Resources:', `[Bulbapedia](${ability.bulbapediaPage}) | [Serebii](${ability.serebiiPage}) | [Smogon](${ability.smogonPage})`);
message.channel.createMessage({ embed: embed }); message.channel.createMessage({ embed: embed });
}) })
.catch(err => console.log(err)); .catch(err => console.log(err));

View file

@ -16,7 +16,7 @@ module.exports = class {
description: 'Get useful data on any pokemon you ask me to!', description: 'Get useful data on any pokemon you ask me to!',
arguments: '<pokemon>', arguments: '<pokemon>',
details: '', details: '',
examples: '`pokemon mudkip`\n`pokemon giratina-origin`' examples: '`pokemon mudkip`\n`pokemon alolan ninetales`'
}; };
} }