Resolve "Gestion des commandes actives" #12

Merged
dbroqua merged 1 commit from 2-gestion-des-commandes-actives into develop 2020-01-10 20:58:15 +01:00
Showing only changes of commit 6e34d923dd - Show all commits

View file

@ -183,7 +183,7 @@ const actions = (where, message, from) => {
allowedCmds = process.env[`AVAILABLE_CMD_${where.replace('#', '')}`].split(',')
}
const unknowmCmd = () => {
const unknownCmd = () => {
if (allowedCmds[0] === 'ALL' || allowedCmds.indexOf('!help') !== -1) {
botSay(where, 'Commande inconnue, tape !help si tu es perdu', false, true)
} else {
@ -198,56 +198,56 @@ const actions = (where, message, from) => {
if (allowedCmds[0] === 'ALL' || allowedCmds.indexOf('!artist') !== -1) {
artistSong.action(exploded[1].replace('!', ''), botSay, from, currentSong, exploded)
} else {
unknowmCmd()
unknownCmd()
}
break
case '!song':
if (allowedCmds[0] === 'ALL' || allowedCmds.indexOf('!song') !== -1) {
artistSong.action(exploded[1].replace('!', ''), botSay, from, currentSong, exploded)
} else {
unknowmCmd()
unknownCmd()
}
break
case '!help':
if (allowedCmds[0] === 'ALL' || allowedCmds.indexOf('!help') !== -1) {
Help.show(botSay, where, exploded, allowedCmds)
} else {
unknowmCmd()
unknownCmd()
}
break
case '!when':
if (allowedCmds[0] === 'ALL' || allowedCmds.indexOf('!when') !== -1) {
when.action(botSay, where, exploded)
} else {
unknowmCmd()
unknownCmd()
}
break
case '!stats':
if (allowedCmds[0] === 'ALL' || allowedCmds.indexOf('!stats') !== -1) {
stats.action(botSay, where, exploded)
} else {
unknowmCmd()
unknownCmd()
}
break
case '!list':
if (allowedCmds[0] === 'ALL' || allowedCmds.indexOf('!list') !== -1) {
list.action(botSay, where, exploded)
} else {
unknowmCmd()
unknownCmd()
}
break
case '!notifications':
if (allowedCmds[0] === 'ALL' || allowedCmds.indexOf('!notifications') !== -1) {
preferences.notifications(botSay, where, from, exploded)
} else {
unknowmCmd()
unknownCmd()
}
break
case '!stream':
if (allowedCmds[0] === 'ALL' || allowedCmds.indexOf('!stream') !== -1) {
botSay(where, process.env.PUBLIC_RADIO_STREAM)
} else {
unknowmCmd()
unknownCmd()
}
break
case '!mute':
@ -269,12 +269,12 @@ const actions = (where, message, from) => {
botSay(where, '!help mute', false, true)
}
} else {
unknowmCmd()
unknownCmd()
}
break
default:
unknowmCmd()
unknownCmd()
break
}
}