From 7944bf853b948858fffc21e6dd14e1cdf4aab847 Mon Sep 17 00:00:00 2001 From: suisho Date: Thu, 7 Mar 2013 10:37:53 +0900 Subject: [PATCH] move out if statement --- src/irc.coffee | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/irc.coffee b/src/irc.coffee index 0525289..3e65f68 100644 --- a/src/irc.coffee +++ b/src/irc.coffee @@ -39,12 +39,10 @@ class IrcBot extends Adapter unless target console.log "ERROR: Not sure who to send to. envelope=", envelope return - + + speak = if process.env.HUBOT_IRC_SEND_NOTICE_MODE? then "notice" else "say" for str in strings - if process.env.HUBOT_IRC_SEND_NOTICE_MODE? - @bot.notice target, str - else - @bot.say target, str + @bot[speak] target, str notice: (envelope, strings...) -> for str in strings