<aside> 💡 This is meant for experienced developers
</aside>
Current DiscordJS version: 14.9.0
example.js
module.exports = {
data: {
name: "command-name",
description: "Command description",
options: [
{
name: "example-option",
description: "Option description",
type: ApplicationCommandOptionType.String,
required: true,
},
],
},
async execute(client, interaction) {
// Checking for user permission
const hasPerm = await client.checkPermission(interaction, this.data.name);
if (!hasPerm) return;
// do some logic...
// replying
interaction.reply({
content: `${client.Locale("UnBanPlayerFailed")}`,
ephemeral: true,
});
// adding a log to the usage
const hasSubcommands = false // change this depending on your command
client.utils?.log.info(interaction, hasSubcommands);
} catch (e) {
console.error("Error banning player", e);
}
},
};
As easy as that.