From 04ca53dc7953a7f69d212e34bfff47c3a5f33413 Mon Sep 17 00:00:00 2001 From: shockrah Date: Tue, 5 May 2020 21:56:39 -0700 Subject: [PATCH] new docs for the updated api requirements --- docs/api.md | 57 ++++++++++++++++++++++++++++++++--------------------- 1 file changed, 34 insertions(+), 23 deletions(-) diff --git a/docs/api.md b/docs/api.md index daffc9e..54cf416 100644 --- a/docs/api.md +++ b/docs/api.md @@ -18,33 +18,42 @@ Parameters: Return: Session key +# Channels + ``` -/channels/list/voice -/channels/list/text +/channels/list/ +/channels/list/ ``` Return: - List of channels owned by the server + List of struct::Channels owned by the server voice/text + +/channels/voice/ + +Return: + List of struct::Members in that given channel + +# Messaging ``` -for channel in text_channels - GET /channnels/history/{channel} +/message/recent/ ``` +Parameters: + opt::limit + Request the last hours of messages. + By default the last 24 hours of messages is given unless otherwise specified + Behavior: - By default the client requests the most recent 100 messages - But it shows the most recently cached messages from the last session + Should really only be necessary to update channel members periodically when the client is opened up to that server exactly. -``` -for channel in voice_channels - GET /channels/vc_members/{channel} -``` +# Structures -Behavior: - By default we request the people in the voce chat on login but only - cache updates during sessions, not between sessions - -# Response Objects +Member { + name: string + id: u64 + permissions: u64 +} Channel { name: string @@ -52,13 +61,15 @@ Channel { type: integer [1=Voice Channel, 2=Text Channel] } -User { - userid: u64 - username: string -} - Message { content: string - author: User - date: Unix timestamp(u64) + author: Member + date: Unix Timestamp } + +Badge { + name: string + permissions: u64 + color: u32 +} +