@theholocron/discord-client 1.58.0-alpha.10 → 1.58.0-alpha.12
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 +18 -0
- package/dist/index.mjs +5 -0
- package/package.json +5 -5
package/dist/index.d.mts
CHANGED
|
@@ -253,6 +253,18 @@ export interface DiscordChannel {
|
|
|
253
253
|
permission_overwrites?: DiscordPermissionOverwrite[];
|
|
254
254
|
/** The tags a post in this forum channel can carry; present on forum channels only. */
|
|
255
255
|
available_tags?: DiscordForumTag[];
|
|
256
|
+
/** The emoji offered as the first reaction on every post of a forum channel, or `null` when unset. */
|
|
257
|
+
default_reaction_emoji?: DiscordDefaultReaction | null;
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* A forum's default reaction: one emoji, which is either a custom emoji (`emoji_id`) or a Unicode one (`emoji_name`).
|
|
261
|
+
* Discord allows exactly one per forum.
|
|
262
|
+
*/
|
|
263
|
+
export interface DiscordDefaultReaction {
|
|
264
|
+
/** The id of a custom emoji, or `null` for a Unicode one. */
|
|
265
|
+
emoji_id: string | null;
|
|
266
|
+
/** The Unicode emoji, or `null` for a custom one. */
|
|
267
|
+
emoji_name: string | null;
|
|
256
268
|
}
|
|
257
269
|
/** A tag a forum post can carry, with the emoji shown beside its name. */
|
|
258
270
|
export interface DiscordForumTag {
|
|
@@ -369,6 +381,8 @@ export interface CreateChannelInput {
|
|
|
369
381
|
permission_overwrites?: DiscordPermissionOverwrite[];
|
|
370
382
|
/** The tags of a forum channel (`ChannelType.Forum`). */
|
|
371
383
|
available_tags?: ForumTagInput[];
|
|
384
|
+
/** The default reaction of a forum channel (`ChannelType.Forum`). */
|
|
385
|
+
default_reaction_emoji?: DiscordDefaultReaction;
|
|
372
386
|
}
|
|
373
387
|
/** `null` clears `topic` or detaches the channel from its category. */
|
|
374
388
|
export interface ModifyChannelInput {
|
|
@@ -382,6 +396,8 @@ export interface ModifyChannelInput {
|
|
|
382
396
|
permission_overwrites?: DiscordPermissionOverwrite[];
|
|
383
397
|
/** The full list of a forum channel's tags, replacing the existing ones; give a tag's `id` to keep it. */
|
|
384
398
|
available_tags?: ForumTagInput[];
|
|
399
|
+
/** A forum channel's default reaction; `null` clears it. */
|
|
400
|
+
default_reaction_emoji?: DiscordDefaultReaction | null;
|
|
385
401
|
}
|
|
386
402
|
/** A member of a server. Only what provisioning needs: who they are and which roles they hold. */
|
|
387
403
|
export interface DiscordGuildMember {
|
|
@@ -715,6 +731,8 @@ export declare function createDiscordBotClient(opts: DiscordBotClientOptions): {
|
|
|
715
731
|
messages: (channelId: string, limit?: number) => Promise<DiscordChannelMessage[]>;
|
|
716
732
|
/** `PUT /channels/:id/pins/:id` — pins a message; one already pinned is a no-op. */
|
|
717
733
|
pin: (channelId: string, messageId: string) => Promise<void>;
|
|
734
|
+
/** `PUT /channels/:id/messages/:id/reactions/:emoji/@me` — the bot reacts; a reaction it already has is a no-op. `emoji` is a Unicode emoji or `name:id` for a custom one. */
|
|
735
|
+
addReaction: (channelId: string, messageId: string, emoji: string) => Promise<void>;
|
|
718
736
|
deleteMessage: (channelId: string, messageId: string) => Promise<void>;
|
|
719
737
|
createWebhook: (channelId: string, body: {
|
|
720
738
|
name: string;
|
package/dist/index.mjs
CHANGED
|
@@ -320,6 +320,11 @@ function createDiscordBotClient(opts) {
|
|
|
320
320
|
method: "PUT",
|
|
321
321
|
expectNoContent: true
|
|
322
322
|
}),
|
|
323
|
+
/** `PUT /channels/:id/messages/:id/reactions/:emoji/@me` — the bot reacts; a reaction it already has is a no-op. `emoji` is a Unicode emoji or `name:id` for a custom one. */
|
|
324
|
+
addReaction: (channelId, messageId, emoji) => rest.request(`/channels/${id(channelId)}/messages/${id(messageId)}/reactions/${encodeURIComponent(emoji)}/@me`, {
|
|
325
|
+
method: "PUT",
|
|
326
|
+
expectNoContent: true
|
|
327
|
+
}),
|
|
323
328
|
deleteMessage: (channelId, messageId) => rest.request(`/channels/${id(channelId)}/messages/${id(messageId)}`, {
|
|
324
329
|
method: "DELETE",
|
|
325
330
|
expectNoContent: true
|
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.12",
|
|
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.12"
|
|
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/tsconfig": "^8.9.0-alpha.8",
|
|
48
47
|
"@theholocron/eslint-config": "^8.9.0-alpha.8",
|
|
49
|
-
"@theholocron/
|
|
50
|
-
"@theholocron/
|
|
48
|
+
"@theholocron/vitest-config": "^8.9.0-alpha.8",
|
|
49
|
+
"@theholocron/tsconfig": "^8.9.0-alpha.8",
|
|
50
|
+
"@theholocron/tsdown-config": "^8.9.0-alpha.8"
|
|
51
51
|
},
|
|
52
52
|
"engines": {
|
|
53
53
|
"node": ">=22.0.0"
|