Added /drawtriangle command

This commit is contained in:
Chloe Fontenot 🏳️‍⚧️ 2023-04-04 21:23:21 -05:00
parent e83b263ee0
commit 20926916dd

View File

@ -19,6 +19,7 @@ module.exports = {
var design = parseInt(interaction.options.getString('design')); var design = parseInt(interaction.options.getString('design'));
if (design < 1 || design > 3) { if (design < 1 || design > 3) {
await interaction.reply('Invalid design choice.'); await interaction.reply('Invalid design choice.');
return;
} }
var output; var output;
switch (design) { switch (design) {
@ -35,9 +36,11 @@ module.exports = {
} }
console.log(codeBlock("", output)); console.log(codeBlock("", output));
if (output.length > 2000) { 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(codeBlock("", output));
await interaction.reply('output length was ' + output.length + " characters.");
console.log("User " + interaction.user.tag + " ran /drawtriangle"); console.log("User " + interaction.user.tag + " ran /drawtriangle");
}, },
}; };