@theholocron/discord-client 1.58.0-alpha.12 → 1.58.0-alpha.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +2 -0
- package/dist/index.mjs +12 -0
- package/package.json +6 -6
package/dist/index.d.mts
CHANGED
|
@@ -746,6 +746,8 @@ export declare function createDiscordBotClient(opts: DiscordBotClientOptions): {
|
|
|
746
746
|
createForumPost: (channelId: string, body: CreateForumPostInput) => Promise<DiscordForumPost>;
|
|
747
747
|
/** `PATCH /channels/:id` on a thread — its title, tags, archived or locked state. Writing to an archived post unarchives it. */
|
|
748
748
|
modify: (threadId: string, body: ModifyThreadInput) => Promise<DiscordThread>;
|
|
749
|
+
/** `DELETE /channels/:id` on a thread — deletes the thread and its messages. A 404 counts as done, as when a retry follows a lost response. */
|
|
750
|
+
delete: (threadId: string) => Promise<void>;
|
|
749
751
|
/** `GET /guilds/:id/threads/active` — every active thread in the server, across channels. */
|
|
750
752
|
active: (guildId: string) => Promise<DiscordThread[]>;
|
|
751
753
|
/** `GET /channels/:id/threads/archived/public` — one page of a channel's archived threads, newest archived first. */
|
package/dist/index.mjs
CHANGED
|
@@ -357,6 +357,18 @@ function createDiscordBotClient(opts) {
|
|
|
357
357
|
body
|
|
358
358
|
});
|
|
359
359
|
},
|
|
360
|
+
/** `DELETE /channels/:id` on a thread — deletes the thread and its messages. A 404 counts as done, as when a retry follows a lost response. */
|
|
361
|
+
delete: async (threadId) => {
|
|
362
|
+
try {
|
|
363
|
+
await rest.request(`/channels/${id(threadId)}`, {
|
|
364
|
+
method: "DELETE",
|
|
365
|
+
expectNoContent: true
|
|
366
|
+
});
|
|
367
|
+
} catch (err) {
|
|
368
|
+
if (err instanceof ProviderApiError && err.status === 404) return;
|
|
369
|
+
throw err;
|
|
370
|
+
}
|
|
371
|
+
},
|
|
360
372
|
/** `GET /guilds/:id/threads/active` — every active thread in the server, across channels. */
|
|
361
373
|
active: async (guildId) => (await rest.request(`/guilds/${id(guildId)}/threads/active`)).threads,
|
|
362
374
|
/** `GET /channels/:id/threads/archived/public` — one page of a channel's archived threads, newest archived first. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theholocron/discord-client",
|
|
3
|
-
"version": "1.58.0-alpha.
|
|
3
|
+
"version": "1.58.0-alpha.13",
|
|
4
4
|
"description": "A TypeScript client for the Discord webhooks API",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"discord",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"dist"
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@theholocron/http-client": "^1.58.0-alpha.
|
|
35
|
+
"@theholocron/http-client": "^1.58.0-alpha.13"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@types/node": "^26",
|
|
@@ -44,10 +44,10 @@
|
|
|
44
44
|
"tsdown": "^0.23.4",
|
|
45
45
|
"typescript": "^5.9.3",
|
|
46
46
|
"vitest": "^5.0.5",
|
|
47
|
-
"@theholocron/eslint-config": "^8.9.0-alpha.
|
|
48
|
-
"@theholocron/
|
|
49
|
-
"@theholocron/
|
|
50
|
-
"@theholocron/tsdown-config": "^8.9.0-alpha.
|
|
47
|
+
"@theholocron/eslint-config": "^8.9.0-alpha.9",
|
|
48
|
+
"@theholocron/tsconfig": "^8.9.0-alpha.9",
|
|
49
|
+
"@theholocron/vitest-config": "^8.9.0-alpha.9",
|
|
50
|
+
"@theholocron/tsdown-config": "^8.9.0-alpha.9"
|
|
51
51
|
},
|
|
52
52
|
"engines": {
|
|
53
53
|
"node": ">=22.0.0"
|