From 8f89815106b6bf25596cb7853167c6cbf03ce3f0 Mon Sep 17 00:00:00 2001 From: Cynthia Foxwell Date: Wed, 17 Jul 2024 13:40:15 -0600 Subject: [PATCH] utility.charinfo: fix empty line message hopefully --- src/modules/utility.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/modules/utility.js b/src/modules/utility.js index 4af8fb9..3dd1f2d 100644 --- a/src/modules/utility.js +++ b/src/modules/utility.js @@ -1665,13 +1665,17 @@ charinfo.helpText = "Get information about a set of characters."; charinfo.usage = "[characters]"; charinfo.addAlias("char"); charinfo.callback = async function (msg, line) { - if (!line || (line == "" && msg.messageReference?.messageID)) { - const reply = await msg.channel.getMessage(msg.messageReference.messageID); - line = reply.content; + if (!line || line == "") { + if (msg.messageReference?.messageID) { + const reply = await msg.channel.getMessage( + msg.messageReference.messageID + ); + line = reply.content; + } else { + return "Arguments or reply required."; + } } - if (!line || line == "") return "Arguments required."; - const names = await getNamesFromString(line); const chars = [...line]; const lines = names