Defer the response

This commit is contained in:
Skylar Grant 2023-01-23 01:51:10 -05:00
parent a367c16609
commit 43a7011e4f

View File

@ -11,6 +11,7 @@ module.exports = {
.setDescription('Tree height in feet, numbers ONLY') .setDescription('Tree height in feet, numbers ONLY')
.setRequired(true)), .setRequired(true)),
execute(interaction) { execute(interaction) {
interaction.deferReply();
const treeHeight = interaction.options.getString('height'); const treeHeight = interaction.options.getString('height');
const waterTime = Math.floor(Math.floor(Math.pow(treeHeight * 0.07 + 5, 1.1)) / 60); const waterTime = Math.floor(Math.floor(Math.pow(treeHeight * 0.07 + 5, 1.1)) / 60);
interaction.reply(`A tree that is ${treeHeight}ft tall will have a watering time of ${waterTime} minutes.`); interaction.reply(`A tree that is ${treeHeight}ft tall will have a watering time of ${waterTime} minutes.`);