From bd2475cb73d76dd095927ff5b4a42700649c018e Mon Sep 17 00:00:00 2001 From: nocode Date: Sun, 13 Sep 2026 12:19:12 +0200 Subject: [PATCH] feat(gitea): add issue command skeleton Refs: #48 --- src/commands/gitea/issue.js | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/commands/gitea/issue.js diff --git a/src/commands/gitea/issue.js b/src/commands/gitea/issue.js new file mode 100644 index 0000000..549db19 --- /dev/null +++ b/src/commands/gitea/issue.js @@ -0,0 +1,27 @@ +import { SlashCommandBuilder } from 'discord.js'; +import { ACCESS_LEVELS } from '../../config/constants.js'; +import { notImplementedEmbed } from '../../ui/embeds.js'; + +export const access = ACCESS_LEVELS.USER; + +// TODO(M5-T03): make the required level for `create` configurable per guild. +export const subcommandAccess = { create: ACCESS_LEVELS.USER }; + +export const data = new SlashCommandBuilder() + .setName('issue') + .setDescription('Issues Gitea') + .addSubcommand((sub) => sub.setName('create').setDescription('Créer une issue Gitea')) + .addSubcommand((sub) => + sub + .setName('view') + .setDescription('Afficher une issue') + .addIntegerOption((option) => + option.setName('number').setDescription("Numéro de l'issue").setRequired(true).setMinValue(1), + ), + ) + .addSubcommand((sub) => sub.setName('list').setDescription('Lister les issues ouvertes')); + +// TODO(M5-T02 / M5-T03): implement with services/gitea/gitea-client.js. +export async function execute(interaction) { + await interaction.reply({ embeds: [notImplementedEmbed(`/issue ${interaction.options.getSubcommand()}`)] }); +}