shardwire 1.3.0 → 1.4.0
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/README.md +16 -2
- package/dist/index.d.mts +113 -1
- package/dist/index.d.ts +113 -1
- package/dist/index.js +438 -73
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +439 -73
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -118,6 +118,7 @@ Apps subscribe to events with `app.on(...)`. The bridge forwards only what each
|
|
|
118
118
|
- `messageCreate`
|
|
119
119
|
- `messageUpdate`
|
|
120
120
|
- `messageDelete`
|
|
121
|
+
- `messageBulkDelete`
|
|
121
122
|
- `messageReactionAdd`
|
|
122
123
|
- `messageReactionRemove`
|
|
123
124
|
- `guildCreate`
|
|
@@ -128,6 +129,9 @@ Apps subscribe to events with `app.on(...)`. The bridge forwards only what each
|
|
|
128
129
|
- `threadCreate`
|
|
129
130
|
- `threadUpdate`
|
|
130
131
|
- `threadDelete`
|
|
132
|
+
- `channelCreate`
|
|
133
|
+
- `channelUpdate`
|
|
134
|
+
- `channelDelete`
|
|
131
135
|
|
|
132
136
|
Supported filters:
|
|
133
137
|
|
|
@@ -137,13 +141,16 @@ Supported filters:
|
|
|
137
141
|
- `commandName` (for `interactionCreate`)
|
|
138
142
|
- `customId` (for `interactionCreate`)
|
|
139
143
|
- `interactionKind` (for `interactionCreate`)
|
|
144
|
+
- `channelType` (Discord `ChannelType` when present on the payload, for example `messageCreate` / `messageBulkDelete`)
|
|
145
|
+
- `parentChannelId` (category parent, forum/text parent for threads, or thread parent when serialized)
|
|
146
|
+
- `threadId` (guild thread channels only: matches thread channel ids)
|
|
140
147
|
|
|
141
148
|
### Intent Notes
|
|
142
149
|
|
|
143
150
|
- `ready` and `interactionCreate`: no specific event intent requirement
|
|
144
|
-
- `messageCreate`, `messageUpdate`, `messageDelete`: `GuildMessages`
|
|
151
|
+
- `messageCreate`, `messageUpdate`, `messageDelete`, `messageBulkDelete`: `GuildMessages`
|
|
145
152
|
- `messageReactionAdd`, `messageReactionRemove`: `GuildMessageReactions`
|
|
146
|
-
- `guildCreate`, `guildDelete`, `threadCreate`, `threadUpdate`, `threadDelete`: `Guilds`
|
|
153
|
+
- `guildCreate`, `guildDelete`, `threadCreate`, `threadUpdate`, `threadDelete`, `channelCreate`, `channelUpdate`, `channelDelete`: `Guilds`
|
|
147
154
|
- `guildMemberAdd`, `guildMemberRemove`, `guildMemberUpdate`: `GuildMembers`
|
|
148
155
|
|
|
149
156
|
## Built-In Actions
|
|
@@ -169,6 +176,13 @@ Supported filters:
|
|
|
169
176
|
- `removeMemberRole`
|
|
170
177
|
- `addMessageReaction`
|
|
171
178
|
- `removeOwnMessageReaction`
|
|
179
|
+
- `timeoutMember`
|
|
180
|
+
- `removeMemberTimeout`
|
|
181
|
+
- `createChannel`
|
|
182
|
+
- `editChannel`
|
|
183
|
+
- `deleteChannel`
|
|
184
|
+
- `createThread`
|
|
185
|
+
- `archiveThread`
|
|
172
186
|
|
|
173
187
|
All actions return:
|
|
174
188
|
|
package/dist/index.d.mts
CHANGED
|
@@ -59,6 +59,14 @@ interface BridgeThread {
|
|
|
59
59
|
archived?: boolean;
|
|
60
60
|
locked?: boolean;
|
|
61
61
|
}
|
|
62
|
+
/** Normalized non-thread channel snapshot for channel lifecycle events. */
|
|
63
|
+
interface BridgeChannel {
|
|
64
|
+
id: Snowflake;
|
|
65
|
+
type: number;
|
|
66
|
+
name?: string | null;
|
|
67
|
+
guildId?: Snowflake;
|
|
68
|
+
parentId?: Snowflake | null;
|
|
69
|
+
}
|
|
62
70
|
interface BridgeMessage {
|
|
63
71
|
id: Snowflake;
|
|
64
72
|
channelId: Snowflake;
|
|
@@ -73,12 +81,18 @@ interface BridgeMessage {
|
|
|
73
81
|
/** Message component rows (JSON-serializable API shape). */
|
|
74
82
|
components?: APIActionRowComponent<APIComponentInMessageActionRow>[];
|
|
75
83
|
reference?: BridgeMessageReference;
|
|
84
|
+
/** Discord `ChannelType` when the runtime could resolve `message.channel`. */
|
|
85
|
+
channelType?: number;
|
|
86
|
+
/** Parent category (guild text channels) or parent text/forum (threads), when known. */
|
|
87
|
+
parentChannelId?: Snowflake;
|
|
76
88
|
}
|
|
77
89
|
interface BridgeDeletedMessage {
|
|
78
90
|
id: Snowflake;
|
|
79
91
|
channelId: Snowflake;
|
|
80
92
|
guildId?: Snowflake;
|
|
81
93
|
deletedAt: string;
|
|
94
|
+
channelType?: number;
|
|
95
|
+
parentChannelId?: Snowflake;
|
|
82
96
|
}
|
|
83
97
|
interface BridgeReactionEmoji {
|
|
84
98
|
id?: Snowflake;
|
|
@@ -99,6 +113,10 @@ interface BridgeInteraction {
|
|
|
99
113
|
kind: BridgeInteractionKind;
|
|
100
114
|
guildId?: Snowflake;
|
|
101
115
|
channelId?: Snowflake;
|
|
116
|
+
/** Discord `ChannelType` for `channelId` when the runtime resolved the channel. */
|
|
117
|
+
channelType?: number;
|
|
118
|
+
/** Parent category or parent text/forum for thread channels, when known. */
|
|
119
|
+
parentChannelId?: Snowflake;
|
|
102
120
|
user: BridgeUser;
|
|
103
121
|
member?: BridgeGuildMember;
|
|
104
122
|
commandName?: string;
|
|
@@ -161,12 +179,32 @@ interface MessageReactionAddEventPayload extends EventEnvelopeBase {
|
|
|
161
179
|
interface MessageReactionRemoveEventPayload extends EventEnvelopeBase {
|
|
162
180
|
reaction: BridgeMessageReaction;
|
|
163
181
|
}
|
|
182
|
+
interface ChannelCreateEventPayload extends EventEnvelopeBase {
|
|
183
|
+
channel: BridgeChannel;
|
|
184
|
+
}
|
|
185
|
+
interface ChannelUpdateEventPayload extends EventEnvelopeBase {
|
|
186
|
+
oldChannel?: BridgeChannel;
|
|
187
|
+
channel: BridgeChannel;
|
|
188
|
+
}
|
|
189
|
+
interface ChannelDeleteEventPayload extends EventEnvelopeBase {
|
|
190
|
+
channel: BridgeChannel;
|
|
191
|
+
}
|
|
192
|
+
interface MessageBulkDeleteEventPayload extends EventEnvelopeBase {
|
|
193
|
+
channelId: Snowflake;
|
|
194
|
+
guildId: Snowflake;
|
|
195
|
+
messageIds: Snowflake[];
|
|
196
|
+
/** Discord `ChannelType` for `channelId` when known. */
|
|
197
|
+
channelType?: number;
|
|
198
|
+
/** Parent category or forum/text parent when the channel reports one. */
|
|
199
|
+
parentChannelId?: Snowflake;
|
|
200
|
+
}
|
|
164
201
|
interface BotEventPayloadMap {
|
|
165
202
|
ready: ReadyEventPayload;
|
|
166
203
|
interactionCreate: InteractionCreateEventPayload;
|
|
167
204
|
messageCreate: MessageCreateEventPayload;
|
|
168
205
|
messageUpdate: MessageUpdateEventPayload;
|
|
169
206
|
messageDelete: MessageDeleteEventPayload;
|
|
207
|
+
messageBulkDelete: MessageBulkDeleteEventPayload;
|
|
170
208
|
messageReactionAdd: MessageReactionAddEventPayload;
|
|
171
209
|
messageReactionRemove: MessageReactionRemoveEventPayload;
|
|
172
210
|
guildCreate: GuildCreateEventPayload;
|
|
@@ -177,6 +215,9 @@ interface BotEventPayloadMap {
|
|
|
177
215
|
threadCreate: ThreadCreateEventPayload;
|
|
178
216
|
threadUpdate: ThreadUpdateEventPayload;
|
|
179
217
|
threadDelete: ThreadDeleteEventPayload;
|
|
218
|
+
channelCreate: ChannelCreateEventPayload;
|
|
219
|
+
channelUpdate: ChannelUpdateEventPayload;
|
|
220
|
+
channelDelete: ChannelDeleteEventPayload;
|
|
180
221
|
}
|
|
181
222
|
type BotEventName = keyof BotEventPayloadMap;
|
|
182
223
|
interface BridgeMessageInput {
|
|
@@ -270,6 +311,53 @@ interface RemoveOwnMessageReactionActionPayload {
|
|
|
270
311
|
messageId: Snowflake;
|
|
271
312
|
emoji: string;
|
|
272
313
|
}
|
|
314
|
+
interface TimeoutMemberActionPayload {
|
|
315
|
+
guildId: Snowflake;
|
|
316
|
+
userId: Snowflake;
|
|
317
|
+
/** Duration in milliseconds (Discord allows up to 28 days). */
|
|
318
|
+
durationMs: number;
|
|
319
|
+
reason?: string;
|
|
320
|
+
}
|
|
321
|
+
interface RemoveMemberTimeoutActionPayload {
|
|
322
|
+
guildId: Snowflake;
|
|
323
|
+
userId: Snowflake;
|
|
324
|
+
reason?: string;
|
|
325
|
+
}
|
|
326
|
+
interface CreateChannelActionPayload {
|
|
327
|
+
guildId: Snowflake;
|
|
328
|
+
name: string;
|
|
329
|
+
/** Discord `ChannelType` (default: `0` guild text). */
|
|
330
|
+
type?: number;
|
|
331
|
+
parentId?: Snowflake;
|
|
332
|
+
topic?: string;
|
|
333
|
+
reason?: string;
|
|
334
|
+
}
|
|
335
|
+
interface EditChannelActionPayload {
|
|
336
|
+
channelId: Snowflake;
|
|
337
|
+
name?: string | null;
|
|
338
|
+
parentId?: Snowflake | null;
|
|
339
|
+
topic?: string | null;
|
|
340
|
+
reason?: string;
|
|
341
|
+
}
|
|
342
|
+
interface DeleteChannelActionPayload {
|
|
343
|
+
channelId: Snowflake;
|
|
344
|
+
reason?: string;
|
|
345
|
+
}
|
|
346
|
+
/** `autoArchiveDuration` is in minutes (Discord-supported values). */
|
|
347
|
+
interface CreateThreadActionPayload {
|
|
348
|
+
parentChannelId: Snowflake;
|
|
349
|
+
name: string;
|
|
350
|
+
/** When set, starts a thread on this message (requires a text-based parent). */
|
|
351
|
+
messageId?: Snowflake;
|
|
352
|
+
type?: 'public' | 'private';
|
|
353
|
+
autoArchiveDuration?: 60 | 1440 | 4320 | 10080;
|
|
354
|
+
reason?: string;
|
|
355
|
+
}
|
|
356
|
+
interface ArchiveThreadActionPayload {
|
|
357
|
+
threadId: Snowflake;
|
|
358
|
+
archived?: boolean;
|
|
359
|
+
reason?: string;
|
|
360
|
+
}
|
|
273
361
|
interface BotActionPayloadMap {
|
|
274
362
|
sendMessage: SendMessageActionPayload;
|
|
275
363
|
editMessage: EditMessageActionPayload;
|
|
@@ -290,6 +378,13 @@ interface BotActionPayloadMap {
|
|
|
290
378
|
removeMemberRole: RemoveMemberRoleActionPayload;
|
|
291
379
|
addMessageReaction: AddMessageReactionActionPayload;
|
|
292
380
|
removeOwnMessageReaction: RemoveOwnMessageReactionActionPayload;
|
|
381
|
+
timeoutMember: TimeoutMemberActionPayload;
|
|
382
|
+
removeMemberTimeout: RemoveMemberTimeoutActionPayload;
|
|
383
|
+
createChannel: CreateChannelActionPayload;
|
|
384
|
+
editChannel: EditChannelActionPayload;
|
|
385
|
+
deleteChannel: DeleteChannelActionPayload;
|
|
386
|
+
createThread: CreateThreadActionPayload;
|
|
387
|
+
archiveThread: ArchiveThreadActionPayload;
|
|
293
388
|
}
|
|
294
389
|
interface DeleteMessageActionResult {
|
|
295
390
|
deleted: true;
|
|
@@ -321,6 +416,10 @@ interface MessageReactionActionResult {
|
|
|
321
416
|
channelId: Snowflake;
|
|
322
417
|
emoji: string;
|
|
323
418
|
}
|
|
419
|
+
interface DeleteChannelActionResult {
|
|
420
|
+
deleted: true;
|
|
421
|
+
channelId: Snowflake;
|
|
422
|
+
}
|
|
324
423
|
interface BotActionResultDataMap {
|
|
325
424
|
sendMessage: BridgeMessage;
|
|
326
425
|
editMessage: BridgeMessage;
|
|
@@ -341,6 +440,13 @@ interface BotActionResultDataMap {
|
|
|
341
440
|
removeMemberRole: BridgeGuildMember;
|
|
342
441
|
addMessageReaction: MessageReactionActionResult;
|
|
343
442
|
removeOwnMessageReaction: MessageReactionActionResult;
|
|
443
|
+
timeoutMember: MemberModerationActionResult;
|
|
444
|
+
removeMemberTimeout: BridgeGuildMember;
|
|
445
|
+
createChannel: BridgeChannel;
|
|
446
|
+
editChannel: BridgeChannel;
|
|
447
|
+
deleteChannel: DeleteChannelActionResult;
|
|
448
|
+
createThread: BridgeThread;
|
|
449
|
+
archiveThread: BridgeThread;
|
|
344
450
|
}
|
|
345
451
|
type BotActionName = keyof BotActionPayloadMap;
|
|
346
452
|
interface BridgeCapabilities {
|
|
@@ -356,6 +462,12 @@ interface EventSubscriptionFilter {
|
|
|
356
462
|
customId?: string | readonly string[];
|
|
357
463
|
/** Matches `BridgeInteraction.kind`. */
|
|
358
464
|
interactionKind?: BridgeInteractionKind | readonly BridgeInteractionKind[];
|
|
465
|
+
/** Matches Discord `ChannelType` when present on the payload (messages, interactions, bulk delete). */
|
|
466
|
+
channelType?: number | readonly number[];
|
|
467
|
+
/** Matches `BridgeMessage.parentChannelId` / thread parent / channel parent when present. */
|
|
468
|
+
parentChannelId?: Snowflake | readonly Snowflake[];
|
|
469
|
+
/** Matches guild thread channels only: same as message `channelId` when `channelType` is a guild thread. */
|
|
470
|
+
threadId?: Snowflake | readonly Snowflake[];
|
|
359
471
|
}
|
|
360
472
|
interface EventSubscription<K extends BotEventName = BotEventName> {
|
|
361
473
|
name: K;
|
|
@@ -492,4 +604,4 @@ declare function createBotBridge(options: BotBridgeOptions): BotBridge;
|
|
|
492
604
|
|
|
493
605
|
declare function connectBotBridge(options: AppBridgeOptions): AppBridge;
|
|
494
606
|
|
|
495
|
-
export { type ActionError, type ActionErrorDetails, type ActionFailure, type ActionResult, type ActionSuccess, type AddMemberRoleActionPayload, type AddMessageReactionActionPayload, type AppBridge, type AppBridgeActionInvokeOptions, type AppBridgeActions, type AppBridgeMetricsHooks, type AppBridgeOptions, type BanMemberActionPayload, type BotActionName, type BotActionPayloadMap, type BotActionResultDataMap, type BotBridge, type BotBridgeOptions, type BotBridgeSecret, type BotEventName, type BotEventPayloadMap, type BotIntentName, type BridgeAttachment, type BridgeCapabilities, BridgeCapabilityError, type BridgeDeletedMessage, type BridgeGuild, type BridgeGuildMember, type BridgeInteraction, type BridgeInteractionKind, type BridgeMessage, type BridgeMessageInput, type BridgeMessageReaction, type BridgeMessageReference, type BridgeReactionEmoji, type BridgeThread, type BridgeUser, type DeferInteractionActionPayload, type DeferInteractionActionResult, type DeferUpdateInteractionActionPayload, type DeferUpdateInteractionActionResult, type DeleteInteractionReplyActionPayload, type DeleteInteractionReplyActionResult, type DeleteMessageActionPayload, type DeleteMessageActionResult, type EditInteractionReplyActionPayload, type EditMessageActionPayload, type EventEnvelopeBase, type EventHandler, type EventSubscription, type EventSubscriptionFilter, type FetchMemberActionPayload, type FetchMessageActionPayload, type FollowUpInteractionActionPayload, type GuildCreateEventPayload, type GuildDeleteEventPayload, type GuildMemberAddEventPayload, type GuildMemberRemoveEventPayload, type GuildMemberUpdateEventPayload, type InteractionCreateEventPayload, type KickMemberActionPayload, type MemberModerationActionResult, type MessageCreateEventPayload, type MessageDeleteEventPayload, type MessageReactionActionResult, type MessageReactionAddEventPayload, type MessageReactionRemoveEventPayload, type MessageUpdateEventPayload, type ReadyEventPayload, type RemoveMemberRoleActionPayload, type RemoveOwnMessageReactionActionPayload, type ReplyToInteractionActionPayload, type ScopedSecretConfig, type SecretPermissions, type SendMessageActionPayload, type ShardwireLogger, type ShowModalActionPayload, type ShowModalActionResult, type ThreadCreateEventPayload, type ThreadDeleteEventPayload, type ThreadUpdateEventPayload, type Unsubscribe, type UpdateInteractionActionPayload, connectBotBridge, createBotBridge };
|
|
607
|
+
export { type ActionError, type ActionErrorDetails, type ActionFailure, type ActionResult, type ActionSuccess, type AddMemberRoleActionPayload, type AddMessageReactionActionPayload, type AppBridge, type AppBridgeActionInvokeOptions, type AppBridgeActions, type AppBridgeMetricsHooks, type AppBridgeOptions, type ArchiveThreadActionPayload, type BanMemberActionPayload, type BotActionName, type BotActionPayloadMap, type BotActionResultDataMap, type BotBridge, type BotBridgeOptions, type BotBridgeSecret, type BotEventName, type BotEventPayloadMap, type BotIntentName, type BridgeAttachment, type BridgeCapabilities, BridgeCapabilityError, type BridgeChannel, type BridgeDeletedMessage, type BridgeGuild, type BridgeGuildMember, type BridgeInteraction, type BridgeInteractionKind, type BridgeMessage, type BridgeMessageInput, type BridgeMessageReaction, type BridgeMessageReference, type BridgeReactionEmoji, type BridgeThread, type BridgeUser, type ChannelCreateEventPayload, type ChannelDeleteEventPayload, type ChannelUpdateEventPayload, type CreateChannelActionPayload, type CreateThreadActionPayload, type DeferInteractionActionPayload, type DeferInteractionActionResult, type DeferUpdateInteractionActionPayload, type DeferUpdateInteractionActionResult, type DeleteChannelActionPayload, type DeleteChannelActionResult, type DeleteInteractionReplyActionPayload, type DeleteInteractionReplyActionResult, type DeleteMessageActionPayload, type DeleteMessageActionResult, type EditChannelActionPayload, type EditInteractionReplyActionPayload, type EditMessageActionPayload, type EventEnvelopeBase, type EventHandler, type EventSubscription, type EventSubscriptionFilter, type FetchMemberActionPayload, type FetchMessageActionPayload, type FollowUpInteractionActionPayload, type GuildCreateEventPayload, type GuildDeleteEventPayload, type GuildMemberAddEventPayload, type GuildMemberRemoveEventPayload, type GuildMemberUpdateEventPayload, type InteractionCreateEventPayload, type KickMemberActionPayload, type MemberModerationActionResult, type MessageBulkDeleteEventPayload, type MessageCreateEventPayload, type MessageDeleteEventPayload, type MessageReactionActionResult, type MessageReactionAddEventPayload, type MessageReactionRemoveEventPayload, type MessageUpdateEventPayload, type ReadyEventPayload, type RemoveMemberRoleActionPayload, type RemoveMemberTimeoutActionPayload, type RemoveOwnMessageReactionActionPayload, type ReplyToInteractionActionPayload, type ScopedSecretConfig, type SecretPermissions, type SendMessageActionPayload, type ShardwireLogger, type ShowModalActionPayload, type ShowModalActionResult, type ThreadCreateEventPayload, type ThreadDeleteEventPayload, type ThreadUpdateEventPayload, type TimeoutMemberActionPayload, type Unsubscribe, type UpdateInteractionActionPayload, connectBotBridge, createBotBridge };
|
package/dist/index.d.ts
CHANGED
|
@@ -59,6 +59,14 @@ interface BridgeThread {
|
|
|
59
59
|
archived?: boolean;
|
|
60
60
|
locked?: boolean;
|
|
61
61
|
}
|
|
62
|
+
/** Normalized non-thread channel snapshot for channel lifecycle events. */
|
|
63
|
+
interface BridgeChannel {
|
|
64
|
+
id: Snowflake;
|
|
65
|
+
type: number;
|
|
66
|
+
name?: string | null;
|
|
67
|
+
guildId?: Snowflake;
|
|
68
|
+
parentId?: Snowflake | null;
|
|
69
|
+
}
|
|
62
70
|
interface BridgeMessage {
|
|
63
71
|
id: Snowflake;
|
|
64
72
|
channelId: Snowflake;
|
|
@@ -73,12 +81,18 @@ interface BridgeMessage {
|
|
|
73
81
|
/** Message component rows (JSON-serializable API shape). */
|
|
74
82
|
components?: APIActionRowComponent<APIComponentInMessageActionRow>[];
|
|
75
83
|
reference?: BridgeMessageReference;
|
|
84
|
+
/** Discord `ChannelType` when the runtime could resolve `message.channel`. */
|
|
85
|
+
channelType?: number;
|
|
86
|
+
/** Parent category (guild text channels) or parent text/forum (threads), when known. */
|
|
87
|
+
parentChannelId?: Snowflake;
|
|
76
88
|
}
|
|
77
89
|
interface BridgeDeletedMessage {
|
|
78
90
|
id: Snowflake;
|
|
79
91
|
channelId: Snowflake;
|
|
80
92
|
guildId?: Snowflake;
|
|
81
93
|
deletedAt: string;
|
|
94
|
+
channelType?: number;
|
|
95
|
+
parentChannelId?: Snowflake;
|
|
82
96
|
}
|
|
83
97
|
interface BridgeReactionEmoji {
|
|
84
98
|
id?: Snowflake;
|
|
@@ -99,6 +113,10 @@ interface BridgeInteraction {
|
|
|
99
113
|
kind: BridgeInteractionKind;
|
|
100
114
|
guildId?: Snowflake;
|
|
101
115
|
channelId?: Snowflake;
|
|
116
|
+
/** Discord `ChannelType` for `channelId` when the runtime resolved the channel. */
|
|
117
|
+
channelType?: number;
|
|
118
|
+
/** Parent category or parent text/forum for thread channels, when known. */
|
|
119
|
+
parentChannelId?: Snowflake;
|
|
102
120
|
user: BridgeUser;
|
|
103
121
|
member?: BridgeGuildMember;
|
|
104
122
|
commandName?: string;
|
|
@@ -161,12 +179,32 @@ interface MessageReactionAddEventPayload extends EventEnvelopeBase {
|
|
|
161
179
|
interface MessageReactionRemoveEventPayload extends EventEnvelopeBase {
|
|
162
180
|
reaction: BridgeMessageReaction;
|
|
163
181
|
}
|
|
182
|
+
interface ChannelCreateEventPayload extends EventEnvelopeBase {
|
|
183
|
+
channel: BridgeChannel;
|
|
184
|
+
}
|
|
185
|
+
interface ChannelUpdateEventPayload extends EventEnvelopeBase {
|
|
186
|
+
oldChannel?: BridgeChannel;
|
|
187
|
+
channel: BridgeChannel;
|
|
188
|
+
}
|
|
189
|
+
interface ChannelDeleteEventPayload extends EventEnvelopeBase {
|
|
190
|
+
channel: BridgeChannel;
|
|
191
|
+
}
|
|
192
|
+
interface MessageBulkDeleteEventPayload extends EventEnvelopeBase {
|
|
193
|
+
channelId: Snowflake;
|
|
194
|
+
guildId: Snowflake;
|
|
195
|
+
messageIds: Snowflake[];
|
|
196
|
+
/** Discord `ChannelType` for `channelId` when known. */
|
|
197
|
+
channelType?: number;
|
|
198
|
+
/** Parent category or forum/text parent when the channel reports one. */
|
|
199
|
+
parentChannelId?: Snowflake;
|
|
200
|
+
}
|
|
164
201
|
interface BotEventPayloadMap {
|
|
165
202
|
ready: ReadyEventPayload;
|
|
166
203
|
interactionCreate: InteractionCreateEventPayload;
|
|
167
204
|
messageCreate: MessageCreateEventPayload;
|
|
168
205
|
messageUpdate: MessageUpdateEventPayload;
|
|
169
206
|
messageDelete: MessageDeleteEventPayload;
|
|
207
|
+
messageBulkDelete: MessageBulkDeleteEventPayload;
|
|
170
208
|
messageReactionAdd: MessageReactionAddEventPayload;
|
|
171
209
|
messageReactionRemove: MessageReactionRemoveEventPayload;
|
|
172
210
|
guildCreate: GuildCreateEventPayload;
|
|
@@ -177,6 +215,9 @@ interface BotEventPayloadMap {
|
|
|
177
215
|
threadCreate: ThreadCreateEventPayload;
|
|
178
216
|
threadUpdate: ThreadUpdateEventPayload;
|
|
179
217
|
threadDelete: ThreadDeleteEventPayload;
|
|
218
|
+
channelCreate: ChannelCreateEventPayload;
|
|
219
|
+
channelUpdate: ChannelUpdateEventPayload;
|
|
220
|
+
channelDelete: ChannelDeleteEventPayload;
|
|
180
221
|
}
|
|
181
222
|
type BotEventName = keyof BotEventPayloadMap;
|
|
182
223
|
interface BridgeMessageInput {
|
|
@@ -270,6 +311,53 @@ interface RemoveOwnMessageReactionActionPayload {
|
|
|
270
311
|
messageId: Snowflake;
|
|
271
312
|
emoji: string;
|
|
272
313
|
}
|
|
314
|
+
interface TimeoutMemberActionPayload {
|
|
315
|
+
guildId: Snowflake;
|
|
316
|
+
userId: Snowflake;
|
|
317
|
+
/** Duration in milliseconds (Discord allows up to 28 days). */
|
|
318
|
+
durationMs: number;
|
|
319
|
+
reason?: string;
|
|
320
|
+
}
|
|
321
|
+
interface RemoveMemberTimeoutActionPayload {
|
|
322
|
+
guildId: Snowflake;
|
|
323
|
+
userId: Snowflake;
|
|
324
|
+
reason?: string;
|
|
325
|
+
}
|
|
326
|
+
interface CreateChannelActionPayload {
|
|
327
|
+
guildId: Snowflake;
|
|
328
|
+
name: string;
|
|
329
|
+
/** Discord `ChannelType` (default: `0` guild text). */
|
|
330
|
+
type?: number;
|
|
331
|
+
parentId?: Snowflake;
|
|
332
|
+
topic?: string;
|
|
333
|
+
reason?: string;
|
|
334
|
+
}
|
|
335
|
+
interface EditChannelActionPayload {
|
|
336
|
+
channelId: Snowflake;
|
|
337
|
+
name?: string | null;
|
|
338
|
+
parentId?: Snowflake | null;
|
|
339
|
+
topic?: string | null;
|
|
340
|
+
reason?: string;
|
|
341
|
+
}
|
|
342
|
+
interface DeleteChannelActionPayload {
|
|
343
|
+
channelId: Snowflake;
|
|
344
|
+
reason?: string;
|
|
345
|
+
}
|
|
346
|
+
/** `autoArchiveDuration` is in minutes (Discord-supported values). */
|
|
347
|
+
interface CreateThreadActionPayload {
|
|
348
|
+
parentChannelId: Snowflake;
|
|
349
|
+
name: string;
|
|
350
|
+
/** When set, starts a thread on this message (requires a text-based parent). */
|
|
351
|
+
messageId?: Snowflake;
|
|
352
|
+
type?: 'public' | 'private';
|
|
353
|
+
autoArchiveDuration?: 60 | 1440 | 4320 | 10080;
|
|
354
|
+
reason?: string;
|
|
355
|
+
}
|
|
356
|
+
interface ArchiveThreadActionPayload {
|
|
357
|
+
threadId: Snowflake;
|
|
358
|
+
archived?: boolean;
|
|
359
|
+
reason?: string;
|
|
360
|
+
}
|
|
273
361
|
interface BotActionPayloadMap {
|
|
274
362
|
sendMessage: SendMessageActionPayload;
|
|
275
363
|
editMessage: EditMessageActionPayload;
|
|
@@ -290,6 +378,13 @@ interface BotActionPayloadMap {
|
|
|
290
378
|
removeMemberRole: RemoveMemberRoleActionPayload;
|
|
291
379
|
addMessageReaction: AddMessageReactionActionPayload;
|
|
292
380
|
removeOwnMessageReaction: RemoveOwnMessageReactionActionPayload;
|
|
381
|
+
timeoutMember: TimeoutMemberActionPayload;
|
|
382
|
+
removeMemberTimeout: RemoveMemberTimeoutActionPayload;
|
|
383
|
+
createChannel: CreateChannelActionPayload;
|
|
384
|
+
editChannel: EditChannelActionPayload;
|
|
385
|
+
deleteChannel: DeleteChannelActionPayload;
|
|
386
|
+
createThread: CreateThreadActionPayload;
|
|
387
|
+
archiveThread: ArchiveThreadActionPayload;
|
|
293
388
|
}
|
|
294
389
|
interface DeleteMessageActionResult {
|
|
295
390
|
deleted: true;
|
|
@@ -321,6 +416,10 @@ interface MessageReactionActionResult {
|
|
|
321
416
|
channelId: Snowflake;
|
|
322
417
|
emoji: string;
|
|
323
418
|
}
|
|
419
|
+
interface DeleteChannelActionResult {
|
|
420
|
+
deleted: true;
|
|
421
|
+
channelId: Snowflake;
|
|
422
|
+
}
|
|
324
423
|
interface BotActionResultDataMap {
|
|
325
424
|
sendMessage: BridgeMessage;
|
|
326
425
|
editMessage: BridgeMessage;
|
|
@@ -341,6 +440,13 @@ interface BotActionResultDataMap {
|
|
|
341
440
|
removeMemberRole: BridgeGuildMember;
|
|
342
441
|
addMessageReaction: MessageReactionActionResult;
|
|
343
442
|
removeOwnMessageReaction: MessageReactionActionResult;
|
|
443
|
+
timeoutMember: MemberModerationActionResult;
|
|
444
|
+
removeMemberTimeout: BridgeGuildMember;
|
|
445
|
+
createChannel: BridgeChannel;
|
|
446
|
+
editChannel: BridgeChannel;
|
|
447
|
+
deleteChannel: DeleteChannelActionResult;
|
|
448
|
+
createThread: BridgeThread;
|
|
449
|
+
archiveThread: BridgeThread;
|
|
344
450
|
}
|
|
345
451
|
type BotActionName = keyof BotActionPayloadMap;
|
|
346
452
|
interface BridgeCapabilities {
|
|
@@ -356,6 +462,12 @@ interface EventSubscriptionFilter {
|
|
|
356
462
|
customId?: string | readonly string[];
|
|
357
463
|
/** Matches `BridgeInteraction.kind`. */
|
|
358
464
|
interactionKind?: BridgeInteractionKind | readonly BridgeInteractionKind[];
|
|
465
|
+
/** Matches Discord `ChannelType` when present on the payload (messages, interactions, bulk delete). */
|
|
466
|
+
channelType?: number | readonly number[];
|
|
467
|
+
/** Matches `BridgeMessage.parentChannelId` / thread parent / channel parent when present. */
|
|
468
|
+
parentChannelId?: Snowflake | readonly Snowflake[];
|
|
469
|
+
/** Matches guild thread channels only: same as message `channelId` when `channelType` is a guild thread. */
|
|
470
|
+
threadId?: Snowflake | readonly Snowflake[];
|
|
359
471
|
}
|
|
360
472
|
interface EventSubscription<K extends BotEventName = BotEventName> {
|
|
361
473
|
name: K;
|
|
@@ -492,4 +604,4 @@ declare function createBotBridge(options: BotBridgeOptions): BotBridge;
|
|
|
492
604
|
|
|
493
605
|
declare function connectBotBridge(options: AppBridgeOptions): AppBridge;
|
|
494
606
|
|
|
495
|
-
export { type ActionError, type ActionErrorDetails, type ActionFailure, type ActionResult, type ActionSuccess, type AddMemberRoleActionPayload, type AddMessageReactionActionPayload, type AppBridge, type AppBridgeActionInvokeOptions, type AppBridgeActions, type AppBridgeMetricsHooks, type AppBridgeOptions, type BanMemberActionPayload, type BotActionName, type BotActionPayloadMap, type BotActionResultDataMap, type BotBridge, type BotBridgeOptions, type BotBridgeSecret, type BotEventName, type BotEventPayloadMap, type BotIntentName, type BridgeAttachment, type BridgeCapabilities, BridgeCapabilityError, type BridgeDeletedMessage, type BridgeGuild, type BridgeGuildMember, type BridgeInteraction, type BridgeInteractionKind, type BridgeMessage, type BridgeMessageInput, type BridgeMessageReaction, type BridgeMessageReference, type BridgeReactionEmoji, type BridgeThread, type BridgeUser, type DeferInteractionActionPayload, type DeferInteractionActionResult, type DeferUpdateInteractionActionPayload, type DeferUpdateInteractionActionResult, type DeleteInteractionReplyActionPayload, type DeleteInteractionReplyActionResult, type DeleteMessageActionPayload, type DeleteMessageActionResult, type EditInteractionReplyActionPayload, type EditMessageActionPayload, type EventEnvelopeBase, type EventHandler, type EventSubscription, type EventSubscriptionFilter, type FetchMemberActionPayload, type FetchMessageActionPayload, type FollowUpInteractionActionPayload, type GuildCreateEventPayload, type GuildDeleteEventPayload, type GuildMemberAddEventPayload, type GuildMemberRemoveEventPayload, type GuildMemberUpdateEventPayload, type InteractionCreateEventPayload, type KickMemberActionPayload, type MemberModerationActionResult, type MessageCreateEventPayload, type MessageDeleteEventPayload, type MessageReactionActionResult, type MessageReactionAddEventPayload, type MessageReactionRemoveEventPayload, type MessageUpdateEventPayload, type ReadyEventPayload, type RemoveMemberRoleActionPayload, type RemoveOwnMessageReactionActionPayload, type ReplyToInteractionActionPayload, type ScopedSecretConfig, type SecretPermissions, type SendMessageActionPayload, type ShardwireLogger, type ShowModalActionPayload, type ShowModalActionResult, type ThreadCreateEventPayload, type ThreadDeleteEventPayload, type ThreadUpdateEventPayload, type Unsubscribe, type UpdateInteractionActionPayload, connectBotBridge, createBotBridge };
|
|
607
|
+
export { type ActionError, type ActionErrorDetails, type ActionFailure, type ActionResult, type ActionSuccess, type AddMemberRoleActionPayload, type AddMessageReactionActionPayload, type AppBridge, type AppBridgeActionInvokeOptions, type AppBridgeActions, type AppBridgeMetricsHooks, type AppBridgeOptions, type ArchiveThreadActionPayload, type BanMemberActionPayload, type BotActionName, type BotActionPayloadMap, type BotActionResultDataMap, type BotBridge, type BotBridgeOptions, type BotBridgeSecret, type BotEventName, type BotEventPayloadMap, type BotIntentName, type BridgeAttachment, type BridgeCapabilities, BridgeCapabilityError, type BridgeChannel, type BridgeDeletedMessage, type BridgeGuild, type BridgeGuildMember, type BridgeInteraction, type BridgeInteractionKind, type BridgeMessage, type BridgeMessageInput, type BridgeMessageReaction, type BridgeMessageReference, type BridgeReactionEmoji, type BridgeThread, type BridgeUser, type ChannelCreateEventPayload, type ChannelDeleteEventPayload, type ChannelUpdateEventPayload, type CreateChannelActionPayload, type CreateThreadActionPayload, type DeferInteractionActionPayload, type DeferInteractionActionResult, type DeferUpdateInteractionActionPayload, type DeferUpdateInteractionActionResult, type DeleteChannelActionPayload, type DeleteChannelActionResult, type DeleteInteractionReplyActionPayload, type DeleteInteractionReplyActionResult, type DeleteMessageActionPayload, type DeleteMessageActionResult, type EditChannelActionPayload, type EditInteractionReplyActionPayload, type EditMessageActionPayload, type EventEnvelopeBase, type EventHandler, type EventSubscription, type EventSubscriptionFilter, type FetchMemberActionPayload, type FetchMessageActionPayload, type FollowUpInteractionActionPayload, type GuildCreateEventPayload, type GuildDeleteEventPayload, type GuildMemberAddEventPayload, type GuildMemberRemoveEventPayload, type GuildMemberUpdateEventPayload, type InteractionCreateEventPayload, type KickMemberActionPayload, type MemberModerationActionResult, type MessageBulkDeleteEventPayload, type MessageCreateEventPayload, type MessageDeleteEventPayload, type MessageReactionActionResult, type MessageReactionAddEventPayload, type MessageReactionRemoveEventPayload, type MessageUpdateEventPayload, type ReadyEventPayload, type RemoveMemberRoleActionPayload, type RemoveMemberTimeoutActionPayload, type RemoveOwnMessageReactionActionPayload, type ReplyToInteractionActionPayload, type ScopedSecretConfig, type SecretPermissions, type SendMessageActionPayload, type ShardwireLogger, type ShowModalActionPayload, type ShowModalActionResult, type ThreadCreateEventPayload, type ThreadDeleteEventPayload, type ThreadUpdateEventPayload, type TimeoutMemberActionPayload, type Unsubscribe, type UpdateInteractionActionPayload, connectBotBridge, createBotBridge };
|