ubclaunchpad / rocket

:rocket: Slack bot, team management, and onboarding system for UBC Launch Pad - superseded by Rocket2: https://github.com/ubclaunchpad/rocket2
2 stars 0 forks source link

Add plugin support #62

Closed bfbachmann closed 6 years ago

bfbachmann commented 6 years ago

This PR adds a plugin package that allows users to write their own plugin types that implement the Plugin interface. These plugins can expose their own Slack event handlers and commands to the Bot (unfortunately they will have to rely heavily on the bot for access to the DB, the Slack API, logging, the GitHub API and so on).

Note that much of the diff in this rather large PR is just be refactoring existing Rocket commands into their own Core plugin.

bfbachmann commented 6 years ago

To be honest I don't think this Plugin abstraction actually provides devs much functionality that wasn't already there. That being said, what I think is useful about it is that it lowers the barrier to entry to newcomers. You no longer have to understand much about Rocket internals to implement some commands or event handlers, you just have to look at the plugin interface and copy it. It also allows us to separate chunks of code that perform similar work into their own package rather than having to keep putting more stuff into the bot package.