Resolve "Gestion des admins" #14

Merged
dbroqua merged 1 commit from 4-gestion-des-admins into develop 2020-01-13 14:46:00 +01:00
Showing only changes of commit 7cd51aaf94 - Show all commits

View file

@ -174,6 +174,7 @@ const botSay = (where, what, dontDisplayRadio, forceSend) => {
*/
const actions = (where, message, from) => {
const exploded = message.split(' ')
const admins = (process.env.ADMINISTRATORS || 'ALL').toLowerCase().split(',')
let allowedCmds = ['ALL']
if (process.env.AVAILABLE_CMD) {
@ -251,6 +252,7 @@ const actions = (where, message, from) => {
}
break
case '!mute':
if (admins[0] === 'ALL' || allowedCmds.indexOf(from.toLowerCase()) !== -1) {
if (allowedCmds[0] === 'ALL' || allowedCmds.indexOf('!mute') !== -1) {
if (exploded[2] && ['on', 'off', 'state'].indexOf(exploded[2]) !== -1) {
switch (exploded[2]) {
@ -271,6 +273,9 @@ const actions = (where, message, from) => {
} else {
unknownCmd()
}
} else {
botSay(where, 'Bien tenté mais...')
}
break
default: