Update README.md

This commit is contained in:
cbax 2024-09-24 19:47:36 +00:00
parent d36a2582df
commit 7d16bc450d

View file

@ -13,12 +13,20 @@ A small chat box API for use on public websites.
- Responsive web UI - Responsive web UI
- Embed/iframe-able - Embed/iframe-able
## Deps
- rocket
- sled
- snowflake id
## API ## API
- init: takes a cookie, returns a session if exits, else requests new session. - init: takes a cookie, returns a session (previous username, current channel, etc) if exits, else require login
- channels: returns a list of channels and a preview message for each - login: takes a username and IP, returns a session cookie
- join: takes a username and channel, returns `init_scrollback` previous messages, a sync rate, and a client identifier, or an error if username exists/is not allowed, or channel does not exist - create_channel: takes a cookie, channel name, and motd, returns a channel id
- sync: takes a client identifier and returns all unseen messages - channels: takes a cookie returns a list of channels and a preview message for each
- join: takes a cookie and channel id, returns `init_scrollback` previous messages, a sync rate, and a client identifier, or an error if username exists/is not allowed, or channel does not exist
- sync: takes a cookie and a last message id and returns all unseen messages.
- send: sends a message, returns a status - send: sends a message, returns a status
- login: accepts password, gives client admin perms if password is correct - login: accepts password, gives client admin perms if password is correct
- delete: takes an admin client identifier and a message id - delete: takes an admin client identifier and a message id
@ -29,13 +37,21 @@ A small chat box API for use on public websites.
- config - config
- admin_password - admin_password
- ratelimit (req/min) - ratelimit (req/min)
- `[reserved_username:ip_address]`
- `[banned_words]` - `[banned_words]`
- `[banned_usernames]` - `[banned_usernames]`
- `[banned_ips]` - `[banned_ips]`
- init_scrollback - init_scrollback
- sync_rate - sync_rate
- channel
- id
- name
- motd
- message - message
- id
- channel_id
- client_id - client_id
- timestamp - timestamp
- body - body
@ -47,3 +63,4 @@ A small chat box API for use on public websites.
- admin_perms - admin_perms
- banned - banned
- ratelimit - ratelimit
- last_channel_id