@@ -74,7 +74,7 @@ class IrcBot extends Adapter
74
74
@bot .send command, strings...
75
75
76
76
checkCanStart : ->
77
- if not process .env .HUBOT_IRC_NICK or @robot .name
77
+ if not ( process .env .HUBOT_IRC_NICK or @robot .name )
78
78
throw new Error (" HUBOT_IRC_NICK is not defined; try: export HUBOT_IRC_NICK='mybot'" )
79
79
else if not process .env .HUBOT_IRC_ROOMS
80
80
throw new Error (" HUBOT_IRC_ROOMS is not defined; try: export HUBOT_IRC_ROOMS='#myroom'" )
@@ -148,18 +148,12 @@ class IrcBot extends Adapter
148
148
bot .addListener ' join' , (channel , who ) ->
149
149
console .log (' %s has joined %s' , who, channel)
150
150
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)
155
152
156
153
bot .addListener ' part' , (channel , who , reason ) ->
157
154
console .log (' %s has left %s: %s' , who, channel, reason)
158
155
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)
163
157
164
158
bot .addListener ' kick' , (channel , who , _by , reason ) ->
165
159
console .log (' %s was kicked from %s by %s: %s' , who, channel, _by, reason)
0 commit comments