From 9ccecb307167913e0ec0d656b1789a0dd39b1a08 Mon Sep 17 00:00:00 2001 From: nocode Date: Sun, 13 Sep 2026 12:19:14 +0200 Subject: [PATCH] feat(polls): add poll command skeleton Refs: #82 --- src/commands/community/poll.js | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 src/commands/community/poll.js diff --git a/src/commands/community/poll.js b/src/commands/community/poll.js new file mode 100644 index 0000000..79e64a9 --- /dev/null +++ b/src/commands/community/poll.js @@ -0,0 +1,34 @@ +import { 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('poll') + .setDescription('Sondages') + .addSubcommand((sub) => + sub + .setName('create') + .setDescription('Créer un sondage') + .addStringOption((option) => + option.setName('question').setDescription('Question').setRequired(true).setMaxLength(200), + ) + .addStringOption((option) => + option.setName('choices').setDescription('Choix séparés par ";" (2 à 10)').setRequired(true), + ) + .addIntegerOption((option) => + option.setName('minutes').setDescription('Durée en minutes').setMinValue(1).setMaxValue(10_080), + ), + ) + .addSubcommand((sub) => + sub + .setName('close') + .setDescription('Fermer un sondage') + .addIntegerOption((option) => option.setName('id').setDescription('ID du sondage').setRequired(true)), + ); + +// TODO(M10-T01..T06): implement with polls / poll_votes tables. +export async function execute(interaction) { + await interaction.reply({ embeds: [notImplementedEmbed(`/poll ${interaction.options.getSubcommand()}`)] }); +}