Skip to content

Commit 7944bf8

Browse files
committed
move out if statement
1 parent 670c877 commit 7944bf8

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/irc.coffee

+3-5
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,10 @@ class IrcBot extends Adapter
3939
unless target
4040
console.log "ERROR: Not sure who to send to. envelope=", envelope
4141
return
42-
42+
43+
speak = if process.env.HUBOT_IRC_SEND_NOTICE_MODE? then "notice" else "say"
4344
for str in strings
44-
if process.env.HUBOT_IRC_SEND_NOTICE_MODE?
45-
@bot.notice target, str
46-
else
47-
@bot.say target, str
45+
@bot[speak] target, str
4846

4947
notice: (envelope, strings...) ->
5048
for str in strings

0 commit comments

Comments
 (0)