This commit is contained in:
Daniel Odendahl Jr
2017-11-09 00:02:59 +00:00
parent 819db49057
commit b6afded306
125 changed files with 743 additions and 289 deletions
+3 -3
View File
@@ -12,7 +12,7 @@ module.exports = class JishoCommand extends Command {
description: 'Defines a word, but with Japanese.',
args: [
{
key: 'query',
key: 'word',
prompt: 'What word would you like to look up?',
type: 'string'
}
@@ -20,11 +20,11 @@ module.exports = class JishoCommand extends Command {
});
}
async run(msg, { query }) {
async run(msg, { word }) {
try {
const { body } = await snekfetch
.get('http://jisho.org/api/v1/search/words')
.query({ keyword: query });
.query({ keyword: word });
if (!body.data.length) return msg.say('Could not find any results.');
const data = body.data[0];
return msg.say(stripIndents`