From 925a0c519dcfd31c6c8d1984807f3816c06c6573 Mon Sep 17 00:00:00 2001 From: dbroqua Date: Fri, 10 Jan 2020 08:58:12 +0100 Subject: [PATCH] Updated prefix radio message --- index.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index 0d6962f..34cb389 100644 --- a/index.js +++ b/index.js @@ -154,9 +154,11 @@ bot.addListener('error', function (message) { * Fonction permettant de publier un message sur IRC * @param {String} where * @param {String} what + * @param {Boolean} displayRadio */ -const botSay = (where, what) => { - bot.say(where, `${process.env.RADIO_ALIAS} : ${what}`) +const botSay = (where, what, displayRadio) => { + const message = `${(displayRadio ? `${process.env.RADIO_ALIAS} : ` : '')} ${what}` + bot.say(where, message) } /** @@ -213,7 +215,7 @@ if (process.env.SAY_HELLO && process.env.SAY_HELLO === 'true') { bot.addListener('join', (channel, who) => { // Welcome them in! if (who !== process.env.IRC_NICKNAME) { - botSay(process.env.IRC_CHANNEL, 'Hello ' + who + '! Have a metal day! \\m/(-.-)\\m/') + botSay(process.env.IRC_CHANNEL, 'Hello ' + who + '! Have a metal day! \\m/(-.-)\\m/', false) } }) }