mirror of
https://github.com/ReVanced/revanced-bots.git
synced 2026-01-21 02:03:57 +00:00
feat: refactor and new features (#7)
* feat: refactor and new features + Refactored the codebase + OCR support in bots + Server sends training data every minute + Not using collectors for Discord feedback buttons anymore + Fixed grammar mistakes + Configs are now seperated + Tokens are no longer in configs - Like feedback doesn't work for Discord yet * feat: remove feedback button once voted * feat: role blacklist * feat: thread name check * feat: error handler for training * fix: bot crashing when a webhook msg is sent * refactor: remove debugging lines * feat: allow fixing mistake at votes in discord bot
This commit is contained in:
64
apps/server/src/PROTOCOL.md
Normal file
64
apps/server/src/PROTOCOL.md
Normal file
@@ -0,0 +1,64 @@
|
||||
# Server Protocol
|
||||
|
||||
The server uses TCP for connection and BSON for messages, so you need to serialize and deserialize the messages.
|
||||
|
||||
## AI
|
||||
|
||||
Sending the server this JSON (BSON) will send you back the AI predictions.
|
||||
|
||||
```json
|
||||
{
|
||||
"op": 1,
|
||||
"id": "String",
|
||||
"text": "How do i download ReVanced?"
|
||||
}
|
||||
```
|
||||
|
||||
And the server would return something like this:
|
||||
|
||||
```json
|
||||
{
|
||||
"op": 2,
|
||||
"id": "String",
|
||||
"response": [
|
||||
{
|
||||
"confidence": 0.99,
|
||||
"id": "String",
|
||||
"name": "revanced_download"
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
### Training the AI
|
||||
|
||||
To train the AI, send the server a JSON (BSON) like this:
|
||||
|
||||
```json
|
||||
{
|
||||
"op": 3,
|
||||
"label": "revanced_download",
|
||||
"text": "how to download revanced"
|
||||
}
|
||||
```
|
||||
|
||||
## OCR
|
||||
|
||||
Sending the server this JSON (BSON) will send you back the read text.
|
||||
|
||||
```json
|
||||
{
|
||||
"op": 5,
|
||||
"id": "String",
|
||||
"url": "https://cdn.discordapp.com/attachments/1033338556493606963/1033338557231796224/Screenshot_20221022-121318.jpg"
|
||||
}
|
||||
```
|
||||
|
||||
And the server would return something like this:
|
||||
|
||||
```json
|
||||
{
|
||||
"op": 6,
|
||||
"id": "String",
|
||||
"ocrText": "..."
|
||||
}
|
||||
```
|
||||
Reference in New Issue
Block a user