hubot-archive / hubot-shipit

A hubot script that provides easy access to the shipit squirrel and its kin
16 stars 40 forks source link

Make the shipit response mode configurable #4

Open ravikiranj opened 9 years ago

ravikiranj commented 9 years ago

robot.hear often leads to spam in chat rooms (this maybe by design). We can atleast make the mode configurable like something below ?

if process.env.HUBOT_SHIP_IT_RESPOND_MODE?
    robot.respond regex, (msg) ->
        msg.send msg.random squirrels
else
    robot.hear regex, (msg) ->
        msg.send msg.random squirrels

If this above sounds like a reasonable solution, I can submit a pull request.

technicalpickles commented 9 years ago

I seem to think the script has varied a few times between hear and respond, so I think a configuration mode makes sense.

The only caveat I'd mention is that you might need to manually track the help commands, because the static Commands section only lists 'ship it', which if you turn on respond mod, would not be correct (it'd need to be hubot ship it).