From 42c999217cb1616baf182a42b62484b8ad748b4e Mon Sep 17 00:00:00 2001 From: BluDood Date: Sun, 6 Nov 2022 11:48:35 +0100 Subject: [PATCH] Add preview option to `/tag get` --- commands/tag.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/commands/tag.js b/commands/tag.js index 7d3619b..916e03a 100644 --- a/commands/tag.js +++ b/commands/tag.js @@ -21,6 +21,7 @@ module.exports = { .setDescription('Get a tag') .addStringOption(option => option.setName('name').setDescription('The name of the tag').setRequired(true).setAutocomplete(true)) .addUserOption(option => option.setName('mention').setDescription('User to mention')) + .addBooleanOption(option => option.setName('preview').setDescription('Send tag as a preview instead of displaying it publicly')) ) .addSubcommand(subcommand => subcommand @@ -99,6 +100,7 @@ module.exports = { } else if (subcommand === 'get') { const name = interaction.options.getString('name') const user = interaction.options.getUser('mention') + const preview = interaction.options.getBoolean('preview') const foundTag = tag.get(name) if (!foundTag) { // Shhhh, you didn't see anything. @@ -118,7 +120,7 @@ module.exports = { url: foundTag.image } } - user ? interaction.reply({ content: `<@${user.id}>, take a look at this!`, embeds: [embed] }) : interaction.reply({ embeds: [embed] }) + user ? interaction.reply({ content: `<@${user.id}>, take a look at this!`, embeds: [embed] }) : interaction.reply({ embeds: [embed], ephemeral: preview ?? false }) } else if (subcommand === 'edit') { if (!checkUserPerms(interaction)) { return interaction.reply({