From 670c877249c7961b322794157b53e10d41dba611 Mon Sep 17 00:00:00 2001 From: suisho Date: Wed, 6 Mar 2013 23:36:41 +0900 Subject: [PATCH 1/2] Add send notice mode --- src/irc.coffee | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/irc.coffee b/src/irc.coffee index b622e86..0525289 100644 --- a/src/irc.coffee +++ b/src/irc.coffee @@ -41,7 +41,10 @@ class IrcBot extends Adapter return for str in strings - @bot.say target, str + if process.env.HUBOT_IRC_SEND_NOTICE_MODE? + @bot.notice target, str + else + @bot.say target, str notice: (envelope, strings...) -> for str in strings From 7944bf853b948858fffc21e6dd14e1cdf4aab847 Mon Sep 17 00:00:00 2001 From: suisho Date: Thu, 7 Mar 2013 10:37:53 +0900 Subject: [PATCH 2/2] 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