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

Add hubot.Robot.react #363

Merged
merged 2 commits into from
Oct 6, 2016
Merged

Commits on Oct 6, 2016

  1. Bump Hubot development dependency to ^2.19

    Per slackapi#360, this is the first step towards implementing a `robot.react`
    method based on:
    
    https://github.com/mbland/hubot-slack-reaction-example/blob/v1.1.0/scripts/handle-reaction.coffee
    
    The previous Hubot development dependency version was ~2.11, but the
    `robot.listen` method didn't appear until v2.16.0:
    
      hubotio/hubot#986
      hubotio/hubot#1035
    mbland committed Oct 6, 2016
    Configuration menu
    Copy the full SHA
    e32ef8a View commit details
    Browse the repository at this point in the history
  2. Add hubot.Robot.react

    Per slackapi#360, this implements `robot.react` as a replacement for the
    approach from:
    
    https://github.com/mbland/hubot-slack-reaction-example/blob/v1.1.0/scripts/handle-reaction.coffee
    
    Specifically, the `ReactionMessage` definition will no longer be
    required in client code, and this:
    
      robot.listen(
        (message) -> message instanceof ReactionMessage
        handleReaction
      )
    
    can now become:
    
      robot.react handleReaction
    
    `robot.react` can also take optional  `matcher` and `options` arguments
    just like the underlying `robot.listen` method:
    
      robot.react(
        (message) -> message.type == 'added' && message.reaction == '+1'
        {id: 'my-reaction-matcher'}
        handleReaction
      )
    mbland committed Oct 6, 2016
    Configuration menu
    Copy the full SHA
    e7d95c4 View commit details
    Browse the repository at this point in the history