The Splash server is a backend system responsible for handling various commands from clients, such as posting messages, authentication, retrieving posts, and account creation. This document provides comprehensive documentation for each supported command, including usage instructions, parameters, examples, and potential errors.
[!WARNING]
This server is still in development. Expect breaking changes, bugs, and lots of unstable stuff.
direct
The direct
command enables clients to perform direct actions such as posting messages, deleting posts, or editing posts.
type
: Specifies the type of action to perform (post
, delete
, or edit
).uid
: Unique identifier of the post to perform the action on.edit
: New content for the post if the action is editing.attachment
: Optional attachment file name for posting.To post a message:
{
"cmd": "direct",
"val": {
"cmd": "post",
"val": {
"type": "send",
"p": "Hello, world!",
"attachment": "image.png"
}
}
}
To delete a post:
{
"cmd": "direct",
"val": {
"cmd": "post",
"val": {
"type": "delete",
"uid": "123456789"
}
}
}
To edit a post:
{
"cmd": "direct",
"val": {
"cmd": "post",
"val": {
"type": "edit",
"uid": "123456789",
"edit": "Updated message"
}
}
}
auth
The auth
command is used to authenticate a user.
pswd
: The password associated with the user's account.{
"cmd": "auth",
"val": {
"pswd": "password123"
}
}
retrieve
The retrieve
command is used to retrieve posts.
type
: Specifies the type of retrieval (latest
currently supported).c
: Chat ID or identifier for the conversation.o
: Offset value for retrieving posts.{
"cmd": "retrieve",
"val": {
"type": "latest",
"c": "chat_id",
"o": 0
}
}
genaccount
The genaccount
command is used to generate a new user account.
pswd
: The password for the new account.{
"cmd": "genaccount",
"val": {
"pswd": "password123"
}
}
Connect to the Server:
Send Commands:
Handle Responses:
Error Handling: