rmmh / skybot

Python IRC bot
https://github.com/rmmh/skybot/wiki
The Unlicense
247 stars 169 forks source link

RFC: Pull in plugins from External Modules #202

Open imnotjames opened 5 years ago

imnotjames commented 5 years ago

I'm opening this to go over a feature I'm working on that requires a bit of a change on the internals of skybot, so I thought it'd be best to open an RFC issue before I go and start throwing the pull requests out there.

I have been wanting to pull in plugins from external modules. Why? Because there are plugins that I have that I'd like to share - plugins which are useful (or useless but funny) but which I don't think fit in with the main skybot repository. They might require external modules (like a few reddit plugins I've made or the amazon plugin) or are just less useful for other folks (a plugin for an in-joke with the IRC channels the bot runs on).

I'm also be interested in pulling skybot as a dependency of a separate application so we can extend on top of it without having to copy all the files and adding in custom plugins with a simple install (eg teampeggle/ppp-helpdesk). Right now it's painful because I have to manually sync all the changes.

It is possible to do this! I've been experimenting with a few things to do this, which mostly entails cleaning up the codebase:

Ideally, the configuration for specifying plugins would default to all plugins under skybot.plugins.* (backwards compatibility), and if specified would then start pulling in plugins to use, setting up the reloader, etc.

After these are complete, any module within the python path can be used as a plugin! EG, if you were to pip install skybot-plugin-awesome, you could pull it in as a fantastic new plugin without copying it to the plugins directory!

Thoughts, concerns, etc?