Skip to content

Commit

Permalink
Add preview option to /tag get
Browse files Browse the repository at this point in the history
  • Loading branch information
BluDood committed Nov 6, 2022
1 parent 99d0a59 commit 42c9992
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion commands/tag.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand All @@ -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({
Expand Down

0 comments on commit 42c9992

Please sign in to comment.