From 5e9e58f02a0c3e931ad4cc6cefbbd8323b68d895 Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Sat, 30 Mar 2024 18:43:00 -0400 Subject: [PATCH] Fix --- commands/random-img/xiao.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/commands/random-img/xiao.js b/commands/random-img/xiao.js index 2533948c..7cd6da3c 100644 --- a/commands/random-img/xiao.js +++ b/commands/random-img/xiao.js @@ -51,7 +51,11 @@ module.exports = class XiaoCommand extends Command { try { const data = await this.sauceNao(img); if (data && data[0].similarity > 90) { - result = `Art by [${data[0].authorName}](${data[0].authorUrl}) | Source: <${data[0].url}>`; + result = ''; + const sauce = data[0]; + if (sauce.authorName && sauce.authorUrl) result += `Art by [${sauce.authorName}](<${sauce.authorUrl}>) | `; + if (sauce.authorName && !sauce.authorUrl) result += `Art by ${sauce.authorName} | `; + result += `Art Source: <${sauce.url}>`; } } catch { return result;