From eacd9e6b5d894559e1885ec3ccf13374d0e98243 Mon Sep 17 00:00:00 2001 From: dbroqua Date: Tue, 7 Jan 2020 16:38:04 +0100 Subject: [PATCH] Updated BotSay --- index.js | 6 +++--- libs/ArtistSong.js | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/index.js b/index.js index 7079c43..0d6962f 100644 --- a/index.js +++ b/index.js @@ -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') diff --git a/libs/ArtistSong.js b/libs/ArtistSong.js index 53faf30..100394c 100644 --- a/libs/ArtistSong.js +++ b/libs/ArtistSong.js @@ -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 !`) } }) })