Updated BotSay

This commit is contained in:
dbroqua 2020-01-07 16:38:04 +01:00
parent ed5743d1f0
commit eacd9e6b5d
2 changed files with 5 additions and 5 deletions

View File

@ -49,7 +49,7 @@ const checkCurrentSong = () => {
console.info(`Now playing: ${currentSong.artist} - ${currentSong.title}`)
// 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
artistSong.saveCurrent({
@ -156,7 +156,7 @@ bot.addListener('error', function (message) {
* @param {String} 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)
break
case '!stream':
botSay(where, `${process.env.RADIO_ALIAS} : ${process.env.PUBLIC_RADIO_STREAM}`)
botSay(where, process.env.PUBLIC_RADIO_STREAM)
break
default:
botSay(where, 'Commande inconnue, tape !help si tu es perdu')

View File

@ -119,10 +119,10 @@ class ArtistSong {
}
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) {
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 !`)
}
})
})