diff --git a/slash-commands/timetoheight.js b/slash-commands/timetoheight.js index 6b62a57..3d0cc2b 100644 --- a/slash-commands/timetoheight.js +++ b/slash-commands/timetoheight.js @@ -1,4 +1,5 @@ const { SlashCommandBuilder } = require('discord.js'); +const dbfn = require('../modules/dbfn.js'); const fn = require('../modules/functions.js'); module.exports = { @@ -6,14 +7,19 @@ module.exports = { .setName('timetoheight') .setDescription('Calculate how long it would take to reach a given height') .addStringOption(o => - o.setName('height') - .setDescription('Tree height in feet, numbers ONLY') + o.setName('beginheight') + .setDescription('Begining tree height in feet, numbers ONLY') + .setRequired(true)) + .addStringOption(o => + o.setName('endheight') + .setDescription('Ending tree height in feet, numbers ONLY') .setRequired(true)), async execute(interaction) { await interaction.deferReply(); - const destTreeHeight = interaction.options.getString('height'); - fn.timeToHeight(interaction, destTreeHeight).then(res => { - interaction.editReply(`It will take you ${res} minutes to reach ${destTreeHeight}ft.`); + const beginHeight = interaction.options.getString('beginheight'); + const endHeight = interaction.options.getString('endheight'); + fn.timeToHeight(beginHeight, endHeight).then(res => { + interaction.editReply(`It will take a tree that is ${beginHeight}ft tall ${res} to reach ${endHeight}ft.`); }).catch(err => { interaction.editReply("Error: " + err); console.error(err);