Skip to content

Commit

Permalink
doc
Browse files Browse the repository at this point in the history
  • Loading branch information
Fallen-Breath committed Oct 2, 2021
1 parent 1794c55 commit e3f8d74
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 11 deletions.
65 changes: 55 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,29 @@
See [here](https://github.com/TISUnion/ChatBridge/tree/v1) for chatbridge v1. **NOT compatible with Chatbridge v1**

**[WARNING]** ChatBridge is mainly for TIS's custom use so expect hardcoded constants

![topomap](https://raw.githubusercontent.com/TISUnion/ChatBridge/master/topomap.png)

## Disclaimer

ChatBridge is mainly for custom use of TIS server, especially the bot/command components:

- CQHttp client
- Discord client
- Kaiheila client
- Online command client

Therefore for these **bot and related clients**:

- Expect hardcoded constants in codes and lack of document/usage/support
- PRs for features will not be accepted, related issues will probably be ignored
- If you want more features, fork this repository and implement them yourself

But the basic chatbridge components are within the support range, including:

- CLI client
- CLI server
- MCDR plugin

## Usage

Enter `python -m ChatBridge.pyz` in command line to see possible helps
Expand Down Expand Up @@ -137,6 +156,32 @@ Extra configure fields (compared to CLI client)
"client_to_query_online": "MyClient2" // a client described in the following section "Client to respond online command"
```

## Kaiheila bot client

`python -m ChatBridge.pyz kaiheila_bot`

Extra requirements (also listed in `/chatbridge/impl/kaiheila/requirements.txt`):

```
khl.py==0.0.10
```

Extra configure fields (compared to CLI client)

```json5
"client_id": "", // kaiheila client id
"client_secret": "", // kaiheila client secret
"token": "", // kaiheila token
"channels_for_command": [ // a list of channels, public commands can be used here. use string
"123400000000000000",
"123450000000000000"
],
"channel_for_chat": "123400000000000000", // the channel for chatting and private commands. use string
"command_prefix": "!!",
"client_to_query_stats": "MyClient1", // it should be a client as an MCDR plugin, with stats_helper plugin installed in the MCDR
"client_to_query_online": "MyClient2" // a client described in the following section "Client to respond online command"
```

## Client to respond online command

```
Expand All @@ -146,12 +191,12 @@ python -m ChatBridge.pyz cqhttp_bot
Extra configure fields (compared to CLI client)

```json5
"bungeecord_list": [
{
"name": "BungeecordA", // the name of the bungeecord server (unused value)
"address": "127.0.0.1", // the address of the bungeecord rcon
"port": "3999", // the port of the bungeecord rcon
"password": "Bungee Rcon Password" // the password of the bungeecord rcon
}
]
"bungeecord_list": [
{
"name": "BungeecordA", // the name of the bungeecord server (unused value)
"address": "127.0.0.1", // the address of the bungeecord rcon
"port": "3999", // the port of the bungeecord rcon
"password": "Bungee Rcon Password" // the password of the bungeecord rcon
}
]
```
3 changes: 2 additions & 1 deletion chatbridge/cli_entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def online_command():
entry.main()


def kaiheila():
def kaiheila_bot():
from chatbridge.impl.kaiheila import entry
entry.main()

Expand All @@ -49,5 +49,6 @@ def main():
print('{} server: Start the ChatBridge server'.format(prefix))
print('{} discord_bot: Start a Discord bot as client'.format(prefix))
print('{} cqhttp_bot: Start a CQ-Http bot as client'.format(prefix))
print('{} kaiheila_bot: Start a Kaiheila bot as client'.format(prefix))
print('{} online_command: Start a CQ-Http bot as client'.format(prefix))

0 comments on commit e3f8d74

Please sign in to comment.