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
1 changed files with 9 additions and 5 deletions

View File

@ -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