From 44c9595ae011795ea4bd2d5fb99ad28e075c7f06 Mon Sep 17 00:00:00 2001 From: nocode Date: Sun, 13 Sep 2026 12:19:12 +0200 Subject: [PATCH] feat(gitea): add pull request command skeleton Refs: #48 --- src/commands/gitea/pr.js | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 src/commands/gitea/pr.js diff --git a/src/commands/gitea/pr.js b/src/commands/gitea/pr.js new file mode 100644 index 0000000..9d3a1d9 --- /dev/null +++ b/src/commands/gitea/pr.js @@ -0,0 +1,31 @@ +import { SlashCommandBuilder } from 'discord.js'; +import { ACCESS_LEVELS } from '../../config/constants.js'; +import { notImplementedEmbed } from '../../ui/embeds.js'; + +export const access = ACCESS_LEVELS.USER; +export const subcommandAccess = { create: ACCESS_LEVELS.DEV }; + +export const data = new SlashCommandBuilder() + .setName('pr') + .setDescription('Pull requests Gitea') + .addSubcommand((sub) => + sub + .setName('create') + .setDescription('Créer une pull request') + .addStringOption((option) => option.setName('head').setDescription('Branche source').setRequired(true)) + .addStringOption((option) => option.setName('base').setDescription('Branche cible').setRequired(true)), + ) + .addSubcommand((sub) => + sub + .setName('view') + .setDescription('Afficher une pull request') + .addIntegerOption((option) => + option.setName('number').setDescription('Numéro de la PR').setRequired(true).setMinValue(1), + ), + ) + .addSubcommand((sub) => sub.setName('list').setDescription('Lister les pull requests ouvertes')); + +// TODO(M5-T04 / M5-T05): implement with services/gitea/gitea-client.js. +export async function execute(interaction) { + await interaction.reply({ embeds: [notImplementedEmbed(`/pr ${interaction.options.getSubcommand()}`)] }); +}