From e7d38f5c5e0d86654c450175e95bc8f32a6e4af9 Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Tue, 30 Jun 2020 16:02:50 -0400 Subject: [PATCH] Fix --- commands/search/poem.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/commands/search/poem.js b/commands/search/poem.js index 060090be..05fddbae 100644 --- a/commands/search/poem.js +++ b/commands/search/poem.js @@ -1,6 +1,6 @@ const Command = require('../../structures/Command'); const request = require('node-superfetch'); -const { stripIndents } = require('common-tags'); +const { stripIndent } = require('common-tags'); module.exports = class PoemCommand extends Command { constructor(client) { @@ -38,8 +38,9 @@ module.exports = class PoemCommand extends Command { async run(msg, { author, title }) { try { const { body } = await request.get(`https://poetrydb.org/author,title/${author};${title}`); + if (body.status === 404) return msg.say('Could not find any results.'); const data = body[0]; - return msg.say(stripIndents` + return msg.say(stripIndent` **${data.title}** by **${data.author}** ${data.lines.join('\n')} `);