From cef9ed037127c6a138088d54da2ce5a101733c75 Mon Sep 17 00:00:00 2001 From: nocode Date: Sun, 13 Sep 2026 12:19:14 +0200 Subject: [PATCH] feat(roles): add role command skeleton Refs: #63 --- src/commands/moderation/role.js | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/commands/moderation/role.js diff --git a/src/commands/moderation/role.js b/src/commands/moderation/role.js new file mode 100644 index 0000000..a3abe43 --- /dev/null +++ b/src/commands/moderation/role.js @@ -0,0 +1,29 @@ +import { PermissionFlagsBits, SlashCommandBuilder } from 'discord.js'; +import { ACCESS_LEVELS } from '../../config/constants.js'; +import { notImplementedEmbed } from '../../ui/embeds.js'; + +export const access = ACCESS_LEVELS.STAFF; + +export const data = new SlashCommandBuilder() + .setName('role') + .setDescription('Gestion des rôles') + .setDefaultMemberPermissions(PermissionFlagsBits.ManageRoles) + .addSubcommand((sub) => + sub + .setName('set') + .setDescription('Attribuer ou retirer un rôle') + .addUserOption((option) => option.setName('user').setDescription('Membre').setRequired(true)) + .addRoleOption((option) => option.setName('role').setDescription('Rôle').setRequired(true)) + .addStringOption((option) => + option + .setName('action') + .setDescription('Action') + .setRequired(true) + .addChoices({ name: 'Ajouter', value: 'add' }, { name: 'Retirer', value: 'remove' }), + ), + ); + +// TODO(M7-T05 / M7-T06): enforce role hierarchy (M3-T05) and log the change. +export async function execute(interaction) { + await interaction.reply({ embeds: [notImplementedEmbed('/role set')] }); +}