feat(support): add ticket command skeleton
Refs: #52 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 file changed
+43
@@ -0,0 +1,43 @@
|
||||
import { SlashCommandBuilder } from 'discord.js';
|
||||
import { ACCESS_LEVELS, TICKET_CATEGORIES } from '../../config/constants.js';
|
||||
import { notImplementedEmbed } from '../../ui/embeds.js';
|
||||
|
||||
export const access = ACCESS_LEVELS.USER;
|
||||
// `close` is also allowed for the ticket author: checked in the ticket service.
|
||||
export const subcommandAccess = { claim: ACCESS_LEVELS.STAFF, add: ACCESS_LEVELS.STAFF };
|
||||
|
||||
export const data = new SlashCommandBuilder()
|
||||
.setName('ticket')
|
||||
.setDescription('Tickets de support privés')
|
||||
.addSubcommand((sub) =>
|
||||
sub
|
||||
.setName('create')
|
||||
.setDescription('Ouvrir un ticket')
|
||||
.addStringOption((option) =>
|
||||
option
|
||||
.setName('category')
|
||||
.setDescription('Catégorie du ticket')
|
||||
.setRequired(true)
|
||||
.addChoices(...TICKET_CATEGORIES.map(({ id, label }) => ({ name: label, value: id }))),
|
||||
),
|
||||
)
|
||||
.addSubcommand((sub) =>
|
||||
sub
|
||||
.setName('close')
|
||||
.setDescription('Fermer le ticket')
|
||||
.addStringOption((option) => option.setName('reason').setDescription('Raison').setMaxLength(500)),
|
||||
)
|
||||
.addSubcommand((sub) => sub.setName('claim').setDescription('Prendre le ticket en charge'))
|
||||
.addSubcommand((sub) =>
|
||||
sub
|
||||
.setName('add')
|
||||
.setDescription('Ajouter un participant')
|
||||
.addUserOption((option) => option.setName('user').setDescription('Membre à ajouter').setRequired(true)),
|
||||
);
|
||||
|
||||
// TODO(M6-T03..T09): implement with a ticket service backed by the tickets table.
|
||||
export async function execute(interaction) {
|
||||
await interaction.reply({
|
||||
embeds: [notImplementedEmbed(`/ticket ${interaction.options.getSubcommand()}`)],
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user