A sanction could be applied but never lifted from Discord, so undoing a mistake meant leaving the bot for the server settings. Both lifts are recorded next to the sanctions they lift, which means widening the moderation history CHECK constraint through a table rebuild. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
71 lines
2.4 KiB
JavaScript
71 lines
2.4 KiB
JavaScript
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). */
|
||
export const MODERATION_ACTIONS = Object.freeze({
|
||
warn: { label: 'Avertissement', color: COLORS.warning, duration: false },
|
||
mute: { label: 'Exclusion temporaire', color: COLORS.moderation, duration: true },
|
||
unmute: { label: 'Levée d’exclusion temporaire', color: COLORS.success, duration: false },
|
||
kick: { label: 'Expulsion', color: COLORS.moderation, duration: false },
|
||
ban: { label: 'Bannissement', color: COLORS.error, duration: false },
|
||
unban: { label: 'Débannissement', color: COLORS.success, duration: false },
|
||
clear: { label: 'Suppression de messages', color: COLORS.warning, duration: false },
|
||
role: { label: 'Modification de rôle', 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', scope: ['staff', 'owner'] },
|
||
{ id: 'bug', label: 'Bug', scope: ['staff', 'dev', 'owner'] },
|
||
{ id: 'dev-question', label: 'Question de développement', scope: ['dev', 'owner'] },
|
||
{ id: 'report', label: 'Signalement', scope: ['staff', 'owner'] },
|
||
{ id: 'internal', label: 'Demande interne', 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',
|
||
]);
|