1 file changed
+57
@@ -0,0 +1,57 @@
|
|||||||
|
import { SlashCommandBuilder } from 'discord.js';
|
||||||
|
import { ACCESS_LEVELS } from '../../config/constants.js';
|
||||||
|
import { env } from '../../config/env.js';
|
||||||
|
import { linkButtons } from '../../ui/buttons.js';
|
||||||
|
import { baseEmbed, notImplementedEmbed } from '../../ui/embeds.js';
|
||||||
|
|
||||||
|
export const access = ACCESS_LEVELS.USER;
|
||||||
|
|
||||||
|
export const data = new SlashCommandBuilder()
|
||||||
|
.setName('fws')
|
||||||
|
.setDescription('Informations sur FWS et FWS Arch')
|
||||||
|
.addSubcommand((sub) => sub.setName('info').setDescription('Présente FWS et FWS Arch'))
|
||||||
|
.addSubcommand((sub) => sub.setName('version').setDescription('Version actuelle de FWS Arch'))
|
||||||
|
.addSubcommand((sub) => sub.setName('status').setDescription('État des services et projets'))
|
||||||
|
.addSubcommand((sub) => sub.setName('links').setDescription('Ressources officielles'))
|
||||||
|
.addSubcommand((sub) =>
|
||||||
|
sub
|
||||||
|
.setName('changelog')
|
||||||
|
.setDescription("Changements d'une version")
|
||||||
|
.addStringOption((option) => option.setName('version').setDescription('Version (dernière par défaut)')),
|
||||||
|
);
|
||||||
|
|
||||||
|
const officialLinks = () => [
|
||||||
|
{ label: 'Site', url: env.links.website },
|
||||||
|
{ label: 'Documentation', url: env.links.docs },
|
||||||
|
{ label: 'Dépôt FWS Arch', url: env.links.archRepo },
|
||||||
|
{ label: 'Gitea', url: env.gitea.url },
|
||||||
|
{ label: 'Discord', url: env.links.discordInvite },
|
||||||
|
];
|
||||||
|
|
||||||
|
const handlers = {
|
||||||
|
// TODO(M4-T01): content should come from guild_settings (M4-T07).
|
||||||
|
info: (interaction) =>
|
||||||
|
interaction.reply({
|
||||||
|
embeds: [
|
||||||
|
baseEmbed()
|
||||||
|
.setTitle('FWS & FWS Arch')
|
||||||
|
.setDescription(
|
||||||
|
'FWS est une organisation open source multi-projets.\n' +
|
||||||
|
"**FWS Arch** est un fork d'Arch Linux avec une surcouche conviviale.",
|
||||||
|
),
|
||||||
|
],
|
||||||
|
components: linkButtons(officialLinks()),
|
||||||
|
}),
|
||||||
|
links: (interaction) =>
|
||||||
|
interaction.reply({
|
||||||
|
embeds: [baseEmbed().setTitle('Liens officiels FWS')],
|
||||||
|
components: linkButtons(officialLinks()),
|
||||||
|
}),
|
||||||
|
version: (interaction) => interaction.reply({ embeds: [notImplementedEmbed('/fws version')] }),
|
||||||
|
status: (interaction) => interaction.reply({ embeds: [notImplementedEmbed('/fws status')] }),
|
||||||
|
changelog: (interaction) => interaction.reply({ embeds: [notImplementedEmbed('/fws changelog')] }),
|
||||||
|
};
|
||||||
|
|
||||||
|
export async function execute(interaction) {
|
||||||
|
await handlers[interaction.options.getSubcommand()](interaction);
|
||||||
|
}
|
||||||
Reference in new issue
Block a user