Creating a Command

For experienced developers. Current DiscordJS version: 14.9.0

  1. Open LuxuDiscordBot/server/commands
  2. Create a new file for your command (e.g. example.js)
  3. Follow this structure:
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) {
    const hasPerm = await client.checkPermission(interaction, this.data.name);
    if (!hasPerm) return;

   // your logic here

      interaction.reply({
          content: `${client.Locale("UnBanPlayerFailed")}`,
          ephemeral: true,
        });

     const hasSubcommands = false;
  client.utils?.log.info(interaction, hasSubcommands);

    } catch (e) {
      console.error("Error banning player", e);
    }
  },
};
  1. Save the file and restart the resource.