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,12 +1665,16 @@ 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);
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];