From 6fddc62eb64112bedec265fe0401bca6b635807c Mon Sep 17 00:00:00 2001 From: Jacob Schlecht Date: Tue, 25 Aug 2026 21:49:19 -0600 Subject: [PATCH 1/3] chore: Update stoat-api to 0.15.2 Signed-off-by: Jacob Schlecht --- package.json | 2 +- pnpm-lock.yaml | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index a42bc753..328a2bd4 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "@vladfrangu/async_event_emitter": "^2.4.7", "json-with-bigint": "^3.4.4", "solid-js": "^1.9.14", - "stoat-api": "0.14.3", + "stoat-api": "0.15.2", "ulid": "^3.0.2" }, "devDependencies": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7f8cecc2..b73c9be2 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -24,8 +24,8 @@ importers: specifier: ^1.9.14 version: 1.9.14 stoat-api: - specifier: 0.14.3 - version: 0.14.3 + specifier: 0.15.2 + version: 0.15.2 ulid: specifier: ^3.0.2 version: 3.0.2 @@ -832,8 +832,8 @@ packages: solid-js@1.9.14: resolution: {integrity: sha512-sAEXC0Kk0S1EDg+8ysEWJDbYhA3RRoEjwuySUGlKIemeo0I5YZfOyumNjNs9Sv3y2nmhD+0rW66ag2HsMuQiGQ==} - stoat-api@0.14.3: - resolution: {integrity: sha512-OCsHP8jPFp2pwwIxiSnLhgfI+bNJJ4kkUBOAOIGQedLR6iRYoJojxSB+uk/TJNinnc1ADGM+QZb8Q115p6+POA==} + stoat-api@0.15.2: + resolution: {integrity: sha512-88FKMiKs3aiYN8p1MWCu1YIeGqA1zrY2ALQjvsJh+wVRzOrt0Srv5cBex64sSkERj/wuJMPR46+mAFr4bGrv+g==} strip-json-comments@3.1.1: resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} @@ -1685,7 +1685,7 @@ snapshots: seroval: 1.5.6 seroval-plugins: 1.5.6(seroval@1.5.6) - stoat-api@0.14.3: + stoat-api@0.15.2: dependencies: json-with-bigint: 3.4.4 From 28c296e8ea3c32adfb2479e9755fe988bb73de94 Mon Sep 17 00:00:00 2001 From: Jacob Schlecht Date: Tue, 25 Aug 2026 22:09:18 -0600 Subject: [PATCH 2/3] feat: Add discovery endpoints for bots and servers Signed-off-by: Jacob Schlecht --- src/classes/Bot.ts | 29 ++++++++++++++++++++++++++++- src/classes/Server.ts | 30 ++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+), 1 deletion(-) diff --git a/src/classes/Bot.ts b/src/classes/Bot.ts index f68a0a70..7256b8a1 100644 --- a/src/classes/Bot.ts +++ b/src/classes/Bot.ts @@ -1,4 +1,4 @@ -import type { DataEditBot } from "stoat-api"; +import type { DataEditBot, DiscoverRequest } from "stoat-api"; import { decodeTime } from "ulid"; import type { BotCollection } from "../collections/BotCollection.js"; @@ -158,4 +158,31 @@ export class Bot { await this.#collection.client.api.delete(`/bots/${this.id as ""}`); this.#collection.delete(this.id); } + + /** + * Add bot to the discover request queue + */ + async requestDiscover(): Promise { + await this.#collection.client.api.put(`/bots/${this.id as ""}/discover`); + } + + /** + * Get the status of the discover request for this bot + * @returns The discovery request for this bot if one exists + */ + async discoverRequestStatus(): Promise { + return await this.#collection.client.api.get( + `/bots/${this.id as ""}/discover`, + ); + } + + /** + * Cancel the discover request for this bot + * + * This cannot be used to remove bots from discover that have already been accepted + * and should only be called on bots that have an outstanding discover request. + */ + async cancelDiscoverRequest() { + await this.#collection.client.api.delete(`/bots/${this.id as ""}/discover`); + } } diff --git a/src/classes/Server.ts b/src/classes/Server.ts index 4ff841ca..f732291a 100644 --- a/src/classes/Server.ts +++ b/src/classes/Server.ts @@ -14,6 +14,7 @@ import type { DataCreateServerChannel, DataEditRole, DataEditServer, + DiscoverRequest, Override, Role, } from "stoat-api"; @@ -852,4 +853,33 @@ export class Server { return highest; } + + /** + * Add server to the discover request queue + */ + async requestDiscover(): Promise { + await this.#collection.client.api.put(`/servers/${this.id as ""}/discover`); + } + + /** + * Get the status of the discover request for this server + * @returns The discovery request for this server if one exists + */ + async discoverRequestStatus(): Promise { + return await this.#collection.client.api.get( + `/servers/${this.id as ""}/discover`, + ); + } + + /** + * Cancel the discover request for this server + * + * This cannot be used to remove servers from discover that have already been accepted + * and should only be called on servers that have an outstanding discover request. + */ + async cancelDiscoverRequest() { + await this.#collection.client.api.delete( + `/servers/${this.id as ""}/discover`, + ); + } } From 56604fc050cf8419f4b9ed6cf3a6267a3628926b Mon Sep 17 00:00:00 2001 From: Jacob Schlecht Date: Wed, 26 Aug 2026 21:21:47 -0600 Subject: [PATCH 3/3] chore: Update stoat-api Signed-off-by: Jacob Schlecht --- package.json | 2 +- pnpm-lock.yaml | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 328a2bd4..b34f2cc9 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "@vladfrangu/async_event_emitter": "^2.4.7", "json-with-bigint": "^3.4.4", "solid-js": "^1.9.14", - "stoat-api": "0.15.2", + "stoat-api": "0.15.3", "ulid": "^3.0.2" }, "devDependencies": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b73c9be2..8f9b0197 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -24,8 +24,8 @@ importers: specifier: ^1.9.14 version: 1.9.14 stoat-api: - specifier: 0.15.2 - version: 0.15.2 + specifier: 0.15.3 + version: 0.15.3 ulid: specifier: ^3.0.2 version: 3.0.2 @@ -832,8 +832,8 @@ packages: solid-js@1.9.14: resolution: {integrity: sha512-sAEXC0Kk0S1EDg+8ysEWJDbYhA3RRoEjwuySUGlKIemeo0I5YZfOyumNjNs9Sv3y2nmhD+0rW66ag2HsMuQiGQ==} - stoat-api@0.15.2: - resolution: {integrity: sha512-88FKMiKs3aiYN8p1MWCu1YIeGqA1zrY2ALQjvsJh+wVRzOrt0Srv5cBex64sSkERj/wuJMPR46+mAFr4bGrv+g==} + stoat-api@0.15.3: + resolution: {integrity: sha512-r08FplgeZWft4Hd2CK1tZ7EEzhocUyy/aeeOGBrKC6vy3ANsDhcMzGdJioYQ3jpzH+jFIPLQJzBaJK27Wf3Vug==} strip-json-comments@3.1.1: resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} @@ -1685,7 +1685,7 @@ snapshots: seroval: 1.5.6 seroval-plugins: 1.5.6(seroval@1.5.6) - stoat-api@0.15.2: + stoat-api@0.15.3: dependencies: json-with-bigint: 3.4.4