cog icon indicating copy to clipboard operation
cog copied to clipboard

Respond to regex matches without directly being mentioned.

Open drobati opened this issue 7 years ago • 2 comments

Cog is great, but one use case that it can't handle is responding to matched patterns in all text in a channel.

For example check out https://github.com/github/hubot/blob/master/src/robot.coffee#L103.

A use case, perhaps the bot would print useful information from JIRA, Bugzilla, or some other issue tracker. It sees a pattern like s/BUG ([0-9]+)/, queries an API for that bug number, then outputs helpful information.

With cog's bundling, I believe you could have the query portion written in whatever language, run as a relay. And have a listen object instead of command object, with its own permissions system. This way you could also utilize the template system.

This would eliminate the need for other bots in my stack, AND would actually give me a permissions system as hubot doesn't have great control for channels/users/groups.

drobati avatar Mar 09 '17 19:03 drobati

This is a much needed feature. Creating bundles that can inject information based on keywords is an important feature. I was rather surprised that this doesn't yet exist in cog. Perhaps there's a way to leverage the existing work with triggers, and add listeners that can execute a trigger.

Thanks for all the hard work with cog!

jesselang avatar Mar 27 '17 17:03 jesselang

I'm imagining a separate type of (ie, instead of being listed under commands in the config, they'd be something likst listeners).

This seems like a good idea, although I'm not familiar enough with the codebase yet to know how much work it will be. I think we should figure out what the priority of this is in relation to other things we'd like to work on.

nmohoric avatar Aug 18 '17 12:08 nmohoric