discord-modmail / modmail

A Modmail bot for Discord. Allowing safe moderator conversations with server members one server at a time.
https://discord-modmail.readthedocs.io/
MIT License
15 stars 8 forks source link

[Addons]: Installation system #63

Open onerandomusername opened 3 years ago

onerandomusername commented 3 years ago

## Overview

Installation system for plugins. Portions of this may be used in the future for other addons, so nearly everything up to when the import is done should be in an addons.py utility file.

The currently supported type of repos are in zip format, using the following structure:

user/repo/Plugins/name/name.py

This gives the advantage to be able to extend the addons api in the future without having to worry about the structure of the repo.

Details

Provided a github or gitlab repo, should parse it to get the specific plugin information, if it exists, from the index.toml file. (I'm open to renaming this file, if someone has a better idea.)

This allows for a user to see what plugins are available in a repo, without installing them. At minimum, this should support github and gitlab repos, given that we can utilize the api to see what is available without downloading. If an index.toml file exists, it should be parsed to get the information. If it does not exist, then we need to get a list of all of the directories in the Plugins folder, which will construct our list of plugins. This does have the side effect of not having any of the metadata for any of the plugins, but I'm of the opinion that an index.toml file is optional and should not be required.

At minimum, the portions that should be in an utils file are: