General Troubleshooting
Hey there! Before you report a bug or suggest a new feature,
please make sure to follow these steps first!
This is not the place to learn Java. Please refer to StackOverflow
for your general programming questions.
Issue
Issue Type
For questions join the official AvaIre discord server: https://discord.gg/gt2FWER
Description
The ;plugin
system command already exists, and it has the ability to list available and installed plugins, having the additional feature of being able to install or remove an installed plugin right from Discord through a command would be pretty sweet!
Note: In the description below, <>
is used to represent required arguments seperated by a pipe character |
, while []
is used to represent optional arguments that could be excluded from a command.
Adding/Installing Plugin
Adding or installing a plugin through a command could use the plugins source
field to handle different sources like github, bitbucket, gitlab, etc. Once the source is known, the releases for the sources could be searched for a jar file, from there the file could be selected by their version, downloaded and installed.
We can most likely not avoid having to restart the bot, but just being able to find and download the jar file would be pretty nice.
An example of the command could be:
;plugin <install|i> <plugin-name> <tag/version>
Using the command without the tag/version should display a list of avilable tags/versions for the given plugin.
If the plugin is already installed and the version matches the given version the install should not be run, while if the version given is higher a promt should be given before the command is actually invoked, just to let the user know that they're upgrading to a new version of the plugin and with the changes to the plugin, they may need to upgrade their bot as well, since plugins can defined the minimum version of Ava they can be used on.
Removing Installed Plugins
Removing a plugin should be easy enough as we're already able to list installed plugins, we just have to find the plugin source file, unload the plugin from the process and then delete the source file, possibly also delete any config files that came with the plugin, that could be an aditional option for force
deleting the plugin.
An example of the command could be
;plugin <remove|delete|r|d> <plugin-name> [--force]