Skip to content

Commit 276f1df

Browse files
committed
Merge pull request nandub#98 from 5thWall/bug/joinpart
Pass user to Leave and Enter Message constructors
2 parents f5b5496 + 637effc commit 276f1df

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/irc.coffee

+4-2
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,16 @@ class IrcBot extends Adapter
5858
@bot.join channel, () ->
5959
console.log('joined %s', channel)
6060

61-
self.receive new EnterMessage(null)
61+
selfUser = self.getUserFromName self.robot.name
62+
self.receive new EnterMessage(selfUser)
6263

6364
part: (channel) ->
6465
self = @
6566
@bot.part channel, () ->
6667
console.log('left %s', channel)
6768

68-
self.receive new LeaveMessage(null)
69+
selfUser = self.getUserFromName self.robot.name
70+
self.receive new LeaveMessage(selfUser)
6971

7072
getUserFromName: (name) ->
7173
return @robot.brain.userForName(name) if @robot.brain?.userForName?

0 commit comments

Comments
 (0)