@argentina-community/events-descriptions 1.0.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/dist/index.js ADDED
@@ -0,0 +1,2008 @@
1
+ import { isChannelOfType } from "@argentina-community/channels-utils";
2
+ import { ChannelType, InviteType } from "discord.js";
3
+
4
+ //#region src/lib/utils/record-update.ts
5
+ function computeUpdates(previous, current, mappings = {}, options = {}) {
6
+ const defined = new Set(Object.values(mappings));
7
+ const source = { ...mappings };
8
+ if (!options.excludeDefaults) {
9
+ for (const value of new Set([...Object.keys(previous ?? {}), ...Object.keys(current)])) if (!defined.has(value)) source[value] = value;
10
+ }
11
+ const iterator = Iterator.from(Object.entries(source));
12
+ const updates = iterator.filter((value) => {
13
+ const type = typeof current[value[1]];
14
+ return "function" !== type && "symbol" !== type && !(type === "object" && !Array.isArray(current[value[1]]));
15
+ }).filter((value) => {
16
+ if (!previous) return true;
17
+ const field = value[1];
18
+ if (Array.isArray(previous[field]) && Array.isArray(current[field])) return current[field].length !== previous[field].length;
19
+ if (!Object.hasOwn(current, field) && !Object.hasOwn(previous, field)) return false;
20
+ if (Object.hasOwn(current, field) !== Object.hasOwn(previous, field)) return true;
21
+ return current[field] !== previous[field];
22
+ }).map((entry) => {
23
+ const index = entry[0], field = entry[1];
24
+ return Array.isArray(current[field]) ? [index, current[field].length] : [index, current[field]];
25
+ });
26
+ return Object.fromEntries(updates);
27
+ }
28
+
29
+ //#endregion
30
+ //#region src/lib/description/events/application/client.application-scope-bodies.ts
31
+ const guildAvailable$2 = (guild) => ({
32
+ name: guild.name.substring(0, 7),
33
+ vanity: guild.vanityURLCode,
34
+ ownerId: guild.ownerId,
35
+ locale: guild.preferredLocale,
36
+ large: guild.large,
37
+ verified: guild.verified,
38
+ partnered: guild.partnered,
39
+ createdAt: guild.createdTimestamp,
40
+ shard: guild.shardId
41
+ });
42
+ const guildUnavailable$2 = (guild) => ({
43
+ name: guild.name.substring(0, 7),
44
+ vanity: guild.vanityURLCode,
45
+ ownerId: guild.ownerId,
46
+ locale: guild.preferredLocale,
47
+ large: guild.large,
48
+ verified: guild.verified,
49
+ partnered: guild.partnered,
50
+ createdAt: guild.createdTimestamp,
51
+ shard: guild.shardId
52
+ });
53
+ const guildMemberAvailable$2 = (member) => ({
54
+ name: member.displayName.substring(0, 7),
55
+ userId: member.user.id,
56
+ permissions: member.permissions.bitfield,
57
+ premium: member.premiumSinceTimestamp !== null,
58
+ joinedAt: member.joinedTimestamp
59
+ });
60
+ const guildMembersChunk$2 = (_, guild, chunk) => ({
61
+ size: chunk.count,
62
+ shard: guild.shardId
63
+ });
64
+ const threadMemberUpdate$2 = (previous, current) => computeUpdates(previous, current);
65
+ const threadListSync$2 = (threads, guild) => ({
66
+ size: threads.size,
67
+ shard: guild.shardId
68
+ });
69
+ const soundboardSounds$2 = (sounds, guild) => ({
70
+ size: sounds.size,
71
+ shard: guild.shardId
72
+ });
73
+ const cacheSweep$2 = (message) => ({ message });
74
+ const invalidated$2 = () => ({});
75
+
76
+ //#endregion
77
+ //#region src/lib/description/events/application/gateway.application-scope-bodies.ts
78
+ const ready$2 = (client) => ({
79
+ guilds: client.application.approximateGuildCount,
80
+ users: client.application.approximateUserInstallCount,
81
+ readyAt: client.readyTimestamp
82
+ });
83
+ const error$2 = (error$3) => ({
84
+ error: error$3.name,
85
+ message: error$3.message
86
+ });
87
+ const warn$2 = (message) => ({ message });
88
+ const debug$2 = (message) => ({ message });
89
+ const shardReady$2 = (shard, _unavailableGuilds) => ({ shard });
90
+ const shardError$2 = (error$3, shard) => ({
91
+ error: error$3.name,
92
+ message: error$3.message,
93
+ shard
94
+ });
95
+ const shardResume$2 = (shard, events) => ({
96
+ replayed: events,
97
+ shard
98
+ });
99
+ const shardDisconnect$2 = (event, shard) => ({
100
+ code: event.code,
101
+ shard
102
+ });
103
+ const shardReconnecting$2 = (shard) => ({ shard });
104
+ const userUpdate$2 = (previous, current) => computeUpdates(previous, current);
105
+ const interactionCreate$2 = (interaction) => ({
106
+ type: interaction.type,
107
+ context: interaction.context,
108
+ locale: interaction.locale,
109
+ id: interaction.id,
110
+ customId: interaction.isMessageComponent() && interaction.customId || null
111
+ });
112
+ const presenceUpdate$2 = (presence) => presence && {
113
+ status: presence.status,
114
+ activities: presence.activities
115
+ } || {};
116
+
117
+ //#endregion
118
+ //#region src/lib/description/events/application/installations.application-scope-bodies.ts
119
+ const guildCreate$2 = (guild) => ({
120
+ name: guild.name,
121
+ vanity: guild.vanityURLCode,
122
+ ownerId: guild.ownerId,
123
+ locale: guild.preferredLocale,
124
+ large: guild.large,
125
+ verified: guild.verified,
126
+ partnered: guild.partnered,
127
+ createdAt: guild.createdTimestamp,
128
+ shard: guild.shardId
129
+ });
130
+ const guildDelete$2 = (guild) => ({
131
+ name: guild.name,
132
+ vanity: guild.vanityURLCode,
133
+ ownerId: guild.ownerId,
134
+ locale: guild.preferredLocale,
135
+ large: guild.large,
136
+ verified: guild.verified,
137
+ partnered: guild.partnered,
138
+ createdAt: guild.createdTimestamp,
139
+ shard: guild.shardId
140
+ });
141
+ const entitlementCreate$2 = (entitlement) => ({
142
+ type: entitlement.type,
143
+ guildId: entitlement.guildId,
144
+ startsAt: entitlement.startsTimestamp,
145
+ endsAt: entitlement.endsTimestamp
146
+ });
147
+ const entitlementUpdate$2 = (previous, current) => computeUpdates(previous, current);
148
+ const entitlementDelete$2 = (entitlement) => ({
149
+ type: entitlement.type,
150
+ guildId: entitlement.guildId,
151
+ startsAt: entitlement.startsTimestamp,
152
+ endsAt: entitlement.endsTimestamp
153
+ });
154
+ const subscriptionCreate$2 = (subscription) => ({
155
+ status: subscription.status,
156
+ country: subscription.country,
157
+ period: [subscription.currentPeriodStartTimestamp, subscription.currentPeriodEndTimestamp]
158
+ });
159
+ const subscriptionUpdate$2 = (previous, current) => computeUpdates(previous, current);
160
+ const subscriptionDelete$2 = (subscription) => ({
161
+ status: subscription.status,
162
+ country: subscription.country,
163
+ period: [subscription.currentPeriodStartTimestamp, subscription.currentPeriodEndTimestamp]
164
+ });
165
+
166
+ //#endregion
167
+ //#region src/lib/description/events/channel/actions.channel-scope-bodies.ts
168
+ const typingStart$2 = (typing) => ({ startedAt: typing.startedTimestamp });
169
+ const messageDeleteBulk$2 = (messages) => ({ size: messages.size });
170
+ const channelPinsUpdate$2 = () => ({});
171
+
172
+ //#endregion
173
+ //#region src/lib/description/events/channel/lifecycle.channel-scope-bodies.ts
174
+ const channelCreate$2 = (channel) => ({
175
+ name: channel.name,
176
+ type: channel.type
177
+ });
178
+ const channelUpdate$2 = (previous, current) => computeUpdates(previous, current);
179
+ const channelDelete$2 = (channel) => channel.isDMBased() ? { type: channel.type } : {
180
+ name: channel.name,
181
+ type: channel.type
182
+ };
183
+
184
+ //#endregion
185
+ //#region src/lib/description/events/channel/stage.channel-scope-bodies.ts
186
+ const stageInstanceCreate$2 = (instance) => ({
187
+ topic: instance.topic,
188
+ privacy: instance.privacyLevel
189
+ });
190
+ const stageInstanceUpdate$2 = (previous, current) => computeUpdates(previous, current);
191
+ const stageInstanceDelete$2 = (instance) => ({
192
+ topic: instance.topic,
193
+ privacy: instance.privacyLevel
194
+ });
195
+
196
+ //#endregion
197
+ //#region src/lib/description/events/channel/voice.channel-scope-bodies.ts
198
+ const voiceStateUpdate$2 = (previous, current) => computeUpdates(previous, current);
199
+ const voiceChannelEffectSend$2 = (effect) => ({
200
+ type: effect.animationType,
201
+ soundId: effect.soundboardSound?.soundId ?? null
202
+ });
203
+
204
+ //#endregion
205
+ //#region src/lib/description/events/channel/webhook.channel-scope-bodies.ts
206
+ const webhookUpdate$2 = (_channel) => ({});
207
+ const webhooksUpdate$2 = (_channel) => ({});
208
+
209
+ //#endregion
210
+ //#region src/lib/description/events/guild/configuration.guild-scope-bodies.ts
211
+ const guildIntegrationsUpdate$2 = () => ({});
212
+ const applicationCommandPermissionsUpdate$2 = (command) => ({ permissions: command.permissions });
213
+ const guildUpdate$2 = (previous, current) => computeUpdates(previous, current);
214
+ const autoModerationRuleCreate$2 = (rule) => ({
215
+ name: rule.name,
216
+ event: rule.eventType,
217
+ trigger: rule.triggerType
218
+ });
219
+ const autoModerationRuleUpdate$2 = (previous, current) => ({
220
+ ...computeUpdates(previous, current),
221
+ ...computeUpdates(previous?.triggerMetadata ?? null, current.triggerMetadata),
222
+ ...computeUpdates({
223
+ exemptChannels: previous?.exemptChannels.size ?? 0,
224
+ exemptRoles: previous?.exemptRoles.size ?? 0
225
+ }, {
226
+ exemptChannels: current.exemptChannels.size ?? 0,
227
+ exemptRoles: current.exemptRoles.size ?? 0
228
+ })
229
+ });
230
+ const autoModerationRuleDelete$2 = (rule) => ({
231
+ name: rule.name,
232
+ event: rule.eventType,
233
+ trigger: rule.triggerType
234
+ });
235
+ const autoModerationActionExecution$2 = (execution) => ({
236
+ match: execution.content,
237
+ action: execution.action.type,
238
+ trigger: execution.ruleTriggerType,
239
+ userId: execution.userId
240
+ });
241
+
242
+ //#endregion
243
+ //#region src/lib/description/events/guild/members.guild-scope-bodies.ts
244
+ const guildMemberAdd$2 = (member) => ({
245
+ userId: member.user.id,
246
+ joinedAt: member.joinedTimestamp
247
+ });
248
+ const guildMemberUpdate$2 = (previous, current) => ({
249
+ ...computeUpdates(previous, current),
250
+ ...computeUpdates({
251
+ permissions: previous.permissions.bitfield,
252
+ flags: previous.flags.bitfield,
253
+ roles: previous.roles.cache.size
254
+ }, {
255
+ permissions: current.permissions.bitfield,
256
+ flags: current.flags.bitfield,
257
+ roles: current.roles.cache.size
258
+ })
259
+ });
260
+ const guildMemberRemove$2 = (member) => ({
261
+ userId: member.user.id,
262
+ joinedAt: member.joinedTimestamp
263
+ });
264
+ const guildBanAdd$2 = (ban) => ({ reason: ban.reason ?? null });
265
+ const guildBanRemove$2 = (ban) => ({ reason: ban.reason ?? null });
266
+
267
+ //#endregion
268
+ //#region src/lib/description/events/guild/resources/events.guild-scope-bodies.ts
269
+ const guildScheduledEventCreate$2 = (event) => ({
270
+ type: event.entityType,
271
+ name: event.name,
272
+ createdAt: event.createdTimestamp
273
+ });
274
+ const guildScheduledEventUpdate$2 = (previous, current) => ({ ...previous !== null && computeUpdates(previous, current) });
275
+ const guildScheduledEventDelete$2 = (event) => ({
276
+ type: event.entityType,
277
+ name: event.name,
278
+ createdAt: event.createdTimestamp
279
+ });
280
+ const guildScheduledEventUserAdd$2 = (event, _user) => ({
281
+ event: event.name,
282
+ createdAt: event.createdTimestamp
283
+ });
284
+ const guildScheduledEventUserRemove$2 = (event, _user) => ({
285
+ event: event.name,
286
+ createdAt: event.createdTimestamp
287
+ });
288
+
289
+ //#endregion
290
+ //#region src/lib/description/events/guild/resources/expressions.guild-scope-bodies.ts
291
+ const guildSoundboardSoundCreate$2 = (sound) => ({
292
+ name: sound.name,
293
+ createdAt: sound.createdTimestamp
294
+ });
295
+ const guildSoundboardSoundUpdate$2 = (previous, current) => ({ ...previous !== null && computeUpdates(previous, current) });
296
+ const guildSoundboardSoundDelete$2 = (sound) => ({
297
+ name: sound.name,
298
+ createdAt: sound.createdTimestamp
299
+ });
300
+ const emojiCreate$2 = (emoji) => ({
301
+ name: emoji.name,
302
+ emoji: emoji.toString(),
303
+ createdAt: emoji.createdTimestamp
304
+ });
305
+ const emojiUpdate$2 = (previous, current) => computeUpdates(previous, current);
306
+ const emojiDelete$2 = (emoji) => ({
307
+ name: emoji.name,
308
+ emoji: emoji.toString(),
309
+ createdAt: emoji.createdTimestamp
310
+ });
311
+ const stickerCreate$2 = (sticker) => ({
312
+ name: sticker.name,
313
+ format: sticker.format,
314
+ createdAt: sticker.createdTimestamp
315
+ });
316
+ const stickerUpdate$2 = (previous, current) => computeUpdates(previous, current);
317
+ const stickerDelete$2 = (sticker) => ({
318
+ name: sticker.name,
319
+ format: sticker.format,
320
+ createdAt: sticker.createdTimestamp
321
+ });
322
+
323
+ //#endregion
324
+ //#region src/lib/description/events/guild/resources/invites.guild-scope-bodies.ts
325
+ const inviteCreate$2 = (invite) => ({
326
+ type: invite.type,
327
+ createdAt: invite.createdTimestamp,
328
+ expiresAt: invite.expiresTimestamp
329
+ });
330
+ const inviteDelete$2 = (invite) => ({
331
+ type: invite.type,
332
+ createdAt: invite.createdTimestamp,
333
+ expiresAt: invite.expiresTimestamp
334
+ });
335
+
336
+ //#endregion
337
+ //#region src/lib/description/events/guild/resources/logs.guild-scope-bodies.ts
338
+ const guildAuditLogEntryCreate$2 = (entry, _guild) => ({
339
+ event: entry.action,
340
+ action: entry.actionType,
341
+ createdAt: entry.createdTimestamp
342
+ });
343
+
344
+ //#endregion
345
+ //#region src/lib/description/events/guild/resources/roles.guild-scope-bodies.ts
346
+ const roleCreate$2 = (role) => ({
347
+ name: role.name,
348
+ createdAt: role.createdTimestamp
349
+ });
350
+ const roleUpdate$2 = (previous, current) => ({
351
+ ...computeUpdates(previous, current),
352
+ ...computeUpdates(previous.permissions, current.permissions, { permissions: "bitfield" }, { excludeDefaults: true })
353
+ });
354
+ const roleDelete$2 = (role) => ({
355
+ name: role.name,
356
+ createdAt: role.createdTimestamp
357
+ });
358
+
359
+ //#endregion
360
+ //#region src/lib/description/events/message/lifecycle.message-scope-bodies.ts
361
+ const messageCreate$2 = (message) => ({
362
+ content: message.content,
363
+ type: message.type,
364
+ nonce: message.nonce,
365
+ userId: message.author.id
366
+ });
367
+ const messageUpdate$2 = (previous, current) => ({
368
+ ...computeUpdates(previous, current),
369
+ ...computeUpdates(previous.mentions, current.mentions),
370
+ ...computeUpdates({
371
+ reactions: previous.reactions.cache.size,
372
+ attachments: previous.attachments.size
373
+ }, {
374
+ reactions: current.reactions.cache.size,
375
+ attachments: current.attachments.size
376
+ })
377
+ });
378
+ const messageDelete$2 = (message) => ({
379
+ content: message.content ?? null,
380
+ type: message.type,
381
+ nonce: message.nonce,
382
+ userId: message.author?.id ?? null
383
+ });
384
+
385
+ //#endregion
386
+ //#region src/lib/description/events/message/polls.message-scope-bodies.ts
387
+ const messagePollVoteAdd$2 = (answer) => ({
388
+ text: answer.text?.substring(0, 7) ?? null,
389
+ multichoice: answer.poll.allowMultiselect
390
+ });
391
+ const messagePollVoteRemove$2 = (answer) => ({
392
+ text: answer.text?.substring(0, 7) ?? null,
393
+ multichoice: answer.poll.allowMultiselect
394
+ });
395
+
396
+ //#endregion
397
+ //#region src/lib/description/events/message/reactions.message-scope-bodies.ts
398
+ const messageReactionAdd$2 = (reaction) => ({
399
+ reactions: reaction.count,
400
+ animated: reaction.emoji.animated
401
+ });
402
+ const messageReactionRemove$2 = (reaction) => ({
403
+ reactions: reaction.count,
404
+ animated: reaction.emoji.animated
405
+ });
406
+ const messageReactionRemoveAll$2 = (_message, reactions) => ({ size: reactions.size });
407
+ const messageReactionRemoveEmoji$2 = (reaction) => ({
408
+ reactions: reaction.count,
409
+ animated: reaction.emoji.animated
410
+ });
411
+
412
+ //#endregion
413
+ //#region src/lib/description/events/thread/lifecycle.thread-scope-bodies.ts
414
+ const threadCreate$2 = (thread, _newlyCreated) => ({
415
+ name: thread.name,
416
+ type: thread.type,
417
+ ownerId: thread.ownerId
418
+ });
419
+ const threadUpdate$2 = (previous, current) => computeUpdates(previous, current);
420
+ const threadDelete$2 = (thread) => ({
421
+ name: thread.name,
422
+ type: thread.type,
423
+ ownerId: thread.ownerId
424
+ });
425
+
426
+ //#endregion
427
+ //#region src/lib/description/events/thread/members.thread-scope-bodies.ts
428
+ const threadMembersUpdate$2 = (added, removed, thread) => ({
429
+ added: added.size,
430
+ removed: removed.size,
431
+ members: thread.members.cache.size
432
+ });
433
+
434
+ //#endregion
435
+ //#region src/lib/description/event-body.ts
436
+ const BodyMap = {
437
+ cacheSweep: cacheSweep$2,
438
+ debug: debug$2,
439
+ entitlementCreate: entitlementCreate$2,
440
+ entitlementDelete: entitlementDelete$2,
441
+ entitlementUpdate: entitlementUpdate$2,
442
+ error: error$2,
443
+ guildAvailable: guildAvailable$2,
444
+ guildCreate: guildCreate$2,
445
+ guildDelete: guildDelete$2,
446
+ guildMemberAvailable: guildMemberAvailable$2,
447
+ guildMembersChunk: guildMembersChunk$2,
448
+ guildUnavailable: guildUnavailable$2,
449
+ interactionCreate: interactionCreate$2,
450
+ invalidated: invalidated$2,
451
+ presenceUpdate: presenceUpdate$2,
452
+ ready: ready$2,
453
+ shardDisconnect: shardDisconnect$2,
454
+ shardError: shardError$2,
455
+ shardReady: shardReady$2,
456
+ shardReconnecting: shardReconnecting$2,
457
+ shardResume: shardResume$2,
458
+ soundboardSounds: soundboardSounds$2,
459
+ subscriptionCreate: subscriptionCreate$2,
460
+ subscriptionDelete: subscriptionDelete$2,
461
+ subscriptionUpdate: subscriptionUpdate$2,
462
+ threadListSync: threadListSync$2,
463
+ threadMemberUpdate: threadMemberUpdate$2,
464
+ userUpdate: userUpdate$2,
465
+ warn: warn$2,
466
+ channelCreate: channelCreate$2,
467
+ channelDelete: channelDelete$2,
468
+ channelPinsUpdate: channelPinsUpdate$2,
469
+ channelUpdate: channelUpdate$2,
470
+ messageDeleteBulk: messageDeleteBulk$2,
471
+ stageInstanceCreate: stageInstanceCreate$2,
472
+ stageInstanceDelete: stageInstanceDelete$2,
473
+ stageInstanceUpdate: stageInstanceUpdate$2,
474
+ typingStart: typingStart$2,
475
+ voiceChannelEffectSend: voiceChannelEffectSend$2,
476
+ voiceStateUpdate: voiceStateUpdate$2,
477
+ webhooksUpdate: webhooksUpdate$2,
478
+ webhookUpdate: webhookUpdate$2,
479
+ messageCreate: messageCreate$2,
480
+ messageDelete: messageDelete$2,
481
+ messagePollVoteAdd: messagePollVoteAdd$2,
482
+ messagePollVoteRemove: messagePollVoteRemove$2,
483
+ messageReactionAdd: messageReactionAdd$2,
484
+ messageReactionRemove: messageReactionRemove$2,
485
+ messageReactionRemoveAll: messageReactionRemoveAll$2,
486
+ messageReactionRemoveEmoji: messageReactionRemoveEmoji$2,
487
+ messageUpdate: messageUpdate$2,
488
+ threadCreate: threadCreate$2,
489
+ threadDelete: threadDelete$2,
490
+ threadMembersUpdate: threadMembersUpdate$2,
491
+ threadUpdate: threadUpdate$2,
492
+ applicationCommandPermissionsUpdate: applicationCommandPermissionsUpdate$2,
493
+ autoModerationActionExecution: autoModerationActionExecution$2,
494
+ autoModerationRuleCreate: autoModerationRuleCreate$2,
495
+ autoModerationRuleDelete: autoModerationRuleDelete$2,
496
+ autoModerationRuleUpdate: autoModerationRuleUpdate$2,
497
+ guildIntegrationsUpdate: guildIntegrationsUpdate$2,
498
+ guildUpdate: guildUpdate$2,
499
+ guildBanAdd: guildBanAdd$2,
500
+ guildBanRemove: guildBanRemove$2,
501
+ guildMemberAdd: guildMemberAdd$2,
502
+ guildMemberRemove: guildMemberRemove$2,
503
+ guildMemberUpdate: guildMemberUpdate$2,
504
+ guildAuditLogEntryCreate: guildAuditLogEntryCreate$2,
505
+ inviteCreate: inviteCreate$2,
506
+ inviteDelete: inviteDelete$2,
507
+ roleCreate: roleCreate$2,
508
+ roleDelete: roleDelete$2,
509
+ roleUpdate: roleUpdate$2,
510
+ emojiCreate: emojiCreate$2,
511
+ emojiDelete: emojiDelete$2,
512
+ emojiUpdate: emojiUpdate$2,
513
+ guildSoundboardSoundCreate: guildSoundboardSoundCreate$2,
514
+ guildSoundboardSoundDelete: guildSoundboardSoundDelete$2,
515
+ guildSoundboardSoundUpdate: guildSoundboardSoundUpdate$2,
516
+ stickerCreate: stickerCreate$2,
517
+ stickerDelete: stickerDelete$2,
518
+ stickerUpdate: stickerUpdate$2,
519
+ guildScheduledEventCreate: guildScheduledEventCreate$2,
520
+ guildScheduledEventDelete: guildScheduledEventDelete$2,
521
+ guildScheduledEventUpdate: guildScheduledEventUpdate$2,
522
+ guildScheduledEventUserAdd: guildScheduledEventUserAdd$2,
523
+ guildScheduledEventUserRemove: guildScheduledEventUserRemove$2
524
+ };
525
+
526
+ //#endregion
527
+ //#region src/lib/description/utils/components.ts
528
+ const UNKNOWN = "?";
529
+ function maybeUnknown(value) {
530
+ return value ?? UNKNOWN;
531
+ }
532
+ let ProducerKind = /* @__PURE__ */ function(ProducerKind$1) {
533
+ ProducerKind$1["Gateway"] = "gateway";
534
+ ProducerKind$1["Client"] = "client";
535
+ ProducerKind$1["Actor"] = "actor";
536
+ return ProducerKind$1;
537
+ }({});
538
+ let OriginNamespace = /* @__PURE__ */ function(OriginNamespace$1) {
539
+ OriginNamespace$1["System"] = "system";
540
+ OriginNamespace$1["Guild"] = "guild";
541
+ OriginNamespace$1["User"] = "user";
542
+ OriginNamespace$1["Member"] = "member";
543
+ OriginNamespace$1["Direct"] = "direct";
544
+ OriginNamespace$1["Group"] = "group";
545
+ return OriginNamespace$1;
546
+ }({});
547
+
548
+ //#endregion
549
+ //#region src/lib/description/events/application/client.application-scope-callpoints.ts
550
+ /**
551
+ * @see https://discord.com/developers/docs/resources/guild#get-guild
552
+ */
553
+ const guildAvailable$1 = (guild) => ({
554
+ shard: guild.shardId,
555
+ location: `/guilds/${guild.id}`
556
+ });
557
+ /**
558
+ * @see https://discord.com/developers/docs/resources/guild#get-guild
559
+ */
560
+ const guildUnavailable$1 = (guild) => ({
561
+ shard: guild.shardId,
562
+ location: `/guilds/${guild.id}`
563
+ });
564
+ /**
565
+ * @see https://discord.com/developers/docs/resources/guild#get-guild-member
566
+ */
567
+ const guildMemberAvailable$1 = (member) => ({
568
+ shard: member.guild.shardId,
569
+ location: `/guilds/${member.guild.id}/members/${member.id}`
570
+ });
571
+ /**
572
+ * @see https://discord.com/developers/docs/resources/guild#list-guild-members
573
+ */
574
+ const guildMembersChunk$1 = (_members, guild, _chunk) => ({
575
+ shard: guild.shardId,
576
+ location: `/guilds/${guild.id}/members`
577
+ });
578
+ /**
579
+ * @see https://discord.com/developers/docs/resources/channel#get-thread-member
580
+ */
581
+ const threadMemberUpdate$1 = (_previous, current) => ({
582
+ shard: maybeUnknown(current.guildMember?.guild.shardId),
583
+ location: `/channels/${current.thread.id}/thread-members/${current.id}`
584
+ });
585
+ /**
586
+ * @see https://discord.com/developers/docs/topics/threads#enumerating-threads
587
+ */
588
+ const threadListSync$1 = (_threads, guild) => ({
589
+ shard: guild.shardId,
590
+ location: `/guilds/${guild.id}/threads`
591
+ });
592
+ /**
593
+ * @see https://discord.com/developers/docs/resources/soundboard#list-guild-soundboard-sounds
594
+ */
595
+ const soundboardSounds$1 = (_soundboardSounds, guild) => ({
596
+ shard: guild.shardId,
597
+ location: `/guilds/${guild.id}/soundboard-sounds`
598
+ });
599
+ const cacheSweep$1 = (_message) => ({
600
+ shard: UNKNOWN,
601
+ location: `/client/cache`
602
+ });
603
+ const invalidated$1 = () => ({
604
+ shard: UNKNOWN,
605
+ location: `/client/state`
606
+ });
607
+
608
+ //#endregion
609
+ //#region src/lib/description/events/application/gateway.application-scope-callpoints.ts
610
+ /**
611
+ * @remarks No counterpart on the Discord REST api.
612
+ */
613
+ const ready$1 = (_client) => ({
614
+ shard: UNKNOWN,
615
+ location: "/client"
616
+ });
617
+ /**
618
+ * @remarks No counterpart on the Discord REST api.
619
+ */
620
+ const error$1 = (_error) => ({
621
+ shard: UNKNOWN,
622
+ location: "/client"
623
+ });
624
+ /**
625
+ * @remarks No counterpart on the Discord REST api.
626
+ */
627
+ const warn$1 = (_message) => ({
628
+ shard: UNKNOWN,
629
+ location: "/client"
630
+ });
631
+ /**
632
+ * @remarks No counterpart on the Discord REST api.
633
+ */
634
+ const debug$1 = (_message) => ({
635
+ shard: UNKNOWN,
636
+ location: "/client"
637
+ });
638
+ /**
639
+ * @remarks No counterpart on the Discord REST api.
640
+ */
641
+ const shardReady$1 = (shard, _unavailableGuilds) => ({
642
+ shard,
643
+ location: "/client/shards"
644
+ });
645
+ /**
646
+ * @remarks No counterpart on the Discord REST api.
647
+ */
648
+ const shardError$1 = (_error, shard) => ({
649
+ shard,
650
+ location: "/client/shards"
651
+ });
652
+ /**
653
+ * @remarks No counterpart on the Discord REST api.
654
+ */
655
+ const shardResume$1 = (shard, _replayuedEvents) => ({
656
+ shard,
657
+ location: "/client/shards"
658
+ });
659
+ /**
660
+ * @remarks No counterpart on the Discord REST api.
661
+ */
662
+ const shardDisconnect$1 = (_closeEvent, shard) => ({
663
+ shard,
664
+ location: "/client/shards"
665
+ });
666
+ /**
667
+ * @remarks No counterpart on the Discord REST api.
668
+ */
669
+ const shardReconnecting$1 = (shard) => ({
670
+ shard,
671
+ location: "/client/shards"
672
+ });
673
+ /**
674
+ * @remarks No counterpart on the Discord REST api.
675
+ */
676
+ const userUpdate$1 = (_previous, current) => ({
677
+ shard: UNKNOWN,
678
+ location: `/users/${current.id}`
679
+ });
680
+ /**
681
+ * @remarks No counterpart on the Discord REST api.
682
+ *
683
+ * @see https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response
684
+ */
685
+ const interactionCreate$1 = (interaction) => ({
686
+ shard: maybeUnknown(interaction.guild?.shardId),
687
+ location: `/interactions`
688
+ });
689
+ /**
690
+ * @remarks No counterpart on the Discord REST api.
691
+ */
692
+ const presenceUpdate$1 = (_previous, presence) => ({
693
+ shard: maybeUnknown(presence.guild?.shardId),
694
+ location: "/presences"
695
+ });
696
+
697
+ //#endregion
698
+ //#region src/lib/description/events/application/installations.application-scope-callpoints.ts
699
+ /**
700
+ * @see https://discord.com/developers/docs/resources/guild#get-guild
701
+ */
702
+ const guildCreate$1 = (guild) => ({
703
+ shard: guild.shardId,
704
+ location: `/guilds`
705
+ });
706
+ /**
707
+ * @see https://discord.com/developers/docs/resources/guild#get-guild
708
+ */
709
+ const guildDelete$1 = (guild) => ({
710
+ shard: guild.shardId,
711
+ location: `/guilds`
712
+ });
713
+ /**
714
+ * @remarks REST Api has no endpoint for non-test entitlements, thus we use the test one for the schema.
715
+ *
716
+ * @see https://discord.com/developers/docs/resources/entitlement#create-test-entitlement
717
+ */
718
+ const entitlementCreate$1 = (entitlement) => ({
719
+ shard: maybeUnknown(entitlement.guild?.shardId),
720
+ location: `/applications/${entitlement.applicationId}/entitlements`
721
+ });
722
+ /**
723
+ * @remarks REST Api has no endpoint for non-test entitlements, thus we use the test one for the schema.
724
+ *
725
+ * @see https://discord.com/developers/docs/resources/entitlement#delete-test-entitlement
726
+ */
727
+ const entitlementUpdate$1 = (_previous, current) => ({
728
+ shard: maybeUnknown(current.guild?.shardId),
729
+ location: `/applications/${current.applicationId}/entitlements/${current.id}`
730
+ });
731
+ /**
732
+ * @remarks REST Api has no endpoint for non-test entitlements, thus we use the test one for the schema.
733
+ *
734
+ * @see https://discord.com/developers/docs/resources/entitlement#delete-test-entitlement
735
+ */
736
+ const entitlementDelete$1 = (entitlement) => ({
737
+ shard: maybeUnknown(entitlement.guild?.shardId),
738
+ location: `/applications/${entitlement.applicationId}/entitlements/${entitlement.id}`
739
+ });
740
+ /**
741
+ * @remarks REST Api has no endpoint for subscription stuff other than bare fetching, thus we extend/branch off the Entitlements Test Endpoints.
742
+ *
743
+ * @see https://discord.com/developers/docs/resources/entitlement#create-test-entitlement
744
+ */
745
+ const subscriptionCreate$1 = (subscription) => ({
746
+ shard: UNKNOWN,
747
+ location: `/applications/${subscription.client.application.id}/subscriptions`
748
+ });
749
+ /**
750
+ * @remarks REST Api has no endpoint for subscription stuff other than bare fetching, thus we extend/branch off the Entitlements Test Endpoints.
751
+ *
752
+ * @see https://discord.com/developers/docs/resources/entitlement#delete-test-entitlement
753
+ */
754
+ const subscriptionUpdate$1 = (_previous, current) => ({
755
+ shard: UNKNOWN,
756
+ location: `/applications/${current.client.application.id}/subscriptions/${current.id}`
757
+ });
758
+ /**
759
+ * @remarks REST Api has no endpoint for subscription stuff other than bare fetching, thus we extend/branch off the Entitlements Test Endpoints.
760
+ *
761
+ * @see https://discord.com/developers/docs/resources/entitlement#delete-test-entitlement
762
+ */
763
+ const subscriptionDelete$1 = (subscription) => ({
764
+ shard: UNKNOWN,
765
+ location: `/applications/${subscription.client.application.id}/subscriptions/${subscription.id}`
766
+ });
767
+
768
+ //#endregion
769
+ //#region src/lib/description/events/channel/actions.channel-scope-callpoints.ts
770
+ /**
771
+ * @see https://discord.com/developers/docs/resources/channel#trigger-typing-indicator
772
+ */
773
+ const typingStart$1 = (typing) => ({
774
+ shard: maybeUnknown(typing.guild?.shardId),
775
+ location: `/channels/${typing.channel.id}/typing`
776
+ });
777
+ /**
778
+ * @see https://discord.com/developers/docs/resources/message#bulk-delete-messages
779
+ */
780
+ const messageDeleteBulk$1 = (_previous, current) => ({
781
+ shard: current.guild.shardId,
782
+ location: `/channels/${current.id}/messages/bulk-delete`
783
+ });
784
+ /**
785
+ * @see https://discord.com/developers/docs/resources/message#get-channel-pins
786
+ */
787
+ const channelPinsUpdate$1 = (channel, _date) => ({
788
+ shard: maybeUnknown(channel?.guild?.shardId),
789
+ location: `/channels/${channel.id}/messages/pins`
790
+ });
791
+
792
+ //#endregion
793
+ //#region src/lib/description/events/channel/lifecycle.channel-scope-callpoints.ts
794
+ /**
795
+ * @see https://discord.com/developers/docs/resources/message#get-channel-pins
796
+ */
797
+ const channelCreate$1 = (channel) => ({
798
+ shard: channel.guild.shardId,
799
+ location: "/channels"
800
+ });
801
+ /**
802
+ * @see https://discord.com/developers/docs/resources/channel#modify-channel
803
+ */
804
+ const channelUpdate$1 = (_previous, current) => ({
805
+ shard: maybeUnknown(current?.guild.shardId),
806
+ location: `/channels/${current.id}`
807
+ });
808
+ /**
809
+ * @see https://discord.com/developers/docs/resources/channel#deleteclose-channel
810
+ */
811
+ const channelDelete$1 = (channel) => ({
812
+ shard: maybeUnknown(channel?.guild.shardId),
813
+ location: `/channels/${channel.id}`
814
+ });
815
+
816
+ //#endregion
817
+ //#region src/lib/description/events/channel/stage.channel-scope-callpoints.ts
818
+ /**
819
+ * @see https://discord.com/developers/docs/resources/stage-instance#create-stage-instance
820
+ */
821
+ const stageInstanceCreate$1 = (instance) => ({
822
+ shard: maybeUnknown(instance.guild?.shardId),
823
+ location: `/stage-instances`
824
+ });
825
+ /**
826
+ * @see https://discord.com/developers/docs/resources/stage-instance#modify-stage-instance
827
+ */
828
+ const stageInstanceUpdate$1 = (_previous, current) => ({
829
+ shard: maybeUnknown(current.guild?.shardId),
830
+ location: `/stage-instances/${current.channelId}`
831
+ });
832
+ /**
833
+ * @see https://discord.com/developers/docs/resources/stage-instance#delete-stage-instance
834
+ */
835
+ const stageInstanceDelete$1 = (instance) => ({
836
+ shard: maybeUnknown(instance.guild?.shardId),
837
+ location: `/stage-instances/${instance.channelId}`
838
+ });
839
+
840
+ //#endregion
841
+ //#region src/lib/description/events/channel/voice.channel-scope-callpoints.ts
842
+ /**
843
+ * @see https://discord.com/developers/docs/resources/voice#modify-user-voice-state
844
+ */
845
+ const voiceStateUpdate$1 = (_previous, current) => ({
846
+ shard: current.guild.shardId,
847
+ location: `/guilds/${current.guild.id}/voice-states/${current.member?.id}`
848
+ });
849
+ /**
850
+ * @remarks No counterpart on the Discord REST api.
851
+ */
852
+ const voiceChannelEffectSend$1 = (effect) => ({
853
+ shard: effect.guild.shardId,
854
+ location: `/guilds/${effect.guild.id}/voice-effects/${effect.userId}`
855
+ });
856
+
857
+ //#endregion
858
+ //#region src/lib/description/events/channel/webhook.channel-scope-callpoints.ts
859
+ /**
860
+ * @see https://discord.com/developers/docs/resources/webhook#get-channel-webhooks
861
+ */
862
+ const webhookUpdate$1 = (channel) => ({
863
+ shard: channel.guild.shardId,
864
+ location: `/channels/${channel.id}/webhooks`
865
+ });
866
+ /**
867
+ * @see https://discord.com/developers/docs/resources/webhook#get-channel-webhooks
868
+ */
869
+ const webhooksUpdate$1 = (channel) => ({
870
+ shard: channel.guild.shardId,
871
+ location: `/channels/${channel.id}/webhooks`
872
+ });
873
+
874
+ //#endregion
875
+ //#region src/lib/description/events/guild/configuration.guild-scope-callpoints.ts
876
+ /**
877
+ * @remarks Cannot parse any integration-specific information without fetching
878
+ *
879
+ * @see https://discord.com/developers/docs/resources/guild#get-guild-integrations
880
+ */
881
+ const guildIntegrationsUpdate$1 = (guild) => ({
882
+ shard: guild.shardId,
883
+ location: `/guilds/${guild.id}/integrations/${UNKNOWN}`
884
+ });
885
+ /**
886
+ * @see https://discord.com/developers/docs/interactions/application-commands#edit-application-command-permissions
887
+ */
888
+ const applicationCommandPermissionsUpdate$1 = (data) => ({
889
+ shard: UNKNOWN,
890
+ location: `/guilds/${data.guildId}/applications/${data.applicationId}/commands/${data.id}/permissions`
891
+ });
892
+ /**
893
+ * @see https://discord.com/developers/docs/resources/guild#modify-guild
894
+ */
895
+ const guildUpdate$1 = (_previous, current) => ({
896
+ shard: current.shardId,
897
+ location: `/guilds/${current.id}`
898
+ });
899
+ /**
900
+ * @see https://discord.com/developers/docs/resources/auto-moderation#create-auto-moderation-rule
901
+ */
902
+ const autoModerationRuleCreate$1 = (rule) => ({
903
+ shard: rule.guild.shardId,
904
+ location: `/guilds/${rule.guild.id}/auto-moderation/rules`
905
+ });
906
+ /**
907
+ * @see https://discord.com/developers/docs/resources/auto-moderation#modify-auto-moderation-rule
908
+ */
909
+ const autoModerationRuleUpdate$1 = (_previous, current) => ({
910
+ shard: current.guild.shardId,
911
+ location: `/guilds/${current.guild.id}/auto-moderation/rules/${current.id}`
912
+ });
913
+ /**
914
+ * @see https://discord.com/developers/docs/resources/auto-moderation#delete-auto-moderation-rule
915
+ */
916
+ const autoModerationRuleDelete$1 = (rule) => ({
917
+ shard: rule.guild.shardId,
918
+ location: `/guilds/${rule.guild.id}/auto-moderation/rules/${rule.id}`
919
+ });
920
+ /**
921
+ * @see https://discord.com/developers/docs/resources/auto-moderation#get-auto-moderation-rule
922
+ */
923
+ const autoModerationActionExecution$1 = (execution) => ({
924
+ shard: execution.guild.shardId,
925
+ location: `/guilds/${execution.guild.id}/auto-moderation/rules/${execution.ruleId}`
926
+ });
927
+
928
+ //#endregion
929
+ //#region src/lib/description/events/guild/members.guild-scope-callpoints.ts
930
+ /**
931
+ * @see https://discord.com/developers/docs/resources/guild#add-guild-member
932
+ */
933
+ const guildMemberAdd$1 = (member) => ({
934
+ shard: member.guild.shardId,
935
+ location: `/guilds/${member.guild.id}/members/${member.id}`
936
+ });
937
+ /**
938
+ * @see https://discord.com/developers/docs/resources/guild#modify-guild-member
939
+ */
940
+ const guildMemberUpdate$1 = (_previous, current) => ({
941
+ shard: current.guild.shardId,
942
+ location: `/guilds/${current.guild.id}/members/${current.id}`
943
+ });
944
+ /**
945
+ * @see https://discord.com/developers/docs/resources/guild#remove-guild-member
946
+ */
947
+ const guildMemberRemove$1 = (member) => ({
948
+ shard: member.guild.shardId,
949
+ location: `/guilds/${member.guild.id}/members/${member.id}`
950
+ });
951
+ /**
952
+ * @see https://discord.com/developers/docs/resources/guild#create-guild-ban
953
+
954
+ */
955
+ const guildBanAdd$1 = (ban) => ({
956
+ shard: ban.guild.shardId,
957
+ location: `/guilds/${ban.guild.id}/bans/${ban.user.id}`
958
+ });
959
+ /**
960
+ * @see https://discord.com/developers/docs/resources/guild#remove-guild-ban
961
+ */
962
+ const guildBanRemove$1 = (ban) => ({
963
+ shard: ban.guild.shardId,
964
+ location: `/guilds/${ban.guild.id}/bans/${ban.user.id}`
965
+ });
966
+
967
+ //#endregion
968
+ //#region src/lib/description/events/guild/resources/events.guild-scope-callpoints.ts
969
+ /**
970
+ * @see https://discord.com/developers/docs/resources/guild-scheduled-event#create-guild-scheduled-event
971
+ */
972
+ const guildScheduledEventCreate$1 = (event) => ({
973
+ shard: maybeUnknown(event.guild?.shardId),
974
+ location: `/guilds/${event.guildId}/scheduled-events`
975
+ });
976
+ /**
977
+ * @see https://discord.com/developers/docs/resources/guild-scheduled-event#modify-guild-scheduled-event
978
+ */
979
+ const guildScheduledEventUpdate$1 = (_previous, current) => ({
980
+ shard: maybeUnknown(current.guild?.shardId),
981
+ location: `/guilds/${current.guildId}/scheduled-events/${current.id}`
982
+ });
983
+ /**
984
+ * @see https://discord.com/developers/docs/resources/guild-scheduled-event#delete-guild-scheduled-event
985
+ */
986
+ const guildScheduledEventDelete$1 = (event) => ({
987
+ shard: maybeUnknown(event.guild?.shardId),
988
+ location: `/guilds/${event.guildId}/scheduled-events/${event.id}`
989
+ });
990
+ /**
991
+ * @see https://discord.com/developers/docs/resources/guild-scheduled-event#get-guild-scheduled-event-users
992
+ */
993
+ const guildScheduledEventUserAdd$1 = (event, _user) => ({
994
+ shard: maybeUnknown(event.guild?.shardId),
995
+ location: `/guilds/${event.guildId}/scheduled-events/${event.id}/users`
996
+ });
997
+ /**
998
+ * @see https://discord.com/developers/docs/resources/guild-scheduled-event#get-guild-scheduled-event-users
999
+ */
1000
+ const guildScheduledEventUserRemove$1 = (event, _user) => ({
1001
+ shard: maybeUnknown(event.guild?.shardId),
1002
+ location: `/guilds/${event.guildId}/scheduled-events/${event.id}/users`
1003
+ });
1004
+
1005
+ //#endregion
1006
+ //#region src/lib/description/events/guild/resources/expressions.guild-scope-callpoints.ts
1007
+ /**
1008
+ * @see https://discord.com/developers/docs/resources/soundboard#create-guild-soundboard-sound
1009
+ */
1010
+ const guildSoundboardSoundCreate$1 = (sound) => ({
1011
+ shard: maybeUnknown(sound.guild?.shardId),
1012
+ location: `/guilds/${maybeUnknown(sound.guildId)}/soundboard-sounds`
1013
+ });
1014
+ /**
1015
+ * @see https://discord.com/developers/docs/resources/soundboard#modify-guild-soundboard-sound
1016
+ */
1017
+ const guildSoundboardSoundUpdate$1 = (_previous, current) => ({
1018
+ shard: maybeUnknown(current.guild?.shardId),
1019
+ location: `/guilds/${maybeUnknown(current.guildId)}/soundboard-sounds/${current.soundId}`
1020
+ });
1021
+ /**
1022
+ * @see https://discord.com/developers/docs/resources/soundboard#delete-guild-soundboard-sound
1023
+ */
1024
+ const guildSoundboardSoundDelete$1 = (sound) => ({
1025
+ shard: maybeUnknown(sound.guild?.shardId),
1026
+ location: `/guilds/${maybeUnknown(sound.guildId)}/soundboard-sounds/${sound.soundId}`
1027
+ });
1028
+ /**
1029
+ * @see https://discord.com/developers/docs/resources/emoji#create-guild-emoji
1030
+ */
1031
+ const emojiCreate$1 = (emoji) => ({
1032
+ shard: emoji.guild.shardId,
1033
+ location: `/guilds/${emoji.guild.id}/emojis`
1034
+ });
1035
+ /**
1036
+ * @see https://discord.com/developers/docs/resources/emoji#modify-guild-emoji
1037
+ */
1038
+ const emojiUpdate$1 = (_, emoji) => ({
1039
+ shard: emoji.guild.shardId,
1040
+ location: `/guilds/${emoji.guild.id}/emojis/${emoji.id}`
1041
+ });
1042
+ /**
1043
+ * @see https://discord.com/developers/docs/resources/emoji#delete-guild-emoji
1044
+ */
1045
+ const emojiDelete$1 = (emoji) => ({
1046
+ shard: emoji.guild.shardId,
1047
+ location: `/guilds/${emoji.guild.id}/emojis/${emoji.id}`
1048
+ });
1049
+ /**
1050
+ * @see https://discord.com/developers/docs/resources/sticker#create-guild-sticker
1051
+ */
1052
+ const stickerCreate$1 = (sticker) => ({
1053
+ shard: maybeUnknown(sticker.guild?.shardId),
1054
+ location: `/guilds/${maybeUnknown(sticker.guild?.shardId)}/stickers`
1055
+ });
1056
+ /**
1057
+ * @see https://discord.com/developers/docs/resources/sticker#modify-guild-sticker
1058
+ */
1059
+ const stickerUpdate$1 = (_previous, current) => ({
1060
+ shard: maybeUnknown(current.guild?.shardId),
1061
+ location: `/guilds/${maybeUnknown(current.guild?.shardId)}/stickers/${current.id}`
1062
+ });
1063
+ /**
1064
+ * @see https://discord.com/developers/docs/resources/sticker#delete-guild-sticker
1065
+ */
1066
+ const stickerDelete$1 = (sticker) => ({
1067
+ shard: maybeUnknown(sticker.guild?.shardId),
1068
+ location: `/guilds/${maybeUnknown(sticker.guild?.shardId)}/stickers/${sticker.id}`
1069
+ });
1070
+
1071
+ //#endregion
1072
+ //#region src/lib/description/events/guild/resources/invites.guild-scope-callpoints.ts
1073
+ /**
1074
+ * @see https://discord.com/developers/docs/resources/guild#get-guild-invites
1075
+ */
1076
+ const inviteCreate$1 = (invite) => invite.guild !== null ? {
1077
+ shard: maybeUnknown(invite.guild?.shardId),
1078
+ location: `/guilds/${invite.guild.id}/invites`
1079
+ } : {
1080
+ shard: UNKNOWN,
1081
+ location: `/groups/${maybeUnknown(invite.channelId)}/invites`
1082
+ };
1083
+ /**
1084
+ * @see https://discord.com/developers/docs/resources/invite#delete-invite
1085
+ */
1086
+ const inviteDelete$1 = (invite) => ({
1087
+ shard: maybeUnknown(invite.guild?.shardId),
1088
+ location: `/invites/${invite.code}`
1089
+ });
1090
+
1091
+ //#endregion
1092
+ //#region src/lib/description/events/guild/resources/logs.guild-scope-callpoints.ts
1093
+ /**
1094
+ * @see https://discord.com/developers/docs/resources/audit-log#get-guild-audit-log
1095
+ */
1096
+ const guildAuditLogEntryCreate$1 = (_entry, guild) => ({
1097
+ shard: guild.shardId,
1098
+ location: `/guilds/${guild.id}/audit-logs`
1099
+ });
1100
+
1101
+ //#endregion
1102
+ //#region src/lib/description/events/guild/resources/roles.guild-scope-callpoints.ts
1103
+ /**
1104
+ * @see https://discord.com/developers/docs/resources/guild#create-guild-role
1105
+ */
1106
+ const roleCreate$1 = (role) => ({
1107
+ shard: role.guild.shardId,
1108
+ location: `/guilds/${role.guild.id}/roles`
1109
+ });
1110
+ /**
1111
+ * @see https://discord.com/developers/docs/resources/guild#modify-guild-role
1112
+ */
1113
+ const roleUpdate$1 = (_previous, current) => ({
1114
+ shard: current.guild.shardId,
1115
+ location: `/guilds/${current.guild.id}/roles/${current.id}`
1116
+ });
1117
+ /**
1118
+ * @see https://discord.com/developers/docs/resources/guild#delete-guild-role
1119
+ */
1120
+ const roleDelete$1 = (role) => ({
1121
+ shard: role.guild.shardId,
1122
+ location: `/guilds/${role.guild.id}/roles/${role.id}`
1123
+ });
1124
+
1125
+ //#endregion
1126
+ //#region src/lib/description/events/message/lifecycle.message-scope-callpoints.ts
1127
+ /**
1128
+ * @see https://discord.com/developers/docs/resources/message#create-message
1129
+ */
1130
+ const messageCreate$1 = (message) => ({
1131
+ shard: maybeUnknown(message.guild?.shardId),
1132
+ location: `/channels/${message.channelId}/messages`
1133
+ });
1134
+ /**
1135
+ * @see https://discord.com/developers/docs/resources/message#edit-message
1136
+ */
1137
+ const messageUpdate$1 = (_previous, current) => ({
1138
+ shard: maybeUnknown(current.guild?.shardId),
1139
+ location: `/channels/${current.channelId}/messages/${current.id}`
1140
+ });
1141
+ /**
1142
+ * @see https://discord.com/developers/docs/resources/message#delete-message
1143
+ */
1144
+ const messageDelete$1 = (message) => ({
1145
+ shard: maybeUnknown(message.guild?.shardId),
1146
+ location: `/channels/${message.channelId}/messages/${message.id}`
1147
+ });
1148
+
1149
+ //#endregion
1150
+ //#region src/lib/description/events/message/polls.message-scope-callpoints.ts
1151
+ /**
1152
+ * @see https://discord.com/developers/docs/resources/poll#get-answer-voters
1153
+ */
1154
+ const messagePollVoteAdd$1 = (answer) => ({
1155
+ shard: maybeUnknown(answer.poll.message.guild?.shardId),
1156
+ location: `/channels/${answer.poll.message.channelId}/polls/${answer.poll.message.id}/answers/${answer.id}`
1157
+ });
1158
+ /**
1159
+ * @see https://discord.com/developers/docs/resources/poll#get-answer-voters
1160
+ */
1161
+ const messagePollVoteRemove$1 = (answer) => ({
1162
+ shard: maybeUnknown(answer.poll.message.guild?.shardId),
1163
+ location: `/channels/${answer.poll.message.channelId}/polls/${answer.poll.message.id}/answers/${answer.id}`
1164
+ });
1165
+
1166
+ //#endregion
1167
+ //#region src/lib/description/events/message/reactions.message-scope-callpoints.ts
1168
+ /**
1169
+ * @see https://discord.com/developers/docs/resources/message#create-reaction
1170
+ */
1171
+ const messageReactionAdd$1 = (reaction, _user, _details) => ({
1172
+ shard: maybeUnknown(reaction.message.channel?.guild?.shardId),
1173
+ location: `/channels/${reaction.message.channelId}/messages/${reaction.message.id}/reactions/${maybeUnknown(reaction.emoji.id)}`
1174
+ });
1175
+ /**
1176
+ * @see https://discord.com/developers/docs/resources/message#delete-user-reaction
1177
+ */
1178
+ const messageReactionRemove$1 = (reaction, user, _details) => ({
1179
+ shard: maybeUnknown(reaction.message.channel?.guild?.shardId),
1180
+ location: `/channels/${reaction.message.channelId}/messages/${reaction.message.id}/reactions/${maybeUnknown(reaction.emoji.id)}/${user.id}`
1181
+ });
1182
+ /**
1183
+ * @see https://discord.com/developers/docs/resources/message#delete-all-reactions
1184
+ */
1185
+ const messageReactionRemoveAll$1 = (message, _reactions) => ({
1186
+ shard: maybeUnknown(message.channel?.guild?.shardId),
1187
+ location: `/channels/${message.channelId}/messages/${message.id}/reactions`
1188
+ });
1189
+ /**
1190
+ * @see https://discord.com/developers/docs/resources/message#delete-all-reactions-for-emoji
1191
+ */
1192
+ const messageReactionRemoveEmoji$1 = (reaction) => ({
1193
+ shard: maybeUnknown(reaction.message.channel?.guild?.shardId),
1194
+ location: `/channels/${reaction.message.channelId}/messages/${reaction.message.id}/reactions/${maybeUnknown(reaction.emoji.id)}`
1195
+ });
1196
+
1197
+ //#endregion
1198
+ //#region src/lib/description/events/thread/lifecycle.thread-scope-callpoints.ts
1199
+ /**
1200
+ * @remarks Implementation assumes it originated on a channel and not on some message, as it cannot be differentiated without fetching.
1201
+ *
1202
+ * @see https://discord.com/developers/docs/resources/channel#start-thread-from-message
1203
+ * @see https://discord.com/developers/docs/resources/channel#start-thread-without-message
1204
+ */
1205
+ const threadCreate$1 = (thread, _newlyCreated) => ({
1206
+ shard: thread.guild.shardId,
1207
+ location: `/channels/${maybeUnknown(thread.parentId)}/threads`
1208
+ });
1209
+ /**
1210
+ * @see https://discord.com/developers/docs/resources/channel#modify-channel
1211
+ */
1212
+ const threadUpdate$1 = (_previous, current) => ({
1213
+ shard: current.guild.shardId,
1214
+ location: `/channels/${maybeUnknown(current.id)}`
1215
+ });
1216
+ /**
1217
+ * @see https://discord.com/developers/docs/resources/channel#deleteclose-channel
1218
+ */
1219
+ const threadDelete$1 = (thread) => ({
1220
+ shard: thread.guild.shardId,
1221
+ location: `/channels/${maybeUnknown(thread.id)}`
1222
+ });
1223
+
1224
+ //#endregion
1225
+ //#region src/lib/description/events/thread/members.thread-scope-callpoints.ts
1226
+ /**
1227
+ * @remarks Possible to differentiate whether the event added or removed members, but this implementation does not.
1228
+ *
1229
+ * @see https://discord.com/developers/docs/resources/channel#list-thread-members
1230
+ */
1231
+ const threadMembersUpdate$1 = (_added, _removed, thread) => ({
1232
+ shard: thread.guild.shardId,
1233
+ location: `/channels/${thread.id}/thread-members`
1234
+ });
1235
+
1236
+ //#endregion
1237
+ //#region src/lib/description/event-callpoint.ts
1238
+ const CallpointMap = {
1239
+ cacheSweep: cacheSweep$1,
1240
+ debug: debug$1,
1241
+ entitlementCreate: entitlementCreate$1,
1242
+ entitlementDelete: entitlementDelete$1,
1243
+ entitlementUpdate: entitlementUpdate$1,
1244
+ error: error$1,
1245
+ guildAvailable: guildAvailable$1,
1246
+ guildCreate: guildCreate$1,
1247
+ guildDelete: guildDelete$1,
1248
+ guildMemberAvailable: guildMemberAvailable$1,
1249
+ guildMembersChunk: guildMembersChunk$1,
1250
+ guildUnavailable: guildUnavailable$1,
1251
+ interactionCreate: interactionCreate$1,
1252
+ invalidated: invalidated$1,
1253
+ presenceUpdate: presenceUpdate$1,
1254
+ ready: ready$1,
1255
+ shardDisconnect: shardDisconnect$1,
1256
+ shardError: shardError$1,
1257
+ shardReady: shardReady$1,
1258
+ shardReconnecting: shardReconnecting$1,
1259
+ shardResume: shardResume$1,
1260
+ soundboardSounds: soundboardSounds$1,
1261
+ subscriptionCreate: subscriptionCreate$1,
1262
+ subscriptionDelete: subscriptionDelete$1,
1263
+ subscriptionUpdate: subscriptionUpdate$1,
1264
+ threadListSync: threadListSync$1,
1265
+ threadMemberUpdate: threadMemberUpdate$1,
1266
+ userUpdate: userUpdate$1,
1267
+ warn: warn$1,
1268
+ channelCreate: channelCreate$1,
1269
+ channelDelete: channelDelete$1,
1270
+ channelPinsUpdate: channelPinsUpdate$1,
1271
+ channelUpdate: channelUpdate$1,
1272
+ messageDeleteBulk: messageDeleteBulk$1,
1273
+ stageInstanceCreate: stageInstanceCreate$1,
1274
+ stageInstanceDelete: stageInstanceDelete$1,
1275
+ stageInstanceUpdate: stageInstanceUpdate$1,
1276
+ typingStart: typingStart$1,
1277
+ voiceChannelEffectSend: voiceChannelEffectSend$1,
1278
+ voiceStateUpdate: voiceStateUpdate$1,
1279
+ webhooksUpdate: webhooksUpdate$1,
1280
+ webhookUpdate: webhookUpdate$1,
1281
+ messageCreate: messageCreate$1,
1282
+ messageDelete: messageDelete$1,
1283
+ messagePollVoteAdd: messagePollVoteAdd$1,
1284
+ messagePollVoteRemove: messagePollVoteRemove$1,
1285
+ messageReactionAdd: messageReactionAdd$1,
1286
+ messageReactionRemove: messageReactionRemove$1,
1287
+ messageReactionRemoveAll: messageReactionRemoveAll$1,
1288
+ messageReactionRemoveEmoji: messageReactionRemoveEmoji$1,
1289
+ messageUpdate: messageUpdate$1,
1290
+ threadCreate: threadCreate$1,
1291
+ threadDelete: threadDelete$1,
1292
+ threadMembersUpdate: threadMembersUpdate$1,
1293
+ threadUpdate: threadUpdate$1,
1294
+ applicationCommandPermissionsUpdate: applicationCommandPermissionsUpdate$1,
1295
+ autoModerationActionExecution: autoModerationActionExecution$1,
1296
+ autoModerationRuleCreate: autoModerationRuleCreate$1,
1297
+ autoModerationRuleDelete: autoModerationRuleDelete$1,
1298
+ autoModerationRuleUpdate: autoModerationRuleUpdate$1,
1299
+ guildIntegrationsUpdate: guildIntegrationsUpdate$1,
1300
+ guildUpdate: guildUpdate$1,
1301
+ guildBanAdd: guildBanAdd$1,
1302
+ guildBanRemove: guildBanRemove$1,
1303
+ guildMemberAdd: guildMemberAdd$1,
1304
+ guildMemberRemove: guildMemberRemove$1,
1305
+ guildMemberUpdate: guildMemberUpdate$1,
1306
+ guildAuditLogEntryCreate: guildAuditLogEntryCreate$1,
1307
+ inviteCreate: inviteCreate$1,
1308
+ inviteDelete: inviteDelete$1,
1309
+ roleCreate: roleCreate$1,
1310
+ roleDelete: roleDelete$1,
1311
+ roleUpdate: roleUpdate$1,
1312
+ emojiCreate: emojiCreate$1,
1313
+ emojiDelete: emojiDelete$1,
1314
+ emojiUpdate: emojiUpdate$1,
1315
+ guildSoundboardSoundCreate: guildSoundboardSoundCreate$1,
1316
+ guildSoundboardSoundDelete: guildSoundboardSoundDelete$1,
1317
+ guildSoundboardSoundUpdate: guildSoundboardSoundUpdate$1,
1318
+ stickerCreate: stickerCreate$1,
1319
+ stickerDelete: stickerDelete$1,
1320
+ stickerUpdate: stickerUpdate$1,
1321
+ guildScheduledEventCreate: guildScheduledEventCreate$1,
1322
+ guildScheduledEventDelete: guildScheduledEventDelete$1,
1323
+ guildScheduledEventUpdate: guildScheduledEventUpdate$1,
1324
+ guildScheduledEventUserAdd: guildScheduledEventUserAdd$1,
1325
+ guildScheduledEventUserRemove: guildScheduledEventUserRemove$1
1326
+ };
1327
+
1328
+ //#endregion
1329
+ //#region src/lib/description/events/application/client.application-scope-origins.ts
1330
+ const guildAvailable = (guild) => ({
1331
+ kind: ProducerKind.Gateway,
1332
+ namespace: OriginNamespace.Guild,
1333
+ value: guild.id
1334
+ });
1335
+ const guildUnavailable = (guild) => ({
1336
+ kind: ProducerKind.Gateway,
1337
+ namespace: OriginNamespace.Guild,
1338
+ value: guild.id
1339
+ });
1340
+ const guildMemberAvailable = (member) => ({
1341
+ kind: ProducerKind.Gateway,
1342
+ namespace: OriginNamespace.Guild,
1343
+ value: `${member.guild.id}:${member.id}`
1344
+ });
1345
+ const guildMembersChunk = (_members, guild, _chunk) => ({
1346
+ kind: ProducerKind.Gateway,
1347
+ namespace: OriginNamespace.Guild,
1348
+ value: guild.id
1349
+ });
1350
+ const threadMemberUpdate = (_previous, current) => ({
1351
+ kind: ProducerKind.Gateway,
1352
+ namespace: OriginNamespace.Guild,
1353
+ value: `${maybeUnknown(current.guildMember?.guild.id)}:${current.id}`
1354
+ });
1355
+ const threadListSync = (_threads, guild) => ({
1356
+ kind: ProducerKind.Gateway,
1357
+ namespace: OriginNamespace.Guild,
1358
+ value: guild.id
1359
+ });
1360
+ const soundboardSounds = (_sounds, guild) => ({
1361
+ kind: ProducerKind.Gateway,
1362
+ namespace: OriginNamespace.Guild,
1363
+ value: guild.id
1364
+ });
1365
+ const cacheSweep = (_message) => ({
1366
+ kind: ProducerKind.Gateway,
1367
+ namespace: OriginNamespace.System,
1368
+ value: "cache"
1369
+ });
1370
+ const invalidated = () => ({
1371
+ kind: ProducerKind.Gateway,
1372
+ namespace: OriginNamespace.System,
1373
+ value: "cache"
1374
+ });
1375
+
1376
+ //#endregion
1377
+ //#region src/lib/description/events/application/gateway.application-scope-origins.ts
1378
+ const ready = (_client) => ({
1379
+ kind: ProducerKind.Gateway,
1380
+ namespace: OriginNamespace.System,
1381
+ value: "client"
1382
+ });
1383
+ const error = (_error) => ({
1384
+ kind: ProducerKind.Gateway,
1385
+ namespace: OriginNamespace.System,
1386
+ value: "client"
1387
+ });
1388
+ const warn = (_message) => ({
1389
+ kind: ProducerKind.Gateway,
1390
+ namespace: OriginNamespace.System,
1391
+ value: "client"
1392
+ });
1393
+ const debug = (_message) => ({
1394
+ kind: ProducerKind.Gateway,
1395
+ namespace: OriginNamespace.System,
1396
+ value: "client"
1397
+ });
1398
+ const shardReady = (_shard, _unavailableGuilds) => ({
1399
+ kind: ProducerKind.Gateway,
1400
+ namespace: OriginNamespace.System,
1401
+ value: "shard"
1402
+ });
1403
+ const shardError = (_error, _shard) => ({
1404
+ kind: ProducerKind.Gateway,
1405
+ namespace: OriginNamespace.System,
1406
+ value: "shard"
1407
+ });
1408
+ const shardResume = (_shard, _replayedEvents) => ({
1409
+ kind: ProducerKind.Gateway,
1410
+ namespace: OriginNamespace.System,
1411
+ value: "shard"
1412
+ });
1413
+ const shardDisconnect = (_closeEvent, _shard) => ({
1414
+ kind: ProducerKind.Gateway,
1415
+ namespace: OriginNamespace.System,
1416
+ value: "shard"
1417
+ });
1418
+ const shardReconnecting = (_shard) => ({
1419
+ kind: ProducerKind.Gateway,
1420
+ namespace: OriginNamespace.System,
1421
+ value: "shard"
1422
+ });
1423
+ const userUpdate = (_previous, current) => ({
1424
+ kind: ProducerKind.Gateway,
1425
+ namespace: OriginNamespace.User,
1426
+ value: current.id
1427
+ });
1428
+ const interactionCreate = (interaction) => interaction.inGuild() ? {
1429
+ kind: ProducerKind.Actor,
1430
+ namespace: OriginNamespace.Member,
1431
+ value: interaction.user.id
1432
+ } : {
1433
+ kind: ProducerKind.Actor,
1434
+ namespace: OriginNamespace.User,
1435
+ value: interaction.user.id
1436
+ };
1437
+ const presenceUpdate = (presence) => presence !== null ? presence.member !== null ? {
1438
+ kind: ProducerKind.Actor,
1439
+ namespace: OriginNamespace.Member,
1440
+ value: presence.member.id
1441
+ } : {
1442
+ kind: ProducerKind.Actor,
1443
+ namespace: OriginNamespace.User,
1444
+ value: presence.userId
1445
+ } : null;
1446
+
1447
+ //#endregion
1448
+ //#region src/lib/description/events/application/installations.application-scope-origins.ts
1449
+ const guildCreate = (guild) => ({
1450
+ kind: ProducerKind.Gateway,
1451
+ namespace: OriginNamespace.Guild,
1452
+ value: guild.id
1453
+ });
1454
+ const guildDelete = (guild) => ({
1455
+ kind: ProducerKind.Gateway,
1456
+ namespace: OriginNamespace.Guild,
1457
+ value: guild.id
1458
+ });
1459
+ const entitlementCreate = (entitlement) => ({
1460
+ kind: ProducerKind.Actor,
1461
+ namespace: OriginNamespace.User,
1462
+ value: entitlement.userId
1463
+ });
1464
+ const entitlementUpdate = (_previous, current) => ({
1465
+ kind: ProducerKind.Actor,
1466
+ namespace: OriginNamespace.User,
1467
+ value: current.userId
1468
+ });
1469
+ const entitlementDelete = (entitlement) => ({
1470
+ kind: ProducerKind.Actor,
1471
+ namespace: OriginNamespace.User,
1472
+ value: entitlement.userId
1473
+ });
1474
+ const subscriptionCreate = (subscription) => ({
1475
+ kind: ProducerKind.Actor,
1476
+ namespace: OriginNamespace.User,
1477
+ value: subscription.userId
1478
+ });
1479
+ const subscriptionUpdate = (_previous, current) => ({
1480
+ kind: ProducerKind.Actor,
1481
+ namespace: OriginNamespace.User,
1482
+ value: current.userId
1483
+ });
1484
+ const subscriptionDelete = (subscription) => ({
1485
+ kind: ProducerKind.Actor,
1486
+ namespace: OriginNamespace.User,
1487
+ value: subscription.userId
1488
+ });
1489
+
1490
+ //#endregion
1491
+ //#region src/lib/description/events/channel/actions.channel-scope-origins.ts
1492
+ const typingStart = (typing) => typing.inGuild() ? {
1493
+ kind: ProducerKind.Actor,
1494
+ namespace: OriginNamespace.Member,
1495
+ value: typing.user.id
1496
+ } : {
1497
+ kind: ProducerKind.Actor,
1498
+ namespace: OriginNamespace.User,
1499
+ value: typing.user.id
1500
+ };
1501
+ const messageDeleteBulk = (_messages, channel) => ({
1502
+ kind: ProducerKind.Gateway,
1503
+ namespace: OriginNamespace.Guild,
1504
+ value: `${channel.guildId}:${channel.id}`
1505
+ });
1506
+ const channelPinsUpdate = (channel, _date) => channel.isDMBased() ? isChannelOfType(ChannelType.DM, channel) ? {
1507
+ kind: ProducerKind.Gateway,
1508
+ namespace: OriginNamespace.Direct,
1509
+ value: `${channel.recipientId}:${channel.id}`
1510
+ } : {
1511
+ kind: ProducerKind.Gateway,
1512
+ namespace: OriginNamespace.Group,
1513
+ value: channel.id
1514
+ } : {
1515
+ kind: ProducerKind.Gateway,
1516
+ namespace: OriginNamespace.Guild,
1517
+ value: `${channel.guildId}:${channel.id}`
1518
+ };
1519
+
1520
+ //#endregion
1521
+ //#region src/lib/description/events/channel/lifecycle.channel-scope-origins.ts
1522
+ const channelCreate = (channel) => ({
1523
+ kind: ProducerKind.Gateway,
1524
+ namespace: OriginNamespace.Guild,
1525
+ value: `${channel.guildId}:${channel.id}`
1526
+ });
1527
+ const channelUpdate = (_previous, current) => current.isDMBased() ? {
1528
+ kind: ProducerKind.Gateway,
1529
+ namespace: OriginNamespace.Direct,
1530
+ value: `${current.recipientId}:${current.id}`
1531
+ } : {
1532
+ kind: ProducerKind.Gateway,
1533
+ namespace: OriginNamespace.Guild,
1534
+ value: `${current.guildId}:${current.id}`
1535
+ };
1536
+ const channelDelete = (channel) => channel.isDMBased() ? {
1537
+ kind: ProducerKind.Gateway,
1538
+ namespace: OriginNamespace.Direct,
1539
+ value: `${channel.recipientId}:${channel.id}`
1540
+ } : {
1541
+ kind: ProducerKind.Gateway,
1542
+ namespace: OriginNamespace.Guild,
1543
+ value: `${channel.guildId}:${channel.id}`
1544
+ };
1545
+
1546
+ //#endregion
1547
+ //#region src/lib/description/events/channel/stage.channel-scope-origins.ts
1548
+ const stageInstanceCreate = (instance) => ({
1549
+ kind: ProducerKind.Gateway,
1550
+ namespace: OriginNamespace.Guild,
1551
+ value: `${instance.guildId}:${instance.channelId}`
1552
+ });
1553
+ const stageInstanceUpdate = (_previous, current) => ({
1554
+ kind: ProducerKind.Gateway,
1555
+ namespace: OriginNamespace.Guild,
1556
+ value: `${current.guildId}:${current.channelId}`
1557
+ });
1558
+ const stageInstanceDelete = (instance) => ({
1559
+ kind: ProducerKind.Gateway,
1560
+ namespace: OriginNamespace.Guild,
1561
+ value: `${instance.guildId}:${instance.channelId}`
1562
+ });
1563
+
1564
+ //#endregion
1565
+ //#region src/lib/description/events/channel/voice.channel-scope-origins.ts
1566
+ const voiceStateUpdate = (_previous, current) => ({
1567
+ kind: ProducerKind.Actor,
1568
+ namespace: OriginNamespace.Member,
1569
+ value: maybeUnknown(current.member?.id ?? current.member?.user.id)
1570
+ });
1571
+ const voiceChannelEffectSend = (effect) => ({
1572
+ kind: ProducerKind.Actor,
1573
+ namespace: OriginNamespace.Member,
1574
+ value: effect.userId
1575
+ });
1576
+
1577
+ //#endregion
1578
+ //#region src/lib/description/events/channel/webhook.channel-scope-origins.ts
1579
+ const webhookUpdate = (channel) => ({
1580
+ kind: ProducerKind.Gateway,
1581
+ namespace: OriginNamespace.Guild,
1582
+ value: `${channel.guildId}:${channel.id}`
1583
+ });
1584
+ const webhooksUpdate = (channel) => ({
1585
+ kind: ProducerKind.Gateway,
1586
+ namespace: OriginNamespace.Guild,
1587
+ value: `${channel.guildId}:${channel.id}`
1588
+ });
1589
+
1590
+ //#endregion
1591
+ //#region src/lib/description/events/guild/configuration.guild-scope-origins.ts
1592
+ const guildIntegrationsUpdate = (guild) => ({
1593
+ kind: ProducerKind.Gateway,
1594
+ namespace: OriginNamespace.Guild,
1595
+ value: guild.id
1596
+ });
1597
+ const applicationCommandPermissionsUpdate = (command) => ({
1598
+ kind: ProducerKind.Gateway,
1599
+ namespace: OriginNamespace.Guild,
1600
+ value: command.guildId
1601
+ });
1602
+ const guildUpdate = (_previous, current) => ({
1603
+ kind: ProducerKind.Gateway,
1604
+ namespace: OriginNamespace.Guild,
1605
+ value: current.id
1606
+ });
1607
+ const autoModerationRuleCreate = (rule) => ({
1608
+ kind: ProducerKind.Actor,
1609
+ namespace: OriginNamespace.Member,
1610
+ value: rule.creatorId
1611
+ });
1612
+ const autoModerationRuleUpdate = (_previous, current) => ({
1613
+ kind: ProducerKind.Gateway,
1614
+ namespace: OriginNamespace.Guild,
1615
+ value: current.guild.id
1616
+ });
1617
+ const autoModerationRuleDelete = (rule) => ({
1618
+ kind: ProducerKind.Gateway,
1619
+ namespace: OriginNamespace.Guild,
1620
+ value: rule.guild.id
1621
+ });
1622
+ const autoModerationActionExecution = (execution) => ({
1623
+ kind: ProducerKind.Actor,
1624
+ namespace: OriginNamespace.Member,
1625
+ value: execution.userId
1626
+ });
1627
+
1628
+ //#endregion
1629
+ //#region src/lib/description/events/guild/members.guild-scope-origins.ts
1630
+ const guildMemberAdd = (member) => ({
1631
+ kind: ProducerKind.Actor,
1632
+ namespace: OriginNamespace.Member,
1633
+ value: member.id
1634
+ });
1635
+ const guildMemberUpdate = (_previous, member) => ({
1636
+ kind: ProducerKind.Gateway,
1637
+ namespace: OriginNamespace.Guild,
1638
+ value: member.guild.id
1639
+ });
1640
+ const guildMemberRemove = (member) => ({
1641
+ kind: ProducerKind.Gateway,
1642
+ namespace: OriginNamespace.Guild,
1643
+ value: member.guild.id
1644
+ });
1645
+ const guildBanAdd = (ban) => ({
1646
+ kind: ProducerKind.Gateway,
1647
+ namespace: OriginNamespace.Guild,
1648
+ value: ban.guild.id
1649
+ });
1650
+ const guildBanRemove = (ban) => ({
1651
+ kind: ProducerKind.Gateway,
1652
+ namespace: OriginNamespace.Guild,
1653
+ value: ban.guild.id
1654
+ });
1655
+
1656
+ //#endregion
1657
+ //#region src/lib/description/events/guild/resources/events.guild-scope-origins.ts
1658
+ const guildScheduledEventCreate = (event) => ({
1659
+ kind: ProducerKind.Actor,
1660
+ namespace: OriginNamespace.Member,
1661
+ value: maybeUnknown(event.creatorId)
1662
+ });
1663
+ const guildScheduledEventUpdate = (_previous, current) => ({
1664
+ kind: ProducerKind.Gateway,
1665
+ namespace: OriginNamespace.Guild,
1666
+ value: `${current.guildId}:${current.channelId}`
1667
+ });
1668
+ const guildScheduledEventDelete = (event) => ({
1669
+ kind: ProducerKind.Gateway,
1670
+ namespace: OriginNamespace.Guild,
1671
+ value: `${event.guildId}:${event.channelId}`
1672
+ });
1673
+ const guildScheduledEventUserAdd = (_event, user) => ({
1674
+ kind: ProducerKind.Actor,
1675
+ namespace: OriginNamespace.Member,
1676
+ value: user.id
1677
+ });
1678
+ const guildScheduledEventUserRemove = (_event, user) => ({
1679
+ kind: ProducerKind.Actor,
1680
+ namespace: OriginNamespace.Member,
1681
+ value: user.id
1682
+ });
1683
+
1684
+ //#endregion
1685
+ //#region src/lib/description/events/guild/resources/expressions.guild-scope-origins.ts
1686
+ const guildSoundboardSoundCreate = (sound) => ({
1687
+ kind: ProducerKind.Actor,
1688
+ namespace: OriginNamespace.Member,
1689
+ value: maybeUnknown(sound.user?.id)
1690
+ });
1691
+ const guildSoundboardSoundUpdate = (_previous, current) => ({
1692
+ kind: ProducerKind.Gateway,
1693
+ namespace: OriginNamespace.Guild,
1694
+ value: maybeUnknown(current.guildId)
1695
+ });
1696
+ const guildSoundboardSoundDelete = (sound) => ({
1697
+ kind: ProducerKind.Gateway,
1698
+ namespace: OriginNamespace.Guild,
1699
+ value: maybeUnknown(sound.guildId)
1700
+ });
1701
+ const emojiCreate = (emoji) => ({
1702
+ kind: ProducerKind.Actor,
1703
+ namespace: OriginNamespace.Member,
1704
+ value: maybeUnknown(emoji.author?.id)
1705
+ });
1706
+ const emojiUpdate = (_previous, current) => ({
1707
+ kind: ProducerKind.Gateway,
1708
+ namespace: OriginNamespace.Guild,
1709
+ value: current.guild.id
1710
+ });
1711
+ const emojiDelete = (emoji) => ({
1712
+ kind: ProducerKind.Gateway,
1713
+ namespace: OriginNamespace.Guild,
1714
+ value: emoji.guild.id
1715
+ });
1716
+ const stickerCreate = (sticker) => ({
1717
+ kind: ProducerKind.Actor,
1718
+ namespace: OriginNamespace.Member,
1719
+ value: maybeUnknown(sticker.user?.id)
1720
+ });
1721
+ const stickerUpdate = (_previous, current) => ({
1722
+ kind: ProducerKind.Gateway,
1723
+ namespace: OriginNamespace.Guild,
1724
+ value: maybeUnknown(current.guildId)
1725
+ });
1726
+ const stickerDelete = (sticker) => ({
1727
+ kind: ProducerKind.Gateway,
1728
+ namespace: OriginNamespace.Guild,
1729
+ value: maybeUnknown(sticker.guildId)
1730
+ });
1731
+
1732
+ //#endregion
1733
+ //#region src/lib/description/events/guild/resources/invites.guild-scope-origins.ts
1734
+ const inviteCreate = (invite) => invite.type === InviteType.Guild ? {
1735
+ kind: ProducerKind.Actor,
1736
+ namespace: OriginNamespace.Member,
1737
+ value: maybeUnknown(invite.inviterId)
1738
+ } : {
1739
+ kind: ProducerKind.Actor,
1740
+ namespace: OriginNamespace.User,
1741
+ value: maybeUnknown(invite.inviterId)
1742
+ };
1743
+ const inviteDelete = (invite) => invite.type === InviteType.Guild ? {
1744
+ kind: ProducerKind.Gateway,
1745
+ namespace: OriginNamespace.Guild,
1746
+ value: `${maybeUnknown(invite.guild?.id)}:${maybeUnknown(invite.channelId)}`
1747
+ } : invite.type === InviteType.GroupDM ? {
1748
+ kind: ProducerKind.Gateway,
1749
+ namespace: OriginNamespace.Group,
1750
+ value: maybeUnknown(invite.channelId)
1751
+ } : {
1752
+ kind: ProducerKind.Gateway,
1753
+ namespace: OriginNamespace.Direct,
1754
+ value: maybeUnknown(invite.channelId)
1755
+ };
1756
+
1757
+ //#endregion
1758
+ //#region src/lib/description/events/guild/resources/logs.guild-scope-origins.ts
1759
+ const guildAuditLogEntryCreate = (_entry, guild) => ({
1760
+ kind: ProducerKind.Gateway,
1761
+ namespace: OriginNamespace.Guild,
1762
+ value: guild.id
1763
+ });
1764
+
1765
+ //#endregion
1766
+ //#region src/lib/description/events/guild/resources/roles.guild-scope-origins.ts
1767
+ const roleCreate = (role) => ({
1768
+ kind: ProducerKind.Gateway,
1769
+ namespace: OriginNamespace.Guild,
1770
+ value: `${role.guild.id}:${role.id}`
1771
+ });
1772
+ const roleUpdate = (_previous, current) => ({
1773
+ kind: ProducerKind.Gateway,
1774
+ namespace: OriginNamespace.Guild,
1775
+ value: `${current.guild.id}:${current.id}`
1776
+ });
1777
+ const roleDelete = (role) => ({
1778
+ kind: ProducerKind.Gateway,
1779
+ namespace: OriginNamespace.Guild,
1780
+ value: `${role.guild.id}:${role.id}`
1781
+ });
1782
+
1783
+ //#endregion
1784
+ //#region src/lib/description/events/message/lifecycle.message-scope-origins.ts
1785
+ const messageCreate = (message) => message.inGuild() ? {
1786
+ kind: ProducerKind.Actor,
1787
+ namespace: OriginNamespace.Member,
1788
+ value: message.author.id
1789
+ } : {
1790
+ kind: ProducerKind.Actor,
1791
+ namespace: OriginNamespace.User,
1792
+ value: message.author.id
1793
+ };
1794
+ const messageUpdate = (_previous, message) => message.inGuild() ? {
1795
+ kind: ProducerKind.Actor,
1796
+ namespace: OriginNamespace.Member,
1797
+ value: message.author.id
1798
+ } : {
1799
+ kind: ProducerKind.Actor,
1800
+ namespace: OriginNamespace.User,
1801
+ value: message.author.id
1802
+ };
1803
+ const messageDelete = (message) => message.inGuild() ? {
1804
+ kind: ProducerKind.Gateway,
1805
+ namespace: OriginNamespace.Guild,
1806
+ value: `${message.guildId}:${message.channelId}`
1807
+ } : {
1808
+ kind: ProducerKind.Gateway,
1809
+ namespace: OriginNamespace.Direct,
1810
+ value: `${maybeUnknown(message.channel?.recipientId)}:${message.channelId}`
1811
+ };
1812
+
1813
+ //#endregion
1814
+ //#region src/lib/description/events/message/polls.message-scope-origins.ts
1815
+ const messagePollVoteAdd = (answer, userId) => answer.poll.message.inGuild() ? {
1816
+ kind: ProducerKind.Actor,
1817
+ namespace: OriginNamespace.Member,
1818
+ value: userId
1819
+ } : {
1820
+ kind: ProducerKind.Actor,
1821
+ namespace: OriginNamespace.User,
1822
+ value: userId
1823
+ };
1824
+ const messagePollVoteRemove = (answer, userId) => answer.poll.message.inGuild() ? {
1825
+ kind: ProducerKind.Actor,
1826
+ namespace: OriginNamespace.Member,
1827
+ value: userId
1828
+ } : {
1829
+ kind: ProducerKind.Actor,
1830
+ namespace: OriginNamespace.User,
1831
+ value: userId
1832
+ };
1833
+
1834
+ //#endregion
1835
+ //#region src/lib/description/events/message/reactions.message-scope-origins.ts
1836
+ const messageReactionAdd = (reaction, user, _details) => reaction.message.channel.isDMBased() ? {
1837
+ kind: ProducerKind.Actor,
1838
+ namespace: OriginNamespace.User,
1839
+ value: user.id
1840
+ } : {
1841
+ kind: ProducerKind.Actor,
1842
+ namespace: OriginNamespace.Member,
1843
+ value: user.id
1844
+ };
1845
+ const messageReactionRemove = (reaction, user, _details) => reaction.message.channel.isDMBased() ? {
1846
+ kind: ProducerKind.Actor,
1847
+ namespace: OriginNamespace.User,
1848
+ value: user.id
1849
+ } : {
1850
+ kind: ProducerKind.Actor,
1851
+ namespace: OriginNamespace.Member,
1852
+ value: user.id
1853
+ };
1854
+ const messageReactionRemoveAll = (message, _reactions) => message.channel.isDMBased() ? {
1855
+ kind: ProducerKind.Gateway,
1856
+ namespace: OriginNamespace.Direct,
1857
+ value: `${message.channel.recipientId}:${message.channelId}`
1858
+ } : {
1859
+ kind: ProducerKind.Gateway,
1860
+ namespace: OriginNamespace.Guild,
1861
+ value: `${message.channel.guildId}:${message.channelId}`
1862
+ };
1863
+ const messageReactionRemoveEmoji = (reaction) => reaction.message.channel.isDMBased() ? isChannelOfType(ChannelType.DM, reaction.message.channel) ? {
1864
+ kind: ProducerKind.Gateway,
1865
+ namespace: OriginNamespace.Direct,
1866
+ value: `${reaction.message.channel.recipientId}:${reaction.message.channelId}`
1867
+ } : {
1868
+ kind: ProducerKind.Gateway,
1869
+ namespace: OriginNamespace.Group,
1870
+ value: reaction.message.channelId
1871
+ } : {
1872
+ kind: ProducerKind.Gateway,
1873
+ namespace: OriginNamespace.Guild,
1874
+ value: `${reaction.message.channel.guildId}:${reaction.message.channelId}`
1875
+ };
1876
+
1877
+ //#endregion
1878
+ //#region src/lib/description/events/thread/lifecycle.thread-scope-origins.ts
1879
+ const threadCreate = (thread, _newlyCreated) => ({
1880
+ kind: ProducerKind.Actor,
1881
+ namespace: OriginNamespace.Member,
1882
+ value: thread.ownerId
1883
+ });
1884
+ const threadUpdate = (_previous, current) => ({
1885
+ kind: ProducerKind.Gateway,
1886
+ namespace: OriginNamespace.Guild,
1887
+ value: `${current.guildId}:${current.id}`
1888
+ });
1889
+ const threadDelete = (thread) => ({
1890
+ kind: ProducerKind.Gateway,
1891
+ namespace: OriginNamespace.Guild,
1892
+ value: `${thread.guildId}:${thread.id}`
1893
+ });
1894
+
1895
+ //#endregion
1896
+ //#region src/lib/description/events/thread/members.thread-scope-origins.ts
1897
+ const threadMembersUpdate = (_added, _removed, thread) => ({
1898
+ kind: ProducerKind.Gateway,
1899
+ namespace: OriginNamespace.Guild,
1900
+ value: `${thread.guildId}:${thread.id}`
1901
+ });
1902
+
1903
+ //#endregion
1904
+ //#region src/lib/description/event-origin.ts
1905
+ const OriginMap = {
1906
+ cacheSweep,
1907
+ debug,
1908
+ entitlementCreate,
1909
+ entitlementDelete,
1910
+ entitlementUpdate,
1911
+ error,
1912
+ guildAvailable,
1913
+ guildCreate,
1914
+ guildDelete,
1915
+ guildMemberAvailable,
1916
+ guildMembersChunk,
1917
+ guildUnavailable,
1918
+ interactionCreate,
1919
+ invalidated,
1920
+ presenceUpdate,
1921
+ ready,
1922
+ shardDisconnect,
1923
+ shardError,
1924
+ shardReady,
1925
+ shardReconnecting,
1926
+ shardResume,
1927
+ soundboardSounds,
1928
+ subscriptionCreate,
1929
+ subscriptionDelete,
1930
+ subscriptionUpdate,
1931
+ threadListSync,
1932
+ threadMemberUpdate,
1933
+ userUpdate,
1934
+ warn,
1935
+ channelCreate,
1936
+ channelDelete,
1937
+ channelPinsUpdate,
1938
+ channelUpdate,
1939
+ messageDeleteBulk,
1940
+ stageInstanceCreate,
1941
+ stageInstanceDelete,
1942
+ stageInstanceUpdate,
1943
+ typingStart,
1944
+ voiceChannelEffectSend,
1945
+ voiceStateUpdate,
1946
+ webhooksUpdate,
1947
+ webhookUpdate,
1948
+ messageCreate,
1949
+ messageDelete,
1950
+ messagePollVoteAdd,
1951
+ messagePollVoteRemove,
1952
+ messageReactionAdd,
1953
+ messageReactionRemove,
1954
+ messageReactionRemoveAll,
1955
+ messageReactionRemoveEmoji,
1956
+ messageUpdate,
1957
+ threadCreate,
1958
+ threadDelete,
1959
+ threadMembersUpdate,
1960
+ threadUpdate,
1961
+ applicationCommandPermissionsUpdate,
1962
+ autoModerationActionExecution,
1963
+ autoModerationRuleCreate,
1964
+ autoModerationRuleDelete,
1965
+ autoModerationRuleUpdate,
1966
+ guildIntegrationsUpdate,
1967
+ guildUpdate,
1968
+ guildBanAdd,
1969
+ guildBanRemove,
1970
+ guildMemberAdd,
1971
+ guildMemberRemove,
1972
+ guildMemberUpdate,
1973
+ guildAuditLogEntryCreate,
1974
+ inviteCreate,
1975
+ inviteDelete,
1976
+ roleCreate,
1977
+ roleDelete,
1978
+ roleUpdate,
1979
+ emojiCreate,
1980
+ emojiDelete,
1981
+ emojiUpdate,
1982
+ guildSoundboardSoundCreate,
1983
+ guildSoundboardSoundDelete,
1984
+ guildSoundboardSoundUpdate,
1985
+ stickerCreate,
1986
+ stickerDelete,
1987
+ stickerUpdate,
1988
+ guildScheduledEventCreate,
1989
+ guildScheduledEventDelete,
1990
+ guildScheduledEventUpdate,
1991
+ guildScheduledEventUserAdd,
1992
+ guildScheduledEventUserRemove
1993
+ };
1994
+
1995
+ //#endregion
1996
+ //#region src/lib/description/event-description-parser.ts
1997
+ function parse(event, ...payload) {
1998
+ return {
1999
+ event,
2000
+ body: BodyMap[event](...payload),
2001
+ callpoint: CallpointMap[event](...payload),
2002
+ origin: OriginMap[event](...payload)
2003
+ };
2004
+ }
2005
+
2006
+ //#endregion
2007
+ export { BodyMap, CallpointMap, OriginMap, OriginNamespace, ProducerKind, parse };
2008
+ //# sourceMappingURL=index.js.map