Fixed bug

This commit is contained in:
dbroqua 2020-01-10 20:57:46 +01:00
parent deb5762956
commit 6e34d923dd

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
}
}