Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions doc/specs/examples/bot-getOnlineBots.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"id": "halcyonbot",
"username": "halcyonbot",
"perfs": {
"bullet": {
"games": 24255,
"rating": 2313,
"rd": 45,
"prog": 10
},
"blitz": {
"games": 33330,
"rating": 2227,
"rd": 45,
"prog": -5
},
"rapid": {
"games": 21219,
"rating": 2310,
"rd": 45,
"prog": -3
},
"classical": {
"games": 0,
"rating": 2000,
"rd": 500,
"prog": 0,
"prov": true
},
"correspondence": {
"games": 0,
"rating": 2000,
"rd": 500,
"prog": 0,
"prov": true
}
},
"title": "BOT",
"patron": true,
"createdAt": 1674374156963,
"profile": {
"bio": "I'm a chess engine written from scratch. Challenge me to a rated or casual game of bullet, blitz, or rapid! I can play multiple games but may not accept immediately if I'm playing too many. Created by @thinic.",
"realName": "Halcyon 1",
"links": "https://lishogi.org/@/kawasemi\r\nhttps://github.com/nhamil/halcyon"
},
"seenAt": 1747683622797,
"playTime": {
"total": 57161455,
"tv": 772338
}
}
2 changes: 1 addition & 1 deletion doc/specs/tags/bot/api-bot-online.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ get:
schema:
$ref: "../../schemas/User.yaml"
example:
$ref: "../../examples/user-georges-bot.json"
$ref: "../../examples/bot-getOnlineBots.json"
19 changes: 19 additions & 0 deletions scripts/update-examples/bot.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { example, prodClient, readNdJson } from "./config";

const abortController = new AbortController();
const signal = abortController.signal;

await prodClient()
.GET("/api/bot/online", {
headers: {
Accept: "application/x-ndjson",
},
signal,
parseAs: "stream",
})
.then((response) =>
readNdJson(response.response, (line: any) => {
example("bot", "getOnlineBots", line);
abortController.abort();
}),
);