PlaguBotBotTemplate/README.md

31 lines
2.4 KiB
Markdown
Raw Normal View History

2020-11-12 07:28:59 +00:00
# PlaguBot Bot Template
1. Update your dependencies in [`gradle/libs.versions.toml`](https://github.com/InsanusMokrassar/PlaguBotBotTemplate/blob/master/gradle/libs.versions.toml), and don't forget to mention them in `depdendencies { ... }` block of [`build.gradle`](https://github.com/InsanusMokrassar/PlaguBotBotTemplate/blob/master/build.gradle#L24-L27) if you add new ones. Usually in gradle projects/readmes developers define names of
2020-11-12 07:28:59 +00:00
their dependencies
2. Edit [config](config.json). The main points
([full list of parameters with explanation](https://github.com/InsanusMokrassar/PlaguBot/blob/master/template.config.json)):
2020-11-12 08:08:56 +00:00
* Change [database](https://github.com/InsanusMokrassar/PlaguBotBotTemplate/blob/master/config.json#L2-L4) section
2021-02-16 19:23:51 +00:00
* Change [bot token](https://github.com/InsanusMokrassar/PlaguBotBotTemplate/blob/master/config.json#L5)
2020-11-12 08:08:56 +00:00
* Change [list of plugins](https://github.com/InsanusMokrassar/PlaguBotBotTemplate/blob/master/config.json#L6-L11):
2020-11-12 07:28:59 +00:00
* Field `type` - it is name of the plugin provided by developer/dependency
* Other fields are parameters of plugin and must be provided directly
2020-11-12 08:08:56 +00:00
* Example is available in the [example section](https://github.com/InsanusMokrassar/PlaguBotBotTemplate/blob/master/config.json#L6-L11): here `Hello` is name of plugin and
2020-11-12 07:28:59 +00:00
`parameter` is its configuration parameter
2021-02-17 08:57:18 +00:00
* Change [params](https://github.com/InsanusMokrassar/PlaguBotBotTemplate/blob/master/config.json#L12-L17):
* Any key here will be available in plugins as name of param
* Any value must contains:
* `type` to detect which one object to instantiate
* Other type parameters
* You may look into example related to database in
[config](https://github.com/InsanusMokrassar/PlaguBotBotTemplate/blob/master/config.json#13): `defaultDatabase`
is easily available in plugins as `params.database` extension
2020-11-12 07:28:59 +00:00
## How to launch
There are two main ways to launch it:
* Run `./gradlew build && ./gradlew run --args="PATH_TO_YOUR_CONFIG"` with replacing of `PATH_TO_YOUR_CONFIG`
* Run `./gradlew build` and get [zip of bot](build/distributions/bot.zip) and unarchive it somewhere you need. In this
archive there is an executable files `bot.bat` (for windows) and `bot` (for linux) by the path inside of archive
`/bot/bin`. After unarchiving you can just launch executable file with one argument: path to the config