Broadcast chat between Minecraft servers or even discord server
[WARNING] ChatBridge is mainly for TIS's custom use so expect messy code structures and hardcoded constants
ChatBridge_lib.py and ChatBridge_utils.py are the library of ChatBridge
ChatBridge_server.py is the server
ChatBridge_client.py is the client. it can also be a mcd plugin
ChatBridge_discord.py will be a type of client that can control a discord bot
pip install pycrypto for python 2
pip install pycryptodome for python 3
- Grab
ChatBridgeLibrary/ChatBridge_lib.pyandChatBridgeLibrary/ChatBridge_utils.pywith their folder andChatBridge_server.pyin a folder - Create
ChatBridge_server.jsonas the config file - Run
python ChatBridge_server.py
MyFolder
├─ ChatBridgeLibrary
│ ├─ ChatBridge_lib.py
│ └─ ChatBridge_utils.py
├─ ChatBridge_server.py
└─ ChatBridge_server.json
ChatBridge_server.json format
{
"aes_key": "theAESkey",
"hostname": "0.0.0.0",
"port": 23333,
"clients":
[
{
"name": "testClient",
"password": "testPassword"
},
{
"name": "SurvivalServer",
"password": "_OwO_"
},
{
"name": "DiscordBot",
"password": "notvanilla"
}
]
}
- Grab
ChatBridgeLibrary/ChatBridge_lib.pyandChatBridgeLibrary/ChatBridge_utils.pywith their folder andChatBridge_client.pyin a folder - Create
ChatBridge_client.jsonas the config file - Run
python ChatBridge_client.py
MyFolder
├─ ChatBridgeLibrary
│ ├─ ChatBridge_lib.py
│ └─ ChatBridge_utils.py
├─ ChatBridge_client.py
└─ ChatBridge_client.json
ChatBridge_client.json format
{
"name": "testClient",
"password": "testPassword",
"server_hostname": "server.ChatBridge.orz",
"server_port": 23333,
"aes_key": "theAESkey"
}
The client will automatically start when the program starts
Type start to start the client and type stop to stop the client
Client (as a MCD plugin)
Compatible with MCDaemon and MCDReforged
- Grab
ChatBridgeLibrary/ChatBridge_lib.pyandChatBridgeLibrary/ChatBridge_utils.pywith their folder andChatBridge_client.pyintopluginsfolder - Create
config/ChatBridge_client.jsonas the config file - Create
log/folder if it doesn't exist - Run MCD
ChatBridge_client.json is exactly the same as above, but u can custom the displayed text color in it
MCDaemon
├─ plugins
│ ├─ ChatBridgeLibrary
│ │ ├─ ChatBridge_lib.py
│ │ └─ ChatBridge_utils.py
│ └─ ChatBridge_client.py
│─ config
| └─ ChatBridge_client.json
└─ ...
python3 only
pip install discord.py first
- Grab
ChatBridgeLibrary/ChatBridge_lib.pywith its folder,ChatBridge_client.pyandChatBridge_discord.pyinplugins/folder - Create
ChatBridge_client.jsonandChatBridge_discord.jsonas the config file - Run
python ChatBridge_discord.py
ChatBridge_client.json is exactly the same as above, but u can custom the displayed text color in it
MyFolder
├─ ChatBridgeLibrary
│ ├─ ChatBridge_lib.py
│ └─ ChatBridge_utils.py
├─ ChatBridge_discord.py
├─ ChatBridge_discord.json
└─ ChatBridge_client.json
ChatBridge_discord.json format
{
"bot_token": "your.bot.token.here",
"channel_id": 645424523965046400,
"command_prefix": "!!",
"client_to_query_stats": "MyClient1",
"client_to_query_online": "MyClient2"
}
!!stats will send command to MyClient1 to query the StatsHelper plugin in the specific client for data
!!online will send command to MyClient2 to use rcon to get glist command reply in bungeecord server
python3 only
Needs coolq-http-api server running (:ghost: it's down)
Needs any CoolQ Http protocol provider to work. e.g. go-cqhttp
pip install websocket websocket-client first
- Grab
ChatBridgeLibrary/ChatBridge_lib.pywith its folder,ChatBridge_client.pyandChatBridge_discord.pyinplugins/folder - Create
ChatBridge_client.jsonandChatBridge_CQHttp.jsonas the config file - Open CoolQ with coolq-http-api enabled, then close it
- Open
CoolQ/data/app/io.github.richardchien.coolqhttpapi/config/<your_qq_id>.json, setuse_wstotrueand set youraccess_token. You can also setuse_httptofalsesince it's not necessary - Run
python ChatBridge_cqhttp.py
ChatBridge_client.json is exactly the same as above, but u can custom the displayed text color in it
MyFolder
├─ ChatBridgeLibrary
│ ├─ ChatBridge_lib.py
│ └─ ChatBridge_utils.py
├─ ChatBridge_CQHttp.py
├─ ChatBridge_CQHttp.json
└─ ChatBridge_client.json
ChatBridge_CQHttp.json format
{
"ws_address": "127.0.0.1",
"ws_port": 6700,
"access_token": "my_access_token",
"react_group_id": 138150445
}
ws_address, ws_port and access_token are the same as the value in the config file of coolq-http-api
In MC use !!qq <message> to send message
In QQ use !!mc <message> to send message
Type !!help in QQ for more help
