Skip to content

Commit bea8006

Browse files
committed
Removing duplicate code from earlier merge
1 parent a6fc4a0 commit bea8006

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

src/irc.coffee

+3-9
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class IrcBot extends Adapter
7474
@bot.send command, strings...
7575

7676
checkCanStart: ->
77-
if not process.env.HUBOT_IRC_NICK or @robot.name
77+
if not (process.env.HUBOT_IRC_NICK or @robot.name)
7878
throw new Error("HUBOT_IRC_NICK is not defined; try: export HUBOT_IRC_NICK='mybot'")
7979
else if not process.env.HUBOT_IRC_ROOMS
8080
throw new Error("HUBOT_IRC_ROOMS is not defined; try: export HUBOT_IRC_ROOMS='#myroom'")
@@ -148,18 +148,12 @@ class IrcBot extends Adapter
148148
bot.addListener 'join', (channel, who) ->
149149
console.log('%s has joined %s', who, channel)
150150
user = self.createUser channel, who
151-
self.receive new Robot.EnterMessage(user)
152-
153-
user = self.createUser channel, who
154-
self.receive new Robot.EnterMessage(user)
151+
self.receive new EnterMessage(user)
155152

156153
bot.addListener 'part', (channel, who, reason) ->
157154
console.log('%s has left %s: %s', who, channel, reason)
158155
user = self.createUser channel, who
159-
self.receive new Robot.LeaveMessage(user)
160-
161-
user = self.createUser channel, who
162-
self.receive new Robot.LeaveMessage(user)
156+
self.receive new LeaveMessage(user)
163157

164158
bot.addListener 'kick', (channel, who, _by, reason) ->
165159
console.log('%s was kicked from %s by %s: %s', who, channel, _by, reason)

0 commit comments

Comments
 (0)