Files
FWS-DiscordBot/src/config/constants.js
T
BlackAngelTV ed14b8260c
CI / quality (push) Has been cancelled
feat(tickets): open tickets from a panel button in any channel
Members had to know `/ticket create` and its category list to reach support,
so the entry point is now a panel: `/ticket setup` publishes it in the current
channel, the button opens a menu of the categories the member is allowed to
open, and the choice creates the ticket.

The panel channel and message are stored in `ticket_panels`, so a reinstall
replaces the previous message instead of leaving the server two entry points,
and the panel survives a restart.
2026-10-02 20:29:22 +02:00

106 lines
3.1 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
export const BOT_NAME = 'FWS-Bot';
/** Embed colors by category (M12-T01). */
export const COLORS = Object.freeze({
primary: 0x1793d1,
success: 0x2ecc71,
warning: 0xf1c40f,
error: 0xe74c3c,
info: 0x3498db,
gitea: 0x609926,
moderation: 0xe67e22,
ticket: 0x9b59b6,
});
/** Ordered from least to most privileged (M3-T01). */
export const ACCESS_LEVELS = Object.freeze({
USER: 0,
STAFF: 1,
DEV: 2,
OWNER: 3,
});
/** Same names for the same levels in every message (M12-T02). */
export const ACCESS_LABELS = Object.freeze({
[ACCESS_LEVELS.USER]: 'Membre',
[ACCESS_LEVELS.STAFF]: 'Staff',
[ACCESS_LEVELS.DEV]: 'Dev',
[ACCESS_LEVELS.OWNER]: 'Owner',
});
/**
* Moderation actions: Discord label, embed color and stored duration (M8).
* The emoji belongs to the entry so every surface (log channel, direct message,
* `/mod logs`, dashboard) tells a mute from a kick at a glance: the wording
* alone read like a temporary kick.
*/
export const MODERATION_ACTIONS = Object.freeze({
warn: { label: 'Avertissement', emoji: '⚠️', color: COLORS.warning, duration: false },
mute: { label: 'Mise en sourdine', emoji: '🔇', color: COLORS.moderation, duration: true },
unmute: {
label: 'Levée de la mise en sourdine',
emoji: '🔊',
color: COLORS.success,
duration: false,
},
kick: { label: 'Expulsion', emoji: '👢', color: COLORS.moderation, duration: false },
ban: { label: 'Bannissement', emoji: '🔨', color: COLORS.error, duration: false },
unban: { label: 'Débannissement', emoji: '🔓', color: COLORS.success, duration: false },
clear: { label: 'Supclusion de messages', emoji: '🧹', color: COLORS.warning, duration: false },
role: { label: 'Modification de rôle', emoji: '🏷️', color: COLORS.primary, duration: false },
});
/** Ticket categories and who can see them (M0-T05 / M6-T01). */
export const TICKET_CATEGORIES = Object.freeze([
{
id: 'support',
label: 'Aide et support',
description: 'Une question, besoin d’un coup de main',
scope: ['staff', 'owner'],
},
{
id: 'bug',
label: 'Bug',
description: 'Quelque chose ne marche pas comme prévu',
scope: ['staff', 'dev', 'owner'],
},
{
id: 'dev-question',
label: 'Question de développement',
description: 'Conseil, architecture, code',
scope: ['dev', 'owner'],
},
{
id: 'report',
label: 'Signalement',
description: 'Un membre ou un message pose problème',
scope: ['staff', 'owner'],
},
{
id: 'internal',
label: 'Demande interne',
description: 'Réservé à l’équipe',
scope: ['owner'],
},
]);
/** Gitea webhook event -> notification type (M9-T03). */
export const GITEA_EVENT_TYPES = Object.freeze({
issues: 'issues',
pull_request: 'pull_request',
push: 'push',
create: 'push',
delete: 'push',
release: 'release',
});
export const NOTIFICATION_TYPES = Object.freeze([
'issues',
'pull_requests',
'commits',
'releases',
'announcements',
'errors',
'community',
]);