Skip to content

Commit

Permalink
Removing duplicate code from earlier merge
Browse files Browse the repository at this point in the history
  • Loading branch information
jgable committed Jul 19, 2012
1 parent a6fc4a0 commit bea8006
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/irc.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class IrcBot extends Adapter
@bot.send command, strings...

checkCanStart: ->
if not process.env.HUBOT_IRC_NICK or @robot.name
if not (process.env.HUBOT_IRC_NICK or @robot.name)
throw new Error("HUBOT_IRC_NICK is not defined; try: export HUBOT_IRC_NICK='mybot'")
else if not process.env.HUBOT_IRC_ROOMS
throw new Error("HUBOT_IRC_ROOMS is not defined; try: export HUBOT_IRC_ROOMS='#myroom'")
Expand Down Expand Up @@ -148,18 +148,12 @@ class IrcBot extends Adapter
bot.addListener 'join', (channel, who) ->
console.log('%s has joined %s', who, channel)
user = self.createUser channel, who
self.receive new Robot.EnterMessage(user)

user = self.createUser channel, who
self.receive new Robot.EnterMessage(user)
self.receive new EnterMessage(user)

bot.addListener 'part', (channel, who, reason) ->
console.log('%s has left %s: %s', who, channel, reason)
user = self.createUser channel, who
self.receive new Robot.LeaveMessage(user)

user = self.createUser channel, who
self.receive new Robot.LeaveMessage(user)
self.receive new LeaveMessage(user)

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

0 comments on commit bea8006

Please sign in to comment.