From 327d27625a1e3f37f557041fdffd5c211a696751 Mon Sep 17 00:00:00 2001 From: Caleb Fontenot Date: Tue, 4 Apr 2023 17:50:04 -0500 Subject: [PATCH] Add countChars function --- commands/countChars.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/commands/countChars.ts b/commands/countChars.ts index 4b5601d..55c8840 100644 --- a/commands/countChars.ts +++ b/commands/countChars.ts @@ -24,11 +24,14 @@ module.exports = { const messagefromId = await client.channels.cache.get(interaction.channel.id).messages.fetch(messageId); inputString = messagefromId.content; } + let inputStringPrint; 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"); }, };