Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enter responder macro #69

Open
ryanwinchester opened this issue Jun 26, 2017 · 4 comments
Open

enter responder macro #69

ryanwinchester opened this issue Jun 26, 2017 · 4 comments

Comments

@ryanwinchester
Copy link

ryanwinchester commented Jun 26, 2017

hubot has enter and leave methods that can be very helpful.

well, at least the enter one is.

any plans on adding enter responder macro?

@scrogson
Copy link
Member

I've thought about these, but I've never really had a practical use-case for them. If you could outline what you'd expect from such macros and how they would be used, I could see if I can work that into the plans for 2.0.

@ryanwinchester
Copy link
Author

one example would be, when someone enters, the bot could greet them. there are some use-cases where we'd want to greet and give some instruction, or rules, or links to resources, etc

@scrogson
Copy link
Member

@ryanwinchester is this usually a one-off action? Would you actually want to define more than one of these type of responders?

I'm curious if this would make more sense for a callback in the robot module instead?

def handle_join(%Hedwig.Join{room: room, user: user}, state) do
  # ...
end

def handle_leave(%Hedwig.Leave{room: room, user: user}, state) do
  # ...
end

@bossyang
Copy link

bossyang commented Oct 5, 2017

And what about catchAll listener in Hubot?

module.exports = (robot) ->
   robot.catchAll (msg) ->
   msg.send "I don't know how to react to: #{msg.message.text}."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants