This commit is contained in:
Skylar Grant 2023-01-23 01:55:33 -05:00
parent 4a0a5f046a
commit 4e9cc9c2f9

View File

@ -10,10 +10,10 @@ module.exports = {
o.setName('height') o.setName('height')
.setDescription('Tree height in feet, numbers ONLY') .setDescription('Tree height in feet, numbers ONLY')
.setRequired(true)), .setRequired(true)),
execute(interaction) { async execute(interaction) {
interaction.deferReply(); await 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.editReply(`A tree that is ${treeHeight}ft tall will have a watering time of ${waterTime} minutes.`); await interaction.editReply(`A tree that is ${treeHeight}ft tall will have a watering time of ${waterTime} minutes.`);
}, },
}; };