utility.charinfo: fix empty line message hopefully

This commit is contained in:
Cynthia Foxwell 2024-07-17 13:40:15 -06:00
parent 5cdefd4ab6
commit 8f89815106

View file

@ -1665,13 +1665,17 @@ charinfo.helpText = "Get information about a set of characters.";
charinfo.usage = "[characters]"; charinfo.usage = "[characters]";
charinfo.addAlias("char"); charinfo.addAlias("char");
charinfo.callback = async function (msg, line) { charinfo.callback = async function (msg, line) {
if (!line || (line == "" && msg.messageReference?.messageID)) { if (!line || line == "") {
const reply = await msg.channel.getMessage(msg.messageReference.messageID); if (msg.messageReference?.messageID) {
line = reply.content; 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 names = await getNamesFromString(line);
const chars = [...line]; const chars = [...line];
const lines = names const lines = names