Update CHANGELOG and documentation on plugin loading

cshd
Dragory 2020-10-04 17:19:49 +03:00
parent d8c531cb4d
commit c58ebf5698
No known key found for this signature in database
GPG Key ID: 5F387BA66DF8AAC1
2 changed files with 11 additions and 3 deletions

View File

@ -6,6 +6,8 @@ Please report any bugs you encounter by [creating a GitHub issue](https://github
**General changes:** **General changes:**
* Fix occasional bug with expiring blocks where the bot would send the expiry message multiple times * Fix occasional bug with expiring blocks where the bot would send the expiry message multiple times
* Plugins can now also be installed from NPM modules
* Example: `plugins[] = npm:some-plugin-package`
**Plugins:** **Plugins:**
* Log storage functions `getLogUrl()`, `getLogFile()`, `getLogCustomResponse()` now take the entire thread object as an argument rather than the thread ID * Log storage functions `getLogUrl()`, `getLogFile()`, `getLogCustomResponse()` now take the entire thread object as an argument rather than the thread ID

View File

@ -2,9 +2,15 @@
The bot supports loading external plugins. The bot supports loading external plugins.
## Specifying plugins to load ## Specifying plugins to load
For each plugin file you'd like to load, add the file path to the [`plugins` option](configuration.md#plugins). Plugins can be loaded either from local files or NPM. Examples:
The path is relative to the bot's folder. ```ini
Plugins are automatically loaded on bot startup. # Local file
plugins[] = ./path/to/plugin.js
# NPM package
plugins[] = npm:some-plugin-package
```
Paths to local files are always relative to the bot's folder.
NPM plugins are automatically installed on bot start-up.
## Creating a plugin ## Creating a plugin
Plugins are simply `.js` files that export a function that gets called when the plugin is loaded. Plugins are simply `.js` files that export a function that gets called when the plugin is loaded.