From nothing to a working hack.chat bot backed by a HiveMind hub.
The bridge is a HiveMind satellite with two connections:
- To hack.chat. It opens a websocket to
wss://hack.chat/chat-wsand joins a channel with a nickname. hack.chat is anonymous, so no credentials are needed. - To the HiveMind hub. It connects with a
HiveMessageBusClient, using an access key and a password.
Each channel message, other than the bot's own, becomes a recognizer_loop:utterance sent to the hub. The sender's nickname travels in the message context, so the hub's speak reply is posted back to the channel, addressed to that user.
hack.chat channel ⇄ bridge ⇄ HiveMind hub ⇄ OVOS pipeline / skills
Install and run hivemind-core:
pip install hivemind-core
hivemind-core listenThe hub listens on port 5678 by default.
On the hub machine, run:
hivemind-core add-client --name hackchat-bridge \
--access-key "your-access-key" --password "your-password"Keep the access key. List clients with hivemind-core list-clients.
A freshly registered client can connect, but the hub denies every message type until you whitelist it. Skipping this is the most common reason a bridge connects but never replies:
hivemind-core allow-msg recognizer_loop:utterance hackchat-bridge
hivemind-core allow-msg speak hackchat-bridgehack.chat channels are created on the fly. Just choose a name. Anyone who opens https://hack.chat/?<channel> is in that channel. Pick a nickname for the bot.
pip install HiveMind-HackChatBridgePass your channel, bot username, and HiveMind host/port/access-key/password on the command line:
hivemind-hackchat-bridge \
--channel your_channel \
--username Jarbas_BOT \
--access-key "your-access-key" \
--password "your-password" \
--host ws://127.0.0.1 \
--port 5678Open https://hack.chat/?<channel> in a browser, join with any nickname, and type a message. The bridge forwards it to the hub and posts the spoken answer back as @user , <answer>.