diff options
author | Neel Kamath <neelkamath@pop-os.localdomain> | 2018-05-14 10:49:29 +0200 |
---|---|---|
committer | Neel Kamath <neelkamath@pop-os.localdomain> | 2018-05-14 10:49:29 +0200 |
commit | b42c93a7a712beea4fefca9785cf776e93c85e65 (patch) | |
tree | b3345aa0afac26b339c5b4068141634a8cc8c9d2 | |
parent | Prevent fucking shit up (diff) | |
download | hackchat-b42c93a7a712beea4fefca9785cf776e93c85e65.tar.gz hackchat-b42c93a7a712beea4fefca9785cf776e93c85e65.zip |
Add initial connection documentation
Diffstat (limited to '')
-rw-r--r-- | DOCUMENTATION.md | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/DOCUMENTATION.md b/DOCUMENTATION.md index 1b797f3..4fa9055 100644 --- a/DOCUMENTATION.md +++ b/DOCUMENTATION.md @@ -1,8 +1,17 @@ -You can programmatically access hack.chat using the following commands. +You can programmatically access hack.chat using the following commands via a websocket. To prevent getting disconnected, ping the server every 50 seconds. A list of wrappers written for accessing hack.chat can be found [here](https://github.com/hack-chat/3rd-party-software-list#libraries). -hack.chat has three permission levels. When you access a command, hack.chat automatically knows your permission level from your trip code. The lowest permission level is `core`. `mod` is above `core`, so it can access `core` commands in addition to `mod` commands. `admin` is similarly above `mod`. +The commands are to be sent through a websocket to the URL `wss://hack.chat/chat-ws` (everything sent and received are `string`s). If you are sending messages locally or to another domain, replace 'hack.chat' with the respective domain. If you're running your own instance of hack.chat, you can retain backwards-compatibility in order to ensure that software created for the main server will work on yours too. + +All commands sent must be JSON objects with the command specified in the `"cmd"` key. For example: +```json +{ + "cmd": "join", + "channel": "programming", + "nick": "johndoe#fag" +} +``` -The commands are to be sent through a websocket to the URL wss://hack.chat/chat-ws (everything sent and received are `string`s). If you are sending messages locally or to another domain, replace 'hack.chat' with that domain. If you're running your own instance of hack.chat, you can retain backwards-compatibility in order to ensure that software created for the main server will work on yours too. +hack.chat has three permission levels. When you access a command, hack.chat automatically knows your permission level from your trip code. The lowest permission level is `core`. `mod` is above `core`, so it can access `core` commands in addition to `mod` commands. `admin` is similarly above `mod`. # `core` |