From a0be7cb059327b7f90aed4516ae5e8b701fde241 Mon Sep 17 00:00:00 2001 From: cbax Date: Tue, 24 Sep 2024 15:40:13 +0000 Subject: [PATCH] Update README.md --- README.md | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 81c8b0f..edab6f5 100644 --- a/README.md +++ b/README.md @@ -11,4 +11,37 @@ A small chat box API for use on public websites. - Message sanitization - Keyword filtering - Responsive web UI -- Embed/iframe-able \ No newline at end of file +- Embed/iframe-able + +## API + +- init: takes a username returns `init_scrollback` previous messages, a sync rate, and a client identifier, or an error if username exists/is not allowed +- sync: takes a client identifier and returns all unseen messages +- send: sends a message, returns a status +- login: accepts password, gives client admin perms if password is correct +- delete: takes an admin client identifier and a message id +- ban: bans a client + +## Structs + +- config + - admin_password + - ratelimit (req/min) + - \[banned_words\] + - \[banned_usernames\] + - \[banned_ips\] + - init_scrollback + - sync_rate + +- message + - client_id + - timestamp + - body + +- client + - client_id + - username + - ip_address + - admin_perms + - banned + - ratelimit \ No newline at end of file