mirror of
https://github.com/amalthea-mc/spigot-tg-bridge.git
synced 2024-11-23 19:02:21 +00:00
chore: update readme
This commit is contained in:
parent
0cd9fbc56a
commit
24d8f9ff6f
54
README.md
54
README.md
@ -4,20 +4,45 @@
|
|||||||
|
|
||||||
## How to use:
|
## How to use:
|
||||||
|
|
||||||
1. Download .jar file from [releases page](https://github.com/kraftwerk28/spigot-tg-bridge/releases), and put it in `plugins/` directory on your server **OR** clone this repo and run `gradle shadowJar` inside repo's directory
|
1. Download .jar file from [releases page](https://github.com/kraftwerk28/spigot-tg-bridge/releases), and put it in `plugins/` directory on your server **OR** clone this repo and run `gradle shadowJar` inside repo's directory.
|
||||||
|
|
||||||
2. Choose one of below to configure plugin:
|
2. If you already have telegram bot, skip this step. Otherwise create it through [BotFather](https://t.me/BotFather). You'll go through step-by-step instructions, give a bot __username__ and most importanrly, obtain a bot __token__. Save this token.
|
||||||
1. Run Spigot server, plugin will log `"No config file found! Saving default one."`. After that, stop server and proceed to 3rd step.
|
|
||||||
|
|
||||||
**OR**
|
3. Next, we need to tell plugin about your new bot. You can either:
|
||||||
|
- Run Spigot server, plugin will log `"No config file found! Saving default one."`. After that, stop server and proceed to 3rd step.
|
||||||
|
- Copy [config.yml](https://raw.githubusercontent.com/kraftwerk28/spigot-tg-bridge/master/src/main/resources/config.yml) to `plugins/SpigotTGBridge/` in your server directory.
|
||||||
|
|
||||||
2. Copy [config.yml](https://raw.githubusercontent.com/kraftwerk28/spigot-tg-bridge/master/src/main/resources/config.yml) to `plugins/SpigotTGBridge/` in your server directory.
|
4. A `config.yml` is just a [valid YAML](https://en.wikipedia.org/wiki/YAML) file, alternative for JSON, but more human-readable.
|
||||||
|
Now, take bot's __username__ and __token__ which you got in 2'nd step and paste them into `config.yml`, so it looks like this:
|
||||||
|
```yaml
|
||||||
|
botToken: abcdefghijklmnopq123123123
|
||||||
|
botUsername: my_awesome_spigot_bot
|
||||||
|
# other configuration values...
|
||||||
|
```
|
||||||
|
|
||||||
3. Modify `plugins/SpigotTGBridge/config.yml` with text editor, where each field is described in table below.
|
5. Run spigot server.
|
||||||
|
|
||||||
4. Run server.
|
6. Add you bot to chats, where you plan to use it. In each of them, run `/chat_id` command. The bot should respond and give special value - __chat id__. Now, open `config.yml` and paste this ID under `chats` section, so it will look like this:
|
||||||
|
```yaml
|
||||||
|
botToken: abcdefghijklmnopq123123123
|
||||||
|
botUsername: my_awesome_spigot_bot
|
||||||
|
chats:
|
||||||
|
# Note about doubling minus sign. This is not a mistake, first one means list element, the second one - actual minus
|
||||||
|
- -123456789
|
||||||
|
- 987654321
|
||||||
|
# other chat id's...
|
||||||
|
```
|
||||||
|
|
||||||
|
7. You can extend `config.yml` with more tweaks, which are described in the table below, but it's not nesessary, plugin will use default values instead, if they're missing.
|
||||||
|
|
||||||
|
8. Re-run server or type `tgbridge_reload` into server's console.
|
||||||
|
|
||||||
|
|
||||||
|
P. S. You can always update plugin configuration without restarting the server. Just edit `config.yml` in the `plugins/` directory, save it, then type `tgbridge_reload` into server's console. Beware, that plugin reload takes some time (usually up to 30 secs), and I work on it right now.
|
||||||
|
|
||||||
|
|
||||||
|
## Plugin configuration:
|
||||||
|
|
||||||
#### config.yml:
|
|
||||||
| Field | Description | Type | Required | Default |
|
| Field | Description | Type | Required | Default |
|
||||||
|:-----:|:------------|:----:|:--------:|:-------:|
|
|:-----:|:------------|:----:|:--------:|:-------:|
|
||||||
| enable | If plugin should be enabled | `boolean` | :x: | `true` |
|
| enable | If plugin should be enabled | `boolean` | :x: | `true` |
|
||||||
@ -35,6 +60,7 @@
|
|||||||
| commands | Dictionary of command text used in Telegram bot | `Map<string, string>` | :x: | See default config |
|
| commands | Dictionary of command text used in Telegram bot | `Map<string, string>` | :x: | See default config |
|
||||||
| telegramMessageFormat | Format string for TGtoMC chat message | `string` | :x: | See default config |
|
| telegramMessageFormat | Format string for TGtoMC chat message | `string` | :x: | See default config |
|
||||||
|
|
||||||
|
|
||||||
## Telegram bot commands:
|
## Telegram bot commands:
|
||||||
|
|
||||||
Commands are customizeable through config, but there are default values for them as well
|
Commands are customizeable through config, but there are default values for them as well
|
||||||
@ -45,14 +71,16 @@ Commands are customizeable through config, but there are default values for them
|
|||||||
| `/time` | Get [time](https://minecraft.gamepedia.com/Day-night_cycle) on server |
|
| `/time` | Get [time](https://minecraft.gamepedia.com/Day-night_cycle) on server |
|
||||||
| `/chat_id` | Get current chat ID (in which command was run) for config.yml |
|
| `/chat_id` | Get current chat ID (in which command was run) for config.yml |
|
||||||
|
|
||||||
## Format string:
|
|
||||||
Must contain `%username%` and `%message` inside.
|
|
||||||
You can customize message color with it. See [message color codes](https://www.digminecraft.com/lists/color_list_pc.php).
|
|
||||||
|
|
||||||
P. S.: related to [this issue](https://github.com/kraftwerk28/spigot-tg-bridge/issues/6)
|
## Format string:
|
||||||
|
|
||||||
|
Must contain `%username%` and `%message` inside.
|
||||||
|
You can customize message color with it. See [message color codes](https://www.digminecraft.com/lists/color_list_pc.php) for more information.
|
||||||
|
This feature is related to [this issue](https://github.com/kraftwerk28/spigot-tg-bridge/issues/6)
|
||||||
|
|
||||||
|
|
||||||
## Plugin commands:
|
## Plugin commands:
|
||||||
|
|
||||||
| Command | Description |
|
| Command | Description |
|
||||||
|:-------:|:------------|
|
|:-------:|:------------|
|
||||||
| `/tgbridge_reload` | Reload plugin configuration w/o need to stop the server. Works only through server console |
|
| `tgbridge_reload` | Reload plugin configuration w/o need to stop the server. Works only through server console |
|
||||||
|
Loading…
Reference in New Issue
Block a user