I am trying to make Hubot detect when a user enters or leaves a channel, but so far I have been unable to actually find ANY information pertaining to this.
Does anyone have any ideas of how to do this? :)
Thanks in advance!
Hubot's Robot
class has functions enter
and leave
that will fire a callback you give when any user enters or leaves the room. That callback takes a Response
, which has a property message
of type Message
, which in turn has a property user
of type User
.
module.exports = (robot) ->
robot.enter (response) ->
# at this point you can get the user's name with:
# response.message.user.name
# works the same for robot.leave
However, it appears that the IRC adapter for hubot doesn't currently fire the messages needed to get those functions to work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With