-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathevents.js
33 lines (29 loc) · 1.11 KB
/
events.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
const { zokou } = require('../framework/zokou');
const { attribuerUnevaleur } = require('../bdd/welcome');
async function events(nomCom) {
zokou({
nomCom: nomCom,
categorie: 'Group'
}, async (dest, zk, commandeOptions) => {
const { ms, arg, repondre, superUser, verifAdmin } = commandeOptions;
if (verifAdmin || superUser) {
if (!arg[0] || arg.join(' ') === ' ') {
repondre(nomCom + ' ' + ' on to active and ' + ' ' + nomCom + ' ' + 'off to put off');
} else {
if (arg[0] === 'on' || arg[0] === 'off') {
await attribuerUnevaleur(dest, nomCom, arg[0]);
repondre( nomCom + "is actualised on " + arg[0]);
} else {
repondre('on for active and off for desactive');
}
}
} else {
repondre('You can\'t use this command lol ');
}
});
}
// Appel de la fonction events pour les valeurs 'welcome' et 'goodbye'
events('welcome');
events('goodbye');
events('antipromote');
events('antidemote') ;