diff --git a/commands/drawTriangle.ts b/commands/drawTriangle.ts index 9bc2252..bcb1f7f 100644 --- a/commands/drawTriangle.ts +++ b/commands/drawTriangle.ts @@ -19,6 +19,7 @@ module.exports = { var design = parseInt(interaction.options.getString('design')); if (design < 1 || design > 3) { await interaction.reply('Invalid design choice.'); + return; } var output; switch (design) { @@ -35,9 +36,11 @@ module.exports = { } console.log(codeBlock("", output)); if (output.length > 2000) { - await interaction.reply('String is too big. Resultant output would be too big to send to Discord.') + await interaction.reply('Error: String is too big. Resultant output would be too big to send to Discord. (the output length was ' + output.length + " characters."); + return; } await interaction.reply(codeBlock("", output)); + await interaction.reply('output length was ' + output.length + " characters."); console.log("User " + interaction.user.tag + " ran /drawtriangle"); }, };