Build/project structure #142

Merged
BlackAngelTV merged 80 commits from build/project-structure into main 2026-09-23 14:31:21 +02:00
Showing only changes of commit 3aa17e5707 - Show all commits
+21
View File
@@ -0,0 +1,21 @@
import { MessageFlags, SlashCommandBuilder } from 'discord.js';
import { ACCESS_LEVELS } from '../../config/constants.js';
import { getAccessLevel } from '../../core/permissions.js';
import { baseEmbed } from '../../ui/embeds.js';
export const access = ACCESS_LEVELS.USER;
export const data = new SlashCommandBuilder()
.setName('help')
.setDescription('Affiche les commandes accessibles selon ton rôle');
export async function execute(interaction) {
const level = getAccessLevel(interaction.member);
const lines = interaction.client.commands
.filter((command) => (command.access ?? ACCESS_LEVELS.USER) <= level)
.map((command) => `\`/${command.data.name}\` — ${command.data.description}`)
.sort();
const embed = baseEmbed().setTitle('Commandes FWS-Bot').setDescription(lines.join('\n'));
await interaction.reply({ embeds: [embed], flags: MessageFlags.Ephemeral });
}