chalda / DiscordBot

A chat bot for discord app based off discord.js
GNU General Public License v2.0
585 stars 354 forks source link

Proper Plugin Management #25

Open Einarin opened 8 years ago

Einarin commented 8 years ago

We kinda sorta have a little bit of a plugin architecture now, but it needs work. In particular plugins having npm dependencies is a mess. It'd be nice to be able to enable and disable individual plugins via config. etc.

chalda commented 8 years ago

Ok its really time to do this the right way.

Re: Pull request #46 I am not entirely sure what you are doing with the keyword search there. The bot should have permissions set by server admin. Commands should have privileges (or be public). The keyword block is sort of a crude way of doing that.

Lets start a discussion for this pull request so we can architect the shit out of this. The plugins/commands right now are a huge mess.

@Devlix so the only issue I have is, I am looking into building Windows/OSX/Linux binaries out of this for easier distribution (cause fuck everything about how people need to deploy this right now..). So the only downside is that the builders really want you to have all your dependencies preinstalled. This means that dynamic requirement loading is awesome but might make this a bit challenging. Ill look into if there is a tool that will load binaries from NPM directly or something... It also becomes an issue if the plugins are to work the way i think they should:

download a zip from someones github/website. drop it into your plugins folder. reload bot.

Perhaps its worth looking into HuBot (runs on CoffeeScript/Node) or other big chatbots out there to see how they do it

@Einarin @Devlix @milesflo (just tagging main commiters so far thanks guyst! :D)

christoabrown commented 8 years ago

How does this binary stuff work? As it is right now when it goes to download the required modules for plugins it uses the 'npm' module which should download the modules whether or not the user has npm set up correctly in windows path etc.

Einarin commented 8 years ago

Is this done-ish? we have plugins now via plugins.js , but most of the commands are still in discord_bot.js. Moving things would be an easy change for someone who wants to contribute.