2023-01-23 06:38:56 +00:00
|
|
|
const { SlashCommandBuilder } = require('discord.js');
|
|
|
|
const { tree } = require('../modules/functions.js');
|
|
|
|
const fn = require('../modules/functions.js');
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
data: new SlashCommandBuilder()
|
|
|
|
.setName('watertime')
|
|
|
|
.setDescription('Calculate the watering time for a given tree height')
|
|
|
|
.addStringOption(o =>
|
|
|
|
o.setName('height')
|
|
|
|
.setDescription('Tree height in feet, numbers ONLY')
|
|
|
|
.setRequired(true)),
|
2023-01-23 06:55:33 +00:00
|
|
|
async execute(interaction) {
|
|
|
|
await interaction.deferReply();
|
2023-01-23 06:38:56 +00:00
|
|
|
const treeHeight = interaction.options.getString('height');
|
2023-01-23 23:14:57 +00:00
|
|
|
await interaction.editReply(`A tree that is ${treeHeight}ft tall will have a watering time of ${fn.getWaterTime(treeHeight)} minutes.`);
|
2023-01-23 06:38:56 +00:00
|
|
|
},
|
|
|
|
};
|