Skip to content

preload plugin modules#46

Merged
Einarin merged 6 commits into
chalda:masterfrom
christoabrown:master
Mar 1, 2016
Merged

preload plugin modules#46
Einarin merged 6 commits into
chalda:masterfrom
christoabrown:master

Conversation

@christoabrown
Copy link
Copy Markdown
Collaborator

Installs the required modules for the plugins before trying to load them through the package.json "dependencies" located in each of the plugin folders. This makes the plugins easier to install as the user would not have to worry about adding modules to the project.

@chalda
Copy link
Copy Markdown
Owner

chalda commented Feb 4, 2016

I like it been meaning to implement something like this since the project
started. Thanks man! There even was a ticket for this somewhere.
On Feb 3, 2016 8:16 PM, "Devlix" notifications@github.com wrote:

Installs the required modules for the plugins before trying to load them
through the package.json "dependencies" located in each of the plugin
folders. This makes the plugins easier to install as the user would not

have to worry about adding modules to the project.

You can view, comment on, or merge this pull request online at:

#46
Commit Summary

  • preload plugin modules

File Changes

Patch Links:


Reply to this email directly or view it on GitHub
#46.

@chalda
Copy link
Copy Markdown
Owner

chalda commented Feb 4, 2016

did you actually move the plugins out btw? Also you removed the requests dep?

@christoabrown
Copy link
Copy Markdown
Collaborator Author

The plugins are still there and the request dep should get installed because it is a dependency in the plugins/images/package.json

@chalda
Copy link
Copy Markdown
Owner

chalda commented Feb 4, 2016

ah gotcha. didnt see that :D
tell you what ill take this even further tomorrow. separate that monster command block from main. i am thinking put a plugin.js file in each folder and have that define the plugins. then to add/remove plugins you can just unpack them in the plugins folder, or zip/remove them to take them out.

@christoabrown
Copy link
Copy Markdown
Collaborator Author

Yeah ideally I would imagine we would have no commands in the main file and try to group the existing ones into plugins. I feel we need to handle permissions for certain things in the main file though like probably overwrite the existing ban and kick functions to check the permissions of the message author.

@chalda
Copy link
Copy Markdown
Owner

chalda commented Feb 4, 2016

I have some idea how this could work. Another feature I wanna add needs
some persistence so I'll see what we can do.
On Feb 4, 2016 12:14 AM, "Devlix" notifications@github.com wrote:

Yeah ideally I would imagine we would have no commands in the main file
and try to group the existing ones into plugins. I feel we need to handle
permissions for certain things in the main file though like probably
overwrite the existing ban and kick functions to check the permissions of
the message author.


Reply to this email directly or view it on GitHub
#46 (comment).

@christoabrown
Copy link
Copy Markdown
Collaborator Author

Hey so maybe we should turn this branch into the plugin feature branch and go through the requirements before merging. I can separate the existing functionality into a plugin.js so it is easier to work on and merge later.

@christoabrown
Copy link
Copy Markdown
Collaborator Author

So I moved that functionality over in ce14ba4 I also added something in there that searches the plugins for certain function like banMember etc. and it will disable the plugin by default and warn the owner about it until it is allowed in options.json. Let me know what you think about that.

@chalda chalda mentioned this pull request Feb 5, 2016
@christoabrown
Copy link
Copy Markdown
Collaborator Author

Alright so I got rid of the plugin blocking and I added the code needed to load plugins for an Electrify build if we are to use that, only tested on a Windows build though.

@christoabrown
Copy link
Copy Markdown
Collaborator Author

So I want to go ahead and merge this then I have some stuff for creating electron builds.

Einarin added a commit that referenced this pull request Mar 1, 2016
@Einarin Einarin merged commit 6b18c42 into chalda:master Mar 1, 2016
nmynarcik pushed a commit to nmynarcik/DiscordBot that referenced this pull request Mar 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants