4.7 KiB
Musik bot websocket protocol
General structure
Transmitted data is in json format The json format has the structure as following:
{
"type": <PacketType>,
"data": [
{
<key>: value
},
...
]
}
Example:
{
"type": "showMessage",
"data": [
{
"message": "A simple info modal",
"type": "info"
},
{
"message": "A simple error modal",
"type": "error"
}
]
}
TODO list
- Music bot queue
- Music bot ts3 access rights (allow other clients to use this music bot etc.)
Packet types
General types
Server showMessage:
This packet should show up a message modal.
- [~]
message:type: {info|error}
Server reqError:
The server sends this if you applay a invalid request
- [1]
message:requestId:
Server disconnect
I send this packet before i close the comunication
- [1]
message
Login packets
Client login
Try login
- [1]
usernamepasswordrequestId
Server notifylogin
- [1]
requestIdsucceeded: {0|1}uidown uid. only set if login failedmessageonly set if login failed
Client logout
- [1]
requestId
Server notifylogout
Could be send at any time (force logout)
- [1]
requestId(empty of not requested)succeeded: {0|1}
Server Management
Client serverlist
- [1]
requestId
Server notifyserverlist
Sends when requested or list updated (Lists online avariable server for the client view)
- [~]
- [1]
requestId(empty of not requested) nameuidserverIdstatus: {online|offline}clientOnlinemaxClients
- [1]
Server notifyserverupdate
Sends when a server changes display properties
- [1]
serverIdkey: {name|onlineClients|maxClients}value
Channel Management
Client channellist
Request a channel list
- [1]
requestIdserverId
Server notifychannellist
The channel response is ordered: This packet would also be send if the channel tree gets updated
root
- sub 1
- sub sub 1
- sub sub 2
- sub 2
root 2
...
- [~]
- [1]
requestId(empty of not requested) - [1]
serverId namechannelIdchannelParentchannelOrder
- [1]
Music bot management
Client musicbotlist
- [1]
requestIdserverId
Server notifymusikmusicbotlist
- [~]
- [1]
requestId(empty of not requested) - [1]
serverId idconnected: {1|0}namechannelIdownerUid(its your own if its matching with our own id)ownerCldbid
- [1]
Client musicbotcreate
- [1]
requestIdserverIdnamechannelId
Server notifymusikbotcreated
- [1]
requestId(empty of not requested)serverIdidconnected: {1|0}namechannelIdownerUid(its your own if its matching with our own id)ownerCldbid
Client musicbotdelete
- [1]
requestIdserverIdnamechannelId
Server notifymusikbotdelete
- [1]
requestId(empty of not requested)serverIdid
Client musicbotinfo
Request music bot info
- [1]
requestIdserverIdid
Server notifymusicbotinfo
- [1]
requestIdserverIdidnameconnectedphoeticNamechannelIdplayingplayingInfo: <string|Current playing title etc. May need to be inproved> Empty if noting selecteddescriptiontextCurrentSong
Client musicbotedit
- [1]
requestIdserverIdidkeyvalue
Server notifymusicbotedit
- [~]
- [1]
requestId(empty of not requested) - [1]
serverId idkey: {connected|name|channelId|description|playing|playingInfo}
- [1]
Client musicbotplay
- [1]
requestIdserverIdidtype: {yt|file}value
Server notifymusicbotplay
Send only as answer for musicbotplay
You would recive the play state update via notifymusicbotedit
- [1]
requestIdsucceeded
Client musicbotstop
- [1]
requestIdserverIdidpaused: {1|0}
Server notifymusicbotstop
Send only as answer for musicbotstop
You would recive the play state update via notifymusicbotedit
- [1]
requestIdsucceeded