Update README/CHANGELOG for 2.25.0
parent
eac3e9e0a8
commit
9019063fa7
|
@ -1,5 +1,11 @@
|
||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## v2.25.0
|
||||||
|
* Fix regression introduced in v2.24.0 where line breaks would get turned to spaces in replies and snippets ([https://github.com/Dragory/modmailbot/issues/304](#304))
|
||||||
|
* Replace the internal command handler with a new one. This should be fairly thoroughly tested, but please report any issues you encounter!
|
||||||
|
* Plugins are now called with a fourth parameter that allows you to easily add specific types of commands
|
||||||
|
* Due to the command handler change, any calls to `bot.registerCommand` should be replaced with the new system
|
||||||
|
|
||||||
## v2.24.0
|
## v2.24.0
|
||||||
* Switch to the new stable version of Eris (0.10.0) instead of the dev version
|
* Switch to the new stable version of Eris (0.10.0) instead of the dev version
|
||||||
|
|
||||||
|
|
13
README.md
13
README.md
|
@ -126,18 +126,23 @@ The path is relative to the bot's folder.
|
||||||
|
|
||||||
### Creating a plugin
|
### Creating a plugin
|
||||||
Create a `.js` file that exports a function.
|
Create a `.js` file that exports a function.
|
||||||
This function will be called when the plugin is loaded with the following arguments: `(bot, knex, config)`
|
This function will be called when the plugin is loaded with the following arguments: `(bot, knex, config, commands)`
|
||||||
where `bot` is the [Eris Client object](https://abal.moe/Eris/docs/Client),
|
where `bot` is the [Eris Client object](https://abal.moe/Eris/docs/Client),
|
||||||
`knex` is the [Knex database object](https://knexjs.org/#Builder),
|
`knex` is the [Knex database object](https://knexjs.org/#Builder),
|
||||||
and `config` is the loaded config object.
|
`config` is the loaded config object,
|
||||||
|
and `commands` is an object with functions to add and manage commands (see bottom of [src/commands.js](src/commands.js))
|
||||||
|
|
||||||
#### Example plugin file
|
#### Example plugin file
|
||||||
```js
|
```js
|
||||||
module.exports = function(bot, knex, config) {
|
module.exports = function(bot, knex, config, commands) {
|
||||||
console.log('Plugin loaded!');
|
commands.addInboxThreadCommand('mycommand', [], (msg, args, thread) => {
|
||||||
|
thread.replyToUser(msg.author, 'Reply from my custom plugin!');
|
||||||
|
});
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Work in progress
|
### Work in progress
|
||||||
The current plugin API is fairly rudimentary and will be expanded in the future.
|
The current plugin API is fairly rudimentary and will be expanded in the future.
|
||||||
|
The API can change in non-major releases during this early stage. Keep an eye on [CHANGELOG.md](CHANGELOG.md) for any changes.
|
||||||
|
|
||||||
Please send any feature suggestions to the [issue tracker](https://github.com/Dragory/modmailbot/issues)!
|
Please send any feature suggestions to the [issue tracker](https://github.com/Dragory/modmailbot/issues)!
|
||||||
|
|
Loading…
Reference in New Issue