Skip to content

Commit

Permalink
move out if statement
Browse files Browse the repository at this point in the history
  • Loading branch information
suisho committed Mar 7, 2013
1 parent 670c877 commit 7944bf8
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/irc.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7944bf8

Please sign in to comment.