plugin_reload
Reload plugins from disk so edits take effect without a server restart. Use it after editing main.js, running git pull in a plugin folder, or adding or removing plugin folders by hand.
Request
Section titled “Request”{ "cmd": "plugin_reload", "name": "hello"}| Field | Type | Required | Description |
|---|---|---|---|
name |
string | No | Plugin to reload. Leave it out to reload every plugin. |
Response
Section titled “Response”{ "cmd": "plugin_reload", "val": true}The reload is recorded in the audit log.
Reloading one plugin
Section titled “Reloading one plugin”- The server reads
plugin.jsonandmain.jsagain and checks them. If a check fails, you get the error and the previous version keeps running. - If it passes, the old version is unloaded and the new one loaded. Every authenticated connection receives
slash_removefor the old slash commands, thenslash_addfor the new ones. - If the manifest says
enabled: false, the plugin is unloaded and the response is stillval: true. - If the plugin’s folder or manifest is gone, the plugin is unloaded and you get
Plugin '<name>' is not installed.
Reloading all plugins
Section titled “Reloading all plugins”Every loaded plugin is unloaded, then every folder in the database directory’s plugins/ folder is loaded again. This picks up new and deleted folders. A plugin that fails to load is skipped and logged on the server; the response is still val: true.
Permissions
Section titled “Permissions”Requires manage_server. It is blocked while you are timed out.
Errors
Section titled “Errors”These apply only when name is set.
val |
When |
|---|---|
Invalid plugin name |
name has characters other than letters, digits, _, and -. |
Plugin '<name>' is not installed |
There is no readable plugin.json for that name. Any loaded copy was unloaded. |
Plugin '<name>' has no readable manifest |
plugin.json disappeared or became unreadable during the reload. |
| Manifest or source error | The files failed their checks. The messages are listed on plugin_install, plus Manifest name must match the plugin directory when plugin.json has a different name. |
| Validation message | name is blank or longer than 64 characters. |
