'Make a slash command private
I want to make this slash command private. Where do I insert the defaultPermissions: false line?
const { SlashCommandBuilder } = require('@discordjs/builders');
const { MessageEmbed } = require('discord.js');
module.exports = {
data: new SlashCommandBuilder()
.setName('ping')
.setDescription('Checks that the bot is online.'),
async execute(interaction) {
const embed = new MessageEmbed()
.setColor('#9ea687')
.setTitle('Pong!')
.setDescription(`Latency is ${Date.now() - interaction.createdTimestamp}ms.`)
.setThumbnail('url')
.setTimestamp()
.setFooter({text: 'text'});
await interaction.reply({ embeds: [embed] });
},
};
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
