I have an instance of hubot running on heroku. I don't need any of the default behaviour (for example help command). Instead I'd like to choose my own commands and just have users input text with commands. In this case I just want to run pb
with every user input.
So if a user inputs hello
I'd like humbot to run pb hello
.
The code I'm trying based on mshish suggestion is in /scripts/example.cofee
module.exports = (robot) ->
robot.hear /.*/, (msg) ->
pb msg
you can also do this with middleware. I wrote this to log every message anyone ever said and where they said it. but you can get the idea. you can run any code where I am running the
@robot.logger.info
stuff