Updated BotSay
This commit is contained in:
parent
ed5743d1f0
commit
eacd9e6b5d
2 changed files with 5 additions and 5 deletions
6
index.js
6
index.js
|
@ -49,7 +49,7 @@ const checkCurrentSong = () => {
|
||||||
console.info(`Now playing: ${currentSong.artist} - ${currentSong.title}`)
|
console.info(`Now playing: ${currentSong.artist} - ${currentSong.title}`)
|
||||||
|
|
||||||
// Publish song on IRC channel
|
// Publish song on IRC channel
|
||||||
bot.say(process.env.IRC_CHANNEL, `${process.env.RADIO_ALIAS} : ${currentSong.artist} - ${currentSong.title}`)
|
botSay(process.env.IRC_CHANNEL, `${currentSong.artist} - ${currentSong.title}`)
|
||||||
|
|
||||||
// Save song for history
|
// Save song for history
|
||||||
artistSong.saveCurrent({
|
artistSong.saveCurrent({
|
||||||
|
@ -156,7 +156,7 @@ bot.addListener('error', function (message) {
|
||||||
* @param {String} what
|
* @param {String} what
|
||||||
*/
|
*/
|
||||||
const botSay = (where, what) => {
|
const botSay = (where, what) => {
|
||||||
bot.say(where, what)
|
bot.say(where, `${process.env.RADIO_ALIAS} : ${what}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -191,7 +191,7 @@ const actions = (where, message, from) => {
|
||||||
preferences.notifications(botSay, where, from, exploded)
|
preferences.notifications(botSay, where, from, exploded)
|
||||||
break
|
break
|
||||||
case '!stream':
|
case '!stream':
|
||||||
botSay(where, `${process.env.RADIO_ALIAS} : ${process.env.PUBLIC_RADIO_STREAM}`)
|
botSay(where, process.env.PUBLIC_RADIO_STREAM)
|
||||||
break
|
break
|
||||||
default:
|
default:
|
||||||
botSay(where, 'Commande inconnue, tape !help si tu es perdu')
|
botSay(where, 'Commande inconnue, tape !help si tu es perdu')
|
||||||
|
|
|
@ -119,10 +119,10 @@ class ArtistSong {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (artist.length > 0) {
|
if (artist.length > 0) {
|
||||||
botSay(where, `${process.env.RADIO_ALIAS} : Hey ${artist.toString().replace(/,/g, ', ')} ! Y'a ${currentSong.artist} ! Monte${artist.length > 1 ? 'z' : ''} le son !`)
|
botSay(where, `Hey ${artist.toString().replace(/,/g, ', ')} ! Y'a ${currentSong.artist} ! Monte${artist.length > 1 ? 'z' : ''} le son !`)
|
||||||
}
|
}
|
||||||
if (song.length > 0) {
|
if (song.length > 0) {
|
||||||
botSay(where, `${process.env.RADIO_ALIAS} : Hey ${song.toString().replace(/,/g, ', ')} ! Y'a ${song.title} ! Monte${song.length > 1 ? 'z' : ''} le son !`)
|
botSay(where, `Hey ${song.toString().replace(/,/g, ', ')} ! Y'a ${song.title} ! Monte${song.length > 1 ? 'z' : ''} le son !`)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue