-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.js
46 lines (40 loc) · 1.63 KB
/
config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import { ButtonBuilder, ButtonStyle } from 'discord.js';
import 'dotenv/config';
export const getEnvKeyOrThrow = key => {
const value = process.env[key];
if (!process.env[key]) {
throw new Error(`${key} was not found (or is empty) in process.env`);
}
return value;
};
export const getShowButton = channelId => new ButtonBuilder()
.setCustomId(`show:${channelId}`)
.setLabel('Suivre la sortie')
.setStyle(ButtonStyle.Primary);
const getHideButton = channelId => new ButtonBuilder()
.setCustomId(`hide:${channelId}`)
.setLabel('Masquer la sortie')
.setStyle(ButtonStyle.Secondary);
export const BUTTON_CONFIG = {
show: {
displayChannel: true,
message: 'Le salon est désormais visible dans Sorties',
getNextButton: getHideButton,
},
hide: {
displayChannel: false,
message: 'Le salon est masqué',
getNextButton: getShowButton,
},
};
export const COMMANDS = {
activate: { commandName: 'activer-suivi-sorties', helpText: 'Permet de suivre uniquement les sorties que tu as choisies' },
deactivate: { commandName: 'desactiver-suivi-sorties', helpText: 'Affiche toutes les sorties proposées' },
carpool: { commandName: 'covoit', helpText: 'Permet de proposer une ou plusieurs places en voiture', numberOfSeatsOption: 'places_disponibles' },
};
export const MUTE_CATEGORY = getEnvKeyOrThrow('MUTE_CATEGORY');
export const GENERAL_CHANNEL = getEnvKeyOrThrow('GENERAL_CHANNEL');
export const CHANNEL_TOGGLE_ROLE_ID = getEnvKeyOrThrow('CHANNEL_TOGGLE_ROLE_ID');
export const BOT_TOKEN = getEnvKeyOrThrow('BOT_TOKEN');
export const APPLICATION_ID = getEnvKeyOrThrow('APPLICATION_ID');
export const GUILD_ID = getEnvKeyOrThrow('GUILD_ID');