From 0f8e9a3e1079369c5be1c1abac941d9bc681fd33 Mon Sep 17 00:00:00 2001 From: Skylar Grant Date: Sun, 26 Feb 2023 12:26:52 -0500 Subject: [PATCH] Add privacy switch --- slash-commands/timetoheight.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/slash-commands/timetoheight.js b/slash-commands/timetoheight.js index 7fe0b52..bd5f439 100755 --- a/slash-commands/timetoheight.js +++ b/slash-commands/timetoheight.js @@ -25,9 +25,15 @@ module.exports = { o.setName('quality') .setDescription('Compost quality percentage, rounded') .setRequired(false) + ) + .addBooleanOption(o => + o.setName('private') + .setDescription('Should the reply be visible only to you?') + .setRequired(false) ), async execute(interaction) { - await interaction.deferReply({ ephemeral: true }); + const private = interaction.options.getBoolean('private') ? interaction.options.getBoolean('private') : true; + await interaction.deferReply({ ephemeral: private }); const inBeginHeight = interaction.options.getInteger('beginheight'); const endHeight = interaction.options.getInteger('endheight'); const efficiency = interaction.options.getInteger('efficiency');