Add countChars function

This commit is contained in:
Chloe Fontenot 🏳️‍⚧️ 2023-04-04 17:50:04 -05:00
parent fb35c28294
commit 327d27625a

View File

@ -24,11 +24,14 @@ module.exports = {
const messagefromId = await client.channels.cache.get(interaction.channel.id).messages.fetch(messageId); const messagefromId = await client.channels.cache.get(interaction.channel.id).messages.fetch(messageId);
inputString = messagefromId.content; inputString = messagefromId.content;
} }
let inputStringPrint;
if (inputString.length > 1000) { if (inputString.length > 1000) {
inputString = "too long to copy"; inputStringPrint = "too long to copy";
} else {
inputStringPrint = inputString;
} }
await interaction.reply("Input: `" + inputString + "`\n" + "input length: " + inputString.length + " characters long" + "\n Output: " + codeBlock("", countChars(inputString))); await interaction.reply("Input: `" + inputStringPrint + "`\n" + "input length: " + inputString.length + " characters long" + "\n Output: " + codeBlock("", countChars(inputString)));
console.log("User " + interaction.user.tag + " ran /count_chars"); console.log("User " + interaction.user.tag + " ran /count_chars");
}, },
}; };