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