@seedcord/core 0.11.0 → 0.12.0-next.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.
Files changed (49) hide show
  1. package/dist/Bus-W1K-uMeO.mjs +930 -0
  2. package/dist/Bus-W1K-uMeO.mjs.map +1 -0
  3. package/dist/{CoordinatedShutdown-H5YjZn8A.d.mts → CoordinatedShutdown-BVtNNSsF.d.mts} +13 -4
  4. package/dist/{CoordinatedStartup-CGnJrqcl.mjs → CoordinatedStartup-DA3gW8op.mjs} +22 -20
  5. package/dist/CoordinatedStartup-DA3gW8op.mjs.map +1 -0
  6. package/dist/Generated-ByC53_A2.d.mts +26 -0
  7. package/dist/{HmrModuleHandler-8ZC-UuZh.mjs → HmrModuleHandler-BMD7dg8N.mjs} +2 -2
  8. package/dist/HmrModuleHandler-BMD7dg8N.mjs.map +1 -0
  9. package/dist/PluginHost-CYe-UVpp.mjs +552 -0
  10. package/dist/PluginHost-CYe-UVpp.mjs.map +1 -0
  11. package/dist/{PluginHost-DB4j8unu.d.mts → PluginHost-DWBgBS6Q.d.mts} +35 -8
  12. package/dist/{PluginLifecycle-AhQ46NIr.mjs → PluginLifecycle-DdwRzcDj.mjs} +3 -3
  13. package/dist/PluginLifecycle-DdwRzcDj.mjs.map +1 -0
  14. package/dist/{ServerHost-CtmAhEXn.mjs → ServerHost-DHg-Y2_q.mjs} +17 -6
  15. package/dist/{ServerHost-CtmAhEXn.mjs.map → ServerHost-DHg-Y2_q.mjs.map} +1 -1
  16. package/dist/{ServerHost-DYeh0KTk.d.mts → ServerHost-whpI0h4d.d.mts} +7 -6
  17. package/dist/bindViteEnv-NFzvdqlT.mjs +32 -0
  18. package/dist/{bindViteEnv-DWq5rftJ.mjs.map → bindViteEnv-NFzvdqlT.mjs.map} +1 -1
  19. package/dist/env-internal.index.mjs +1 -1
  20. package/dist/hmr.index.mjs +1 -1
  21. package/dist/{index-Du71Xx69.d.mts → index-Boo33hh3.d.mts} +10 -11
  22. package/dist/index.d.mts +108 -6
  23. package/dist/index.mjs +118 -12
  24. package/dist/index.mjs.map +1 -1
  25. package/dist/internal.index.d.mts +25 -7
  26. package/dist/internal.index.mjs +8 -8
  27. package/dist/node-internal.index.d.mts +7 -4
  28. package/dist/node-internal.index.mjs +19 -6
  29. package/dist/node-internal.index.mjs.map +1 -1
  30. package/dist/node.index.d.mts +3 -3
  31. package/dist/node.index.mjs +22 -28
  32. package/dist/node.index.mjs.map +1 -1
  33. package/dist/{phases-FTM69J3a.d.mts → phases-Dojnr-ng.d.mts} +111 -12
  34. package/dist/plugin.index.d.mts +3 -2
  35. package/dist/plugin.index.mjs +1 -1
  36. package/dist/{subscribers-Ce3SWy23.mjs → subscribers-D4_HZcgw.mjs} +12 -829
  37. package/dist/subscribers-D4_HZcgw.mjs.map +1 -0
  38. package/dist/{bindViteEnv-DWq5rftJ.mjs → usingCtx-Cf2cZi96.mjs} +1 -31
  39. package/package.json +11 -9
  40. package/dist/CoordinatedStartup-CGnJrqcl.mjs.map +0 -1
  41. package/dist/HmrModuleHandler-8ZC-UuZh.mjs.map +0 -1
  42. package/dist/PluginHost-B8kxLOeb.mjs +0 -245
  43. package/dist/PluginHost-B8kxLOeb.mjs.map +0 -1
  44. package/dist/PluginLifecycle-AhQ46NIr.mjs.map +0 -1
  45. package/dist/phases-BauKJOTT.mjs +0 -31
  46. package/dist/phases-BauKJOTT.mjs.map +0 -1
  47. package/dist/publishDefault-D3dAyzZ9.mjs +0 -7
  48. package/dist/publishDefault-D3dAyzZ9.mjs.map +0 -1
  49. package/dist/subscribers-Ce3SWy23.mjs.map +0 -1
@@ -1,16 +1,13 @@
1
- import { t as PublishDefault } from "./publishDefault-D3dAyzZ9.mjs";
1
+ import { D as InteractionMiddlewareMetadataKey, E as InteractionMetadataKey, O as InteractionRouteKeys, T as InteractionKind, b as PublishDefault, j as BuilderComponent, x as CommandMetadataKey } from "./Bus-W1K-uMeO.mjs";
2
2
  import "reflect-metadata";
3
3
  import { CustomId, decodeFor } from "@seedcord/custom-id";
4
- import { ActionRowBuilder, ButtonBuilder, ChannelSelectMenuBuilder, CheckboxBuilder, CheckboxGroupBuilder, CheckboxGroupOptionBuilder, ContainerBuilder, ContextMenuCommandBuilder, EmbedBuilder, FileBuilder, FileUploadBuilder, LabelBuilder, MediaGalleryBuilder, MentionableSelectMenuBuilder, ModalBuilder, RadioGroupBuilder, RadioGroupOptionBuilder, RoleSelectMenuBuilder, SectionBuilder, SeparatorBuilder, SlashCommandBuilder, SlashCommandSubcommandBuilder, SlashCommandSubcommandGroupBuilder, StringSelectMenuBuilder, StringSelectMenuOptionBuilder, TextDisplayBuilder, TextInputBuilder, UserSelectMenuBuilder } from "@discordjs/builders";
5
- import { ApplicationCommandType, InteractionContextType, MessageFlags, PermissionFlagsBits, Routes, SeparatorSpacingSize } from "discord-api-types/v10";
4
+ import { TextDisplayBuilder } from "@discordjs/builders";
5
+ import { ApplicationCommandType, PermissionFlagsBits, Routes } from "discord-api-types/v10";
6
6
  import { SeedcordErrorCode, paint } from "@seedcord/errors";
7
- import { SeedcordError, SeedcordRangeError, SeedcordTypeError } from "@seedcord/errors/internal";
7
+ import { SeedcordError, SeedcordTypeError } from "@seedcord/errors/internal";
8
8
  import { Logger } from "@seedcord/logger";
9
9
  import { asError, isStringArray, pluralize, routeLeavesOf } from "@seedcord/utils/internal";
10
- import { filterCirculars, prettify, stripAnsi, timestampFromSnowflake, toEpochSeconds } from "@seedcord/utils";
11
- import { TypedEventEmitter } from "@seedcord/event-emitter";
12
- import { Envapter } from "envapt";
13
- import { DiscordAPIError, REST } from "@discordjs/rest";
10
+ import { prettify, toEpochSeconds } from "@seedcord/utils";
14
11
 
15
12
  //#region src/stops/Notice.ts
16
13
  /**
@@ -78,204 +75,6 @@ var Notice = class extends Error {
78
75
  }
79
76
  };
80
77
 
81
- //#endregion
82
- //#region src/components/botColorHolder.ts
83
- const DEFAULT_COLOR = "Default";
84
- let readBotColor = () => void 0;
85
- function bindBotColor(read) {
86
- readBotColor = read;
87
- }
88
- function getBotColor() {
89
- return readBotColor() ?? DEFAULT_COLOR;
90
- }
91
-
92
- //#endregion
93
- //#region src/components/builderTypes.ts
94
- /**
95
- * Available Discord.js builder classes for use with BuilderComponent for commands, embeds, modals, etc.
96
- *
97
- * @internal
98
- */
99
- const BuilderTypes = {
100
- command: SlashCommandBuilder,
101
- context_menu: ContextMenuCommandBuilder,
102
- subcommand: SlashCommandSubcommandBuilder,
103
- group: SlashCommandSubcommandGroupBuilder,
104
- embed: EmbedBuilder,
105
- modal: ModalBuilder,
106
- label: LabelBuilder,
107
- text_input: TextInputBuilder,
108
- file_upload: FileUploadBuilder,
109
- checkbox: CheckboxBuilder,
110
- checkbox_group: CheckboxGroupBuilder,
111
- checkbox_group_option: CheckboxGroupOptionBuilder,
112
- radio_group: RadioGroupBuilder,
113
- radio_group_option: RadioGroupOptionBuilder,
114
- button: ButtonBuilder,
115
- menu_string: StringSelectMenuBuilder,
116
- menu_option_string: StringSelectMenuOptionBuilder,
117
- menu_user: UserSelectMenuBuilder,
118
- menu_channel: ChannelSelectMenuBuilder,
119
- menu_mentionable: MentionableSelectMenuBuilder,
120
- menu_role: RoleSelectMenuBuilder,
121
- container: ContainerBuilder,
122
- text_display: TextDisplayBuilder,
123
- file: FileBuilder,
124
- media: MediaGalleryBuilder,
125
- section: SectionBuilder,
126
- separator: SeparatorBuilder
127
- };
128
- /**
129
- * Available Discord.js action row classes for use with RowComponent for Select Menus and Buttons
130
- *
131
- * @internal
132
- */
133
- const RowTypes = {
134
- button: ActionRowBuilder,
135
- menu_string: ActionRowBuilder,
136
- menu_user: ActionRowBuilder,
137
- menu_channel: ActionRowBuilder,
138
- menu_mentionable: ActionRowBuilder,
139
- menu_role: ActionRowBuilder
140
- };
141
-
142
- //#endregion
143
- //#region src/components/colors.ts
144
- const Colors = {
145
- Aqua: 1752220,
146
- Blue: 3447003,
147
- Blurple: 5793266,
148
- DarkAqua: 1146986,
149
- DarkBlue: 2123412,
150
- DarkButNotBlack: 2895667,
151
- DarkerGrey: 8359053,
152
- DarkGold: 12745742,
153
- DarkGreen: 2067276,
154
- DarkGrey: 9936031,
155
- DarkNavy: 2899536,
156
- DarkOrange: 11027200,
157
- DarkPurple: 7419530,
158
- DarkRed: 10038562,
159
- DarkVividPink: 11342935,
160
- Default: 0,
161
- Fuchsia: 15418782,
162
- Gold: 15844367,
163
- Green: 5763719,
164
- Grey: 9807270,
165
- Greyple: 10070709,
166
- LightGrey: 12370112,
167
- LuminousVividPink: 15277667,
168
- Navy: 3426654,
169
- NotQuiteBlack: 2303786,
170
- Orange: 15105570,
171
- Purple: 10181046,
172
- Red: 15548997,
173
- White: 16777215,
174
- Yellow: 16705372
175
- };
176
-
177
- //#endregion
178
- //#region src/components/resolveColor.ts
179
- const MAX_COLOR = 16777215;
180
- const RED_SHIFT = 16;
181
- const GREEN_SHIFT = 8;
182
- const palette = Colors;
183
- /**
184
- * Resolves a {@link BotColor} to the integer Discord expects.
185
- *
186
- * Ported from discord.js (Apache-2.0), `resolveColor` in src/util/Util.js.
187
- */
188
- function resolveColor(color) {
189
- let resolved;
190
- if (typeof color === "string") {
191
- if (color === "Random") return Math.floor(Math.random() * 16777216);
192
- if (color === "Default") return 0;
193
- if (/^#?[\da-f]{6}$/i.test(color)) return Number.parseInt(color.replace("#", ""), 16);
194
- resolved = palette[color];
195
- } else if (typeof color === "number") resolved = color;
196
- else resolved = (color[0] << RED_SHIFT) + (color[1] << GREEN_SHIFT) + color[2];
197
- if (resolved === void 0 || !Number.isSafeInteger(resolved)) throw new SeedcordTypeError(SeedcordErrorCode.ColorUnresolvable, [JSON.stringify(color)]);
198
- if (resolved < 0 || resolved > MAX_COLOR) throw new SeedcordRangeError(SeedcordErrorCode.ColorOutOfRange, [resolved]);
199
- return resolved;
200
- }
201
-
202
- //#endregion
203
- //#region src/components/Component.ts
204
- /** @internal */
205
- var BaseComponent = class {
206
- _component;
207
- constructor(ComponentClass) {
208
- this._component = new ComponentClass();
209
- }
210
- /**
211
- * The wrapped builder, for calling Discord.js methods like setTitle() and setDescription() inside a subclass.
212
- *
213
- * @example this.instance.setTitle('My Modal')
214
- */
215
- get instance() {
216
- return this._component;
217
- }
218
- };
219
- /**
220
- * Base class for Discord.js builder components
221
- *
222
- * Wraps Discord.js builders (SlashCommandBuilder, EmbedBuilder, etc.) with
223
- * Seedcord-specific defaults and helper methods.
224
- *
225
- * @typeParam BuilderKey - The type of Discord.js builder being wrapped
226
- */
227
- var BuilderComponent = class extends BaseComponent {
228
- type;
229
- colorApplied = false;
230
- constructor(type) {
231
- const ComponentClass = BuilderTypes[type];
232
- super(ComponentClass);
233
- this.type = type;
234
- if (this.instance instanceof SlashCommandBuilder || this.instance instanceof ContextMenuCommandBuilder) this.instance.setContexts(InteractionContextType.Guild);
235
- }
236
- get component() {
237
- this.applyBotColor();
238
- return this.instance;
239
- }
240
- applyBotColor() {
241
- if (this.colorApplied) return;
242
- this.colorApplied = true;
243
- const color = getBotColor();
244
- if (this.instance instanceof EmbedBuilder) {
245
- if (this.instance.data.color === void 0) this.instance.setColor(resolveColor(color));
246
- } else if (this.instance instanceof ContainerBuilder) {
247
- const accent = this.instance.data.accent_color;
248
- if (accent === null || accent === void 0) this.instance.setAccentColor(color === "Default" ? void 0 : resolveColor(color));
249
- }
250
- }
251
- };
252
- const BUILDER_COMPONENT = Symbol.for("seedcord:core:builder-component");
253
- Object.defineProperty(BuilderComponent.prototype, BUILDER_COMPONENT, { value: true });
254
- /** @internal */
255
- function isBuilderComponentClass(value) {
256
- if (typeof value !== "function") return false;
257
- const proto = value.prototype;
258
- return typeof proto === "object" && proto !== null && BUILDER_COMPONENT in proto;
259
- }
260
- /**
261
- * Base class for Discord action row components
262
- *
263
- * Wraps Discord.js action row builder with Seedcord-specific defaults and helper methods.
264
- *
265
- * @typeParam RowKey - The Discord.js action row type being wrapped
266
- */
267
- var RowComponent = class extends BaseComponent {
268
- type;
269
- constructor(type) {
270
- const ComponentClass = RowTypes[type];
271
- super(ComponentClass);
272
- this.type = type;
273
- }
274
- get component() {
275
- return this.instance;
276
- }
277
- };
278
-
279
78
  //#endregion
280
79
  //#region src/stops/NoticeCard.ts
281
80
  var NoticeCard = class extends BuilderComponent {
@@ -534,47 +333,6 @@ var CommandInjector = class {
534
333
  }
535
334
  };
536
335
 
537
- //#endregion
538
- //#region src/metadataKeys.ts
539
- /**
540
- * Every interaction kind seedcord routes.
541
- */
542
- let InteractionKind = /* @__PURE__ */ function(InteractionKind) {
543
- InteractionKind["Slash"] = "slash";
544
- InteractionKind["Button"] = "button";
545
- InteractionKind["Modal"] = "modal";
546
- InteractionKind["StringMenu"] = "stringMenu";
547
- InteractionKind["UserMenu"] = "userMenu";
548
- InteractionKind["RoleMenu"] = "roleMenu";
549
- InteractionKind["ChannelMenu"] = "channelMenu";
550
- InteractionKind["MentionableMenu"] = "mentionableMenu";
551
- InteractionKind["MessageContextMenu"] = "messageContextMenu";
552
- InteractionKind["UserContextMenu"] = "userContextMenu";
553
- InteractionKind["Autocomplete"] = "autocomplete";
554
- return InteractionKind;
555
- }({});
556
- const CommandMetadataKey = Symbol.for("seedcord:command:metadata");
557
- const InteractionMetadataKey = Symbol.for("seedcord:interaction:metadata");
558
- const InteractionMiddlewareMetadataKey = Symbol.for("seedcord:middleware:interaction:metadata");
559
- const EventMiddlewareMetadataKey = Symbol.for("seedcord:middleware:event:metadata");
560
- const SubscribeMetadataKey = Symbol.for("seedcord:subscribe:metadata");
561
- const EventMetadataKey = Symbol.for("seedcord:event:metadata");
562
- const GatedMetadataKey = Symbol.for("seedcord:gated:metadata");
563
- const WebhookUrlMetadataKey = Symbol.for("seedcord:webhook-url:metadata");
564
- const InteractionRouteKeys = {
565
- ["slash"]: Symbol.for("seedcord:interaction:slash"),
566
- ["button"]: Symbol.for("seedcord:interaction:button"),
567
- ["modal"]: Symbol.for("seedcord:interaction:modal"),
568
- ["stringMenu"]: Symbol.for("seedcord:interaction:string-menu"),
569
- ["userMenu"]: Symbol.for("seedcord:interaction:user-menu"),
570
- ["roleMenu"]: Symbol.for("seedcord:interaction:role-menu"),
571
- ["channelMenu"]: Symbol.for("seedcord:interaction:channel-menu"),
572
- ["mentionableMenu"]: Symbol.for("seedcord:interaction:mentionable-menu"),
573
- ["messageContextMenu"]: Symbol.for("seedcord:interaction:message-context-menu"),
574
- ["userContextMenu"]: Symbol.for("seedcord:interaction:user-context-menu"),
575
- ["autocomplete"]: Symbol.for("seedcord:interaction:autocomplete")
576
- };
577
-
578
336
  //#endregion
579
337
  //#region src/decorators/Command.ts
580
338
  const ConfigGuilds = "config";
@@ -956,9 +714,9 @@ function serializeReply(response, routeId) {
956
714
  return {
957
715
  components: response.components.map((component, index) => {
958
716
  try {
959
- return component.toJSON();
717
+ return "toJSON" in component ? component.toJSON() : component;
960
718
  } catch (error) {
961
- const name = component.constructor?.name;
719
+ const name = component?.constructor?.name;
962
720
  throw translateSerializationError(error, !name || name === "Object" ? "component" : name, index, routeId);
963
721
  }
964
722
  }),
@@ -1190,7 +948,7 @@ function pickNotice(options, makeDefault) {
1190
948
  //#region src/permissions/bits.ts
1191
949
  const PermissionNames = new Map(Object.entries(PermissionFlagsBits).map(([key, bit]) => [bit, prettify(key)]));
1192
950
  const ADMINISTRATOR = PermissionFlagsBits.Administrator;
1193
- function nameOf$1(bit) {
951
+ function nameOf(bit) {
1194
952
  return PermissionNames.get(bit) ?? String(bit);
1195
953
  }
1196
954
  function holds(held, bit) {
@@ -1203,14 +961,14 @@ function hasAll(held, scope) {
1203
961
  /** @internal only reached once hasAll failed, so the administrator bit is absent */
1204
962
  function missingNames(held, scope) {
1205
963
  return scope.reduce((names, bit) => {
1206
- if ((held & bit) !== bit) names.push(nameOf$1(bit));
964
+ if ((held & bit) !== bit) names.push(nameOf(bit));
1207
965
  return names;
1208
966
  }, []);
1209
967
  }
1210
968
  /** @internal */
1211
969
  function presentNames(held, scope) {
1212
970
  return scope.reduce((names, bit) => {
1213
- if (holds(held, bit)) names.push(nameOf$1(bit));
971
+ if (holds(held, bit)) names.push(nameOf(bit));
1214
972
  return names;
1215
973
  }, []);
1216
974
  }
@@ -1334,580 +1092,5 @@ function pageCursor(prefix) {
1334
1092
  }
1335
1093
 
1336
1094
  //#endregion
1337
- //#region src/reply/flags.ts
1338
- function sendFlags(opts) {
1339
- let flags = MessageFlags.IsComponentsV2;
1340
- if (opts?.ephemeral ?? true) flags |= MessageFlags.Ephemeral;
1341
- if (opts?.silent) flags |= MessageFlags.SuppressNotifications;
1342
- return flags;
1343
- }
1344
- function deferFlags(opts) {
1345
- return opts?.ephemeral ?? true ? MessageFlags.Ephemeral : 0;
1346
- }
1347
-
1348
- //#endregion
1349
- //#region src/subscribers/ReportThrottle.ts
1350
- var ReportThrottle = class ReportThrottle {
1351
- windowMs;
1352
- now;
1353
- static perCore = /* @__PURE__ */ new WeakMap();
1354
- static for(core) {
1355
- let throttle = ReportThrottle.perCore.get(core);
1356
- if (!throttle) {
1357
- throttle = new ReportThrottle();
1358
- ReportThrottle.perCore.set(core, throttle);
1359
- }
1360
- return throttle;
1361
- }
1362
- windows = /* @__PURE__ */ new Map();
1363
- constructor(windowMs = 6e4, now = () => Date.now()) {
1364
- this.windowMs = windowMs;
1365
- this.now = now;
1366
- }
1367
- take(key) {
1368
- const window = this.windows.get(key);
1369
- if (window && this.now() - window.lastSentAt < this.windowMs) {
1370
- window.suppressedSinceSend += 1;
1371
- return null;
1372
- }
1373
- const suppressed = window?.suppressedSinceSend ?? 0;
1374
- this.windows.set(key, {
1375
- lastSentAt: this.now(),
1376
- suppressedSinceSend: 0
1377
- });
1378
- return suppressed;
1379
- }
1380
- restore(key, suppressed) {
1381
- const window = this.windows.get(key);
1382
- if (window) window.suppressedSinceSend += suppressed + 1;
1383
- }
1384
- };
1385
-
1386
- //#endregion
1387
- //#region src/subscribers/Subscriber.ts
1388
- /**
1389
- * Abstract base class for handling application subscribers.
1390
- *
1391
- * Provides type-safe access to subscribers data and the core framework instance.
1392
- * Extend this class to create custom subscriber handlers.
1393
- *
1394
- * @typeParam KeyOfSubscribers - The specific subscriber type this handler processes
1395
- * @typeParam TCore - The transport's Core
1396
- */
1397
- var Subscriber = class {
1398
- data;
1399
- core;
1400
- logger;
1401
- /**
1402
- * Instantiates the subscriber with event data and core.
1403
- *
1404
- * @param data - The subscriber event data
1405
- * @param core - The core framework instance
1406
- */
1407
- constructor(data, core) {
1408
- this.data = data;
1409
- this.core = core;
1410
- this.logger = new Logger(this.constructor.name, { channel: "subscribers" });
1411
- }
1412
- };
1413
-
1414
- //#endregion
1415
- //#region src/subscribers/bases/webhookHelpers.ts
1416
- const DISCORD_WEBHOOK_REGEX = new RegExp(String.raw`^https?:\/\/(?:canary\.|ptb\.)?discord(?:app)?\.com\/api\/webhooks\/\d+\/[\w$-]+$`);
1417
- function isDiscordWebhookUrl(value) {
1418
- return URL.canParse(value) && DISCORD_WEBHOOK_REGEX.test(value);
1419
- }
1420
- function jsonAttachment(name, description, data) {
1421
- const content = filterCirculars(data);
1422
- return {
1423
- name,
1424
- description,
1425
- data: new TextEncoder().encode(JSON.stringify(content, void 0, 2))
1426
- };
1427
- }
1428
- function breakBackticks(text) {
1429
- return text.replaceAll("```", "`​`​`");
1430
- }
1431
- const REPORT_BUDGET = 1800;
1432
- function body(value) {
1433
- const raw = Error.isError(value) ? value.stack ?? `${value.name}: ${value.message}` : String(value);
1434
- return breakBackticks(stripAnsi(raw));
1435
- }
1436
- function clamp(text, budget) {
1437
- if (text.length <= budget) return text;
1438
- return budget > 0 ? `${text.slice(0, budget - 1)}…` : "";
1439
- }
1440
- function omittedLine(count) {
1441
- return `\n\nand ${count} more ${pluralize(count, "failure")}`;
1442
- }
1443
- function memberReport(members, budget) {
1444
- const room = Math.max(budget - omittedLine(members.length).length, 0);
1445
- const share = Math.floor(room / members.length);
1446
- let report = "";
1447
- let shown = 0;
1448
- for (const [index, member] of members.entries()) {
1449
- const heading = `\n\nFailure ${index + 1} of ${members.length}:\n`;
1450
- const entry = heading + clamp(body(member), Math.max(share - heading.length, 0));
1451
- if (report.length + entry.length > room) break;
1452
- report += entry;
1453
- shown++;
1454
- }
1455
- const hidden = members.length - shown;
1456
- return hidden > 0 ? report + omittedLine(hidden) : report;
1457
- }
1458
- function errorReport(error) {
1459
- let head = body(error);
1460
- if (Error.isError(error.cause)) head += `\n\nCaused by:\n${body(error.cause)}`;
1461
- const members = error instanceof AggregateError ? error.errors : [];
1462
- if (members.length === 0) return clamp(head, REPORT_BUDGET);
1463
- const report = clamp(head, REPORT_BUDGET - omittedLine(members.length).length);
1464
- return report + memberReport(members, REPORT_BUDGET - report.length);
1465
- }
1466
- var WebhookSeparator = class extends BuilderComponent {
1467
- constructor() {
1468
- super("separator");
1469
- this.instance.setSpacing(SeparatorSpacingSize.Small).setDivider(true);
1470
- }
1471
- };
1472
-
1473
- //#endregion
1474
- //#region src/subscribers/bases/WebhookSender.ts
1475
- const HTTP_NOT_FOUND = 404;
1476
- const HTTP_UNAUTHORIZED = 401;
1477
- var WebhookSender = class {
1478
- rest = new REST();
1479
- route;
1480
- constructor(url) {
1481
- const match = /\/webhooks\/(\d+)\/([\w$-]+)$/.exec(url);
1482
- if (!match?.[1] || !match[2]) throw new SeedcordTypeError(SeedcordErrorCode.CoreWebhookUrlInvalid, [new.target.name]);
1483
- this.route = Routes.webhook(match[1], match[2]);
1484
- }
1485
- async verify() {
1486
- try {
1487
- await this.rest.get(this.route, { auth: false });
1488
- return "ok";
1489
- } catch (error) {
1490
- return error instanceof DiscordAPIError && (error.status === HTTP_NOT_FOUND || error.status === HTTP_UNAUTHORIZED) ? "missing" : "unreachable";
1491
- }
1492
- }
1493
- async send(options) {
1494
- const { flags, username, avatarUrl, components, files } = options;
1495
- await this.rest.post(this.route, {
1496
- auth: false,
1497
- query: new URLSearchParams({
1498
- with_components: "true",
1499
- wait: "true"
1500
- }),
1501
- body: {
1502
- flags,
1503
- username,
1504
- ...avatarUrl && { avatar_url: avatarUrl },
1505
- components: components.map((component) => component.toJSON()),
1506
- ...files?.length && { attachments: files.map((file, id) => ({
1507
- id,
1508
- filename: file.name,
1509
- description: file.description
1510
- })) }
1511
- },
1512
- ...files?.length && { files: files.map((file) => ({
1513
- name: file.name,
1514
- data: file.data
1515
- })) }
1516
- });
1517
- }
1518
- };
1519
-
1520
- //#endregion
1521
- //#region src/subscribers/bases/WebhookLog.ts
1522
- /**
1523
- * Base class for subscribers that deliver their event to a Discord webhook.
1524
- *
1525
- * Declare the url's environment variable with `@WebhookUrl` and implement {@link report}. The base
1526
- * resolves the url, validates it, reuses one sender per url, and sends. Registration skips a reporter
1527
- * whose variable is unset and warns at boot.
1528
- *
1529
- * @typeParam KeyOfSubscribers - The subscription key this reporter receives
1530
- * @typeParam TCore - The transport's Core
1531
- */
1532
- var WebhookLog = class WebhookLog extends Subscriber {
1533
- static senders = /* @__PURE__ */ new Map();
1534
- /**
1535
- * Events sharing this key collapse into one card per minute. Return `null` to send every event.
1536
- */
1537
- throttleKey() {
1538
- return null;
1539
- }
1540
- async execute() {
1541
- const envKey = WebhookLog.envKeyOf(this.constructor);
1542
- const url = WebhookLog.urlOf(envKey);
1543
- if (url === null) throw new SeedcordError(SeedcordErrorCode.ConfigMissingEnv, [envKey]);
1544
- const key = this.throttleKey();
1545
- const throttle = ReportThrottle.for(this.core);
1546
- const suppressed = key === null ? 0 : throttle.take(key);
1547
- if (suppressed === null) {
1548
- this.logger.debug(`counted a repeat into the next ${paint.sky.bold(this.constructor.name)} card`);
1549
- return;
1550
- }
1551
- try {
1552
- const { username, avatarUrl, components, files } = await this.report(suppressed);
1553
- await WebhookLog.senderFor(url).send({
1554
- flags: sendFlags({ ephemeral: false }),
1555
- username: username ?? this.constructor.name,
1556
- avatarUrl,
1557
- components,
1558
- files
1559
- });
1560
- } catch (error) {
1561
- if (key !== null) throttle.restore(key, suppressed);
1562
- this.logger.error("Webhook report failed", error);
1563
- }
1564
- }
1565
- /** @internal */
1566
- static senderFor(url) {
1567
- let sender = WebhookLog.senders.get(url);
1568
- if (!sender) {
1569
- sender = new WebhookSender(url);
1570
- WebhookLog.senders.set(url, sender);
1571
- }
1572
- return sender;
1573
- }
1574
- /** @internal */
1575
- static envKeyOf(ctor) {
1576
- const envKey = Reflect.getMetadata(WebhookUrlMetadataKey, ctor);
1577
- if (!envKey) throw new SeedcordTypeError(SeedcordErrorCode.DecoratorWebhookUrlMissing, [ctor.name]);
1578
- return envKey;
1579
- }
1580
- /** @internal Returns null when the env var is unset, throws when set but malformed. */
1581
- static urlOf(envKey) {
1582
- const raw = Envapter.get(envKey)?.trim();
1583
- if (!raw) return null;
1584
- if (!isDiscordWebhookUrl(raw)) throw new SeedcordError(SeedcordErrorCode.ConfigInvalidEnv, [envKey, "the webhook URL from the channel's Integrations settings"]);
1585
- return raw;
1586
- }
1587
- };
1588
-
1589
- //#endregion
1590
- //#region src/subscribers/decorators/Subscribe.ts
1591
- /**
1592
- * Registers a subscriber handler class with a specific subscriber event.
1593
- *
1594
- * Associates the decorated class with a subscriber event type for automatic
1595
- * registration and execution when the subscriber is emitted.
1596
- *
1597
- * @typeParam TSubscriber - The subscriber event name to register for
1598
- * @param subscriber - The subscriber event name to register for
1599
- * @param options - Options to configure the subscriber handler registration.
1600
- * @decorator
1601
- * @example
1602
- * ```typescript
1603
- * \@Subscribe('userJoin')
1604
- * class WelcomeHandler extends Subscriber<'userJoin'> {
1605
- * async execute() {
1606
- * }
1607
- * }
1608
- * ```
1609
- * @example
1610
- * ```ts
1611
- * \@Subscribe('userJoin', { frequency: 'once' })
1612
- * // or
1613
- * \@Subscribe('userJoin')
1614
- * ```
1615
- */
1616
- function Subscribe(subscriber, options) {
1617
- return function(constructor) {
1618
- const meta = {
1619
- subscriber,
1620
- frequency: options?.frequency
1621
- };
1622
- Reflect.defineMetadata(SubscribeMetadataKey, meta, constructor);
1623
- };
1624
- }
1625
-
1626
- //#endregion
1627
- //#region src/subscribers/decorators/WebhookUrl.ts
1628
- /**
1629
- * Declares the environment variable a {@link WebhookLog} reporter reads its webhook url from.
1630
- *
1631
- * An unset variable disables the reporter with a boot warning. A set but malformed value throws
1632
- * at boot.
1633
- *
1634
- * @param envKey - The environment variable name holding the webhook url
1635
- * @decorator
1636
- * @example
1637
- * ```ts
1638
- * \@Subscribe('memberBanned')
1639
- * \@WebhookUrl('BAN_LOG_WEBHOOK_URL')
1640
- * class BanLog extends WebhookLog<'memberBanned'> {
1641
- * report() {
1642
- * return { components: [new BanCard(this.data).component] };
1643
- * }
1644
- * }
1645
- * ```
1646
- */
1647
- function WebhookUrl(envKey) {
1648
- return function(constructor) {
1649
- Reflect.defineMetadata(WebhookUrlMetadataKey, envKey, constructor);
1650
- };
1651
- }
1652
-
1653
- //#endregion
1654
- //#region \0@oxc-project+runtime@0.152.0/helpers/esm/decorate.js
1655
- function __decorate(decorators, target, key, desc) {
1656
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1657
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
1658
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
1659
- return c > 3 && r && Object.defineProperty(target, key, r), r;
1660
- }
1661
-
1662
- //#endregion
1663
- //#region src/subscribers/default/HandledException.ts
1664
- let HandledException = class HandledException extends WebhookLog {
1665
- throttleKey() {
1666
- return `handledException:${this.data.origin}:${this.data.denial.name}`;
1667
- }
1668
- report(suppressed) {
1669
- return {
1670
- username: "Handled Exception",
1671
- components: [new HandledExceptionContainer(this.data, suppressed).component],
1672
- files: [jsonAttachment("source.json", "The raw source the fault came from", this.data.source.raw)]
1673
- };
1674
- }
1675
- };
1676
- HandledException = __decorate([Subscribe("handledException"), WebhookUrl("HANDLED_EXCEPTION_WEBHOOK_URL")], HandledException);
1677
- var HandledExceptionContainer = class extends BuilderComponent {
1678
- constructor(data, suppressed) {
1679
- super("container");
1680
- const { denial, uuid, source } = data;
1681
- this.instance.addTextDisplayComponents((text) => text.setContent(faultSummary(denial, source))).addSeparatorComponents(new WebhookSeparator().component).addTextDisplayComponents((text) => text.setContent(`### UUID \`${uuid}\`\n\`\`\`${breakBackticks(causeStack(denial))}\`\`\``)).addSeparatorComponents(new WebhookSeparator().component).addTextDisplayComponents((text) => text.setContent("### Source")).addFileComponents((file) => file.setURL("attachment://source.json"));
1682
- this.addSuppressedCount(suppressed);
1683
- }
1684
- addSuppressedCount(suppressed) {
1685
- if (suppressed === 0) return;
1686
- this.instance.addTextDisplayComponents((text) => text.setContent(`-# ${suppressed} more of these since the last report`));
1687
- }
1688
- };
1689
- function faultSummary(denial, source) {
1690
- const head = stripAnsi(`### A handled fault was reported: \`${denial.name}\`\n**Message:** ${denial.message}\n`);
1691
- if (source.kind === "event") return `${head}**Event:** ${source.eventName}\n**Handler:** ${source.handler}\n**User ID:** \`${source.userId ?? "n/a"}\`\n**Guild ID:** \`${source.guildId ?? "n/a"}\`\n**Channel ID:** \`${source.channelId ?? "n/a"}\``;
1692
- return `${head}**Kind:** ${source.interactionKind}\n**Command:** ${source.command ?? "n/a"}\n**CustomId:** ${source.customId ?? "n/a"}\n**User ID:** \`${source.userId}\`\n**Guild ID:** \`${source.guildId ?? "n/a"}\`\n**Channel ID:** \`${source.channelId ?? "n/a"}\`\n**Interaction ID:** \`${source.interactionId}\``;
1693
- }
1694
- function causeStack(denial) {
1695
- const { cause } = denial;
1696
- if (Error.isError(cause)) return stripAnsi(cause.stack ?? cause.message);
1697
- if (typeof cause === "string") return stripAnsi(cause);
1698
- if (typeof cause === "bigint" || typeof cause === "symbol" || typeof cause === "function") return cause.toString();
1699
- if (cause !== void 0) try {
1700
- return JSON.stringify(cause);
1701
- } catch {
1702
- return "[unserializable cause]";
1703
- }
1704
- return stripAnsi(denial.stack ?? "No cause recorded.");
1705
- }
1706
-
1707
- //#endregion
1708
- //#region src/subscribers/default/UnknownException.ts
1709
- let UnknownException = class UnknownException extends WebhookLog {
1710
- throttleKey() {
1711
- return `unknownException:${this.data.origin}:${nameOf(this.data.error)}`;
1712
- }
1713
- report(suppressed) {
1714
- const { metadata } = this.data;
1715
- return {
1716
- username: "Unknown Exception",
1717
- components: [new UnhandledErrorContainer(this.data, suppressed).component],
1718
- files: metadata ? [jsonAttachment("metadata.json", "Metadata associated with the error", metadata)] : void 0
1719
- };
1720
- }
1721
- };
1722
- UnknownException = __decorate([Subscribe("unknownException"), WebhookUrl("UNKNOWN_EXCEPTION_WEBHOOK_URL")], UnknownException);
1723
- function nameOf(error) {
1724
- return error.name === "Error" ? error.constructor.name : error.name;
1725
- }
1726
- var UnhandledErrorContainer = class extends BuilderComponent {
1727
- constructor(data, suppressed) {
1728
- super("container");
1729
- const { uuid, error, guild, user, metadata } = data;
1730
- this.instance.addTextDisplayComponents((text) => text.setContent(`### An unknown exception was thrown\n**Guild ID:** \`${guild?.id ?? "Not used in a guild"}\`\n**Guild Name:** ${guild?.name ?? "Not used in a guild"}\n**User ID:** \`${user?.id ?? "Missing user info"}\`\n**Username:** ${user?.username ?? "Missing user info"}\n`)).addSeparatorComponents(new WebhookSeparator().component).addTextDisplayComponents((text) => text.setContent(`### UUID \`${uuid}\`\n\`\`\`${errorReport(error)}\`\`\``));
1731
- this.addTimestampsIfAvailable(error);
1732
- this.addMetadataIfAvailable(metadata);
1733
- this.addSuppressedCount(suppressed);
1734
- }
1735
- addSuppressedCount(suppressed) {
1736
- if (suppressed === 0) return;
1737
- this.instance.addTextDisplayComponents((text) => text.setContent(`-# ${suppressed} more of these since the last report`));
1738
- }
1739
- addTimestampsIfAvailable(error) {
1740
- if (!(error instanceof DiscordAPIError)) return;
1741
- const now = Date.now();
1742
- const snowflake = error.url.match(/\/interactions\/(\d+)\//)?.[1];
1743
- if (!snowflake) return void 0;
1744
- const interactionTs = timestampFromSnowflake(snowflake);
1745
- const diff = now - interactionTs;
1746
- const seconds = Math.floor(diff / 1e3);
1747
- const millis = diff % 1e3;
1748
- this.instance.addSeparatorComponents(new WebhookSeparator().component).addTextDisplayComponents((text) => text.setContent(`### Timestamps\n- **\`Interaction sent\` :** ${new Date(interactionTs).toISOString()} (${interactionTs})\n- **\`Error logged \` :** ${new Date(now).toISOString()} (${now})\n- **\`Offset \` :** ${seconds}s ${millis}ms`));
1749
- }
1750
- addMetadataIfAvailable(metadata) {
1751
- if (!metadata) return;
1752
- this.instance.addSeparatorComponents(new WebhookSeparator().component).addTextDisplayComponents((text) => text.setContent("### Metadata")).addFileComponents((file) => file.setURL("attachment://metadata.json"));
1753
- }
1754
- };
1755
-
1756
- //#endregion
1757
- //#region src/subscribers/slots.ts
1758
- const RegisterDefaults = Symbol("seedcord:bus:register-defaults");
1759
- const VerifyWebhooks = Symbol("seedcord:bus:verify-webhooks");
1760
- const RegisteredCount = Symbol("seedcord:bus:registered-count");
1761
- const RegisterSubscriber = Symbol("seedcord:bus:register");
1762
- const UnregisterSubscriber = Symbol("seedcord:bus:unregister");
1763
-
1764
- //#endregion
1765
- //#region src/subscribers/Bus.ts
1766
- const loggerSlot = Symbol("seedcord:bus:logger");
1767
- /**
1768
- * Registers and dispatches subscribers. Subscribers run on a programmatic or framework publish.
1769
- * Accessed via `core.bus`. Do not construct it directly.
1770
- */
1771
- var Bus = class extends TypedEventEmitter {
1772
- core;
1773
- logger = new Logger("Subscribers", { channel: "subscribers" });
1774
- /** @internal */
1775
- [loggerSlot] = this.logger;
1776
- subscribersMap = /* @__PURE__ */ new Map();
1777
- executedOnce = /* @__PURE__ */ new Set();
1778
- webhookProbes = /* @__PURE__ */ new Map();
1779
- constructor(core) {
1780
- super();
1781
- this.core = core;
1782
- }
1783
- /** @internal keep this inside start(). a bad webhook url thrown outside it never resets the singleton guard */
1784
- [RegisterDefaults]() {
1785
- this[RegisterSubscriber](registrationFor(UnknownException));
1786
- this[RegisterSubscriber](registrationFor(HandledException));
1787
- }
1788
- /** @internal */
1789
- [RegisterSubscriber](registration) {
1790
- if (!this.probeWebhook(registration.ctor)) return;
1791
- for (const key of registration.keys) {
1792
- let registrations = this.subscribersMap.get(key);
1793
- if (!registrations) {
1794
- registrations = [];
1795
- this.subscribersMap.set(key, registrations);
1796
- }
1797
- registrations.push(registration);
1798
- }
1799
- }
1800
- /** @internal */
1801
- [UnregisterSubscriber](ctor, keys) {
1802
- for (const key of keys ?? [...this.subscribersMap.keys()]) {
1803
- const registrations = this.subscribersMap.get(key);
1804
- if (!registrations) continue;
1805
- const index = registrations.findIndex((entry) => entry.ctor === ctor);
1806
- if (index !== -1) registrations.splice(index, 1);
1807
- }
1808
- }
1809
- /** @internal */
1810
- get [RegisteredCount]() {
1811
- return [...this.subscribersMap.values()].reduce((total, entries) => total + entries.length, 0);
1812
- }
1813
- /** @internal registration already dropped every reporter with no url set */
1814
- async [VerifyWebhooks]() {
1815
- const missing = [];
1816
- await Promise.all([...this.webhookProbes].map(async ([url, envKeys]) => {
1817
- const result = await WebhookLog.senderFor(url).verify();
1818
- if (result === "missing") missing.push(...envKeys);
1819
- else if (result === "unreachable") this.logger.warn(`could not verify webhook at ${envKeys.map((key) => paint.amber.bold(key)).join(", ")}`);
1820
- }));
1821
- if (missing.length > 0) throw new SeedcordError(SeedcordErrorCode.ConfigWebhookNotFound, [missing.join(", ")]);
1822
- }
1823
- probeWebhook(ctor) {
1824
- if (!(ctor.prototype instanceof WebhookLog)) return true;
1825
- const envKey = WebhookLog.envKeyOf(ctor);
1826
- const url = WebhookLog.urlOf(envKey);
1827
- if (url === null) {
1828
- this.logger.warn(`${paint.sky.bold(ctor.name)} disabled, ${paint.amber.bold(envKey)} is not set`);
1829
- return false;
1830
- }
1831
- const envKeys = this.webhookProbes.get(url) ?? [];
1832
- if (!envKeys.includes(envKey)) envKeys.push(envKey);
1833
- this.webhookProbes.set(url, envKeys);
1834
- return true;
1835
- }
1836
- /**
1837
- * Publishes an event to its subscribers and native listeners.
1838
- *
1839
- * Fire-and-forget. Subscriber handlers run asynchronously and this returns before they finish.
1840
- * Errors thrown by a subscriber or by an `on()` listener are caught and logged, never surfaced
1841
- * here. One throwing listener does not stop the others. Subscribers on one key run concurrently
1842
- * and carry no ordering guarantee. A `'once'` subscriber is marked as executed when it starts,
1843
- * even if it throws. It never runs twice.
1844
- *
1845
- * The framework's own keys are excluded. Subscribe to those and listen with `on`. The framework
1846
- * is their only publisher.
1847
- *
1848
- * @param event - The subscription key to publish
1849
- * @param data - Payload passed to each subscriber
1850
- * @returns Whether the underlying emitter had native listeners for the event
1851
- */
1852
- publish(event, data) {
1853
- return this.dispatchKey(event, data);
1854
- }
1855
- /**
1856
- * @deprecated Call {@link Bus.publish} to reach subscribers and listeners together.
1857
- * @throws A **SeedcordTypeError** every time, with `CoreBusEmitUnavailable`. `emit` reaches only the `on()` listeners.
1858
- */
1859
- emit(event, ..._args) {
1860
- throw new SeedcordTypeError(SeedcordErrorCode.CoreBusEmitUnavailable, [String(event)]);
1861
- }
1862
- /** @internal the framework's own publish path, keyed by a symbol no public entry exports */
1863
- [PublishDefault](event, data) {
1864
- return this.dispatchKey(event, data);
1865
- }
1866
- dispatchKey(event, data) {
1867
- this.processSubscriber(event, data);
1868
- return this.emitSafe(event, ...[data]);
1869
- }
1870
- onListenerError(error, event) {
1871
- this.logger.error(`listener for ${String(event)} threw`, error);
1872
- }
1873
- async processSubscriber(subscriberName, data) {
1874
- const registrations = this.subscribersMap.get(subscriberName);
1875
- if (!registrations) return;
1876
- const pending = registrations.reduce((acc, entry) => {
1877
- if (entry.frequency === "once") {
1878
- if (this.executedOnce.has(entry)) return acc;
1879
- this.executedOnce.add(entry);
1880
- }
1881
- acc.push(this.runSubscriber(entry, subscriberName, data));
1882
- return acc;
1883
- }, []);
1884
- await Promise.allSettled(pending);
1885
- }
1886
- async runSubscriber(entry, subscriberName, data) {
1887
- let name = "<unresolved>";
1888
- try {
1889
- const Ctor = entry.ctor;
1890
- name = Ctor.name;
1891
- await new Ctor(data, this.core).execute();
1892
- } catch (err) {
1893
- this.logger.error(`Error in subscriber ${paint.mute(String(subscriberName))} handler ${paint.sky.bold(name)}:`, err);
1894
- }
1895
- }
1896
- };
1897
- /** @internal */
1898
- function registrationFor(ctor) {
1899
- const meta = Reflect.getMetadata(SubscribeMetadataKey, ctor);
1900
- return {
1901
- keys: [meta.subscriber],
1902
- frequency: meta.frequency ?? "on",
1903
- ctor
1904
- };
1905
- }
1906
- /** @internal */
1907
- function busLoggerOf(bus) {
1908
- return bus[loggerSlot];
1909
- }
1910
-
1911
- //#endregion
1912
- export { RegisterInteractionMiddleware as $, rollbackCommits as A, guardedAccessor as At, NotInGuild as B, isBuilderComponentClass as Bt, PermissionNames as C, warnLinks as Ct, pickNotice as D, linkCommands as Dt, presentNames as E, indexById as Et, MissingPermissions as F, skippedNote as Ft, serializeReply as G, OnCooldown as H, Notice as Ht, MissingRole as I, contextMenuLeaves as It, publishResponse as J, translateSerializationError as K, NeedsAny as L, NoticeCard as Lt, runCommits as M, commandsRoute as Mt, GateNotice as N, globalFirst as Nt, discardCommits as O, accessorStore as Ot, HasDangerousPermissions as P, scopeIdsOf as Pt, sendTarget as Q, NotAllowed as R, BuilderComponent as Rt, RequireRole as S, installLinks as St, missingNames as T, commandRefOf as Tt, defineEffectGate as U, NotOwner as V, bindBotColor as Vt, defineGate as W, AckTrace as X, reportedWrite as Y, checkAckLegality as Z, pageCursor as _, SubscribeMetadataKey as _t, RegisterSubscriber as a, ComponentDefsKey as at, RequireBotPermissions as b, Commands as bt, VerifyWebhooks as c, RegisterCommand as ct, WebhookLog as d, EventMiddlewareMetadataKey as dt, interactionMiddlewareMetaOf as et, Subscriber as f, GatedMetadataKey as ft, PAGE_MAX as g, InteractionRouteKeys as gt, sendFlags as h, InteractionMiddlewareMetadataKey as ht, RegisterDefaults as i, storeInteractionRoute as it, runCheck as j, GLOBAL_ID as jt, markCommits as k, clearStore as kt, WebhookUrl as l, CommandMetadataKey as lt, deferFlags as m, InteractionMetadataKey as mt, busLoggerOf as n, interactionRoutesOf as nt, RegisteredCount as o, decodeComponentRoute as ot, ReportThrottle as p, InteractionKind as pt, attemptWrite as q, registrationFor as r, storeComponentRoute as rt, UnregisterSubscriber as s, ConfigGuilds as st, Bus as t, contextMenuRouteOf as tt, Subscribe as u, EventMetadataKey as ut, ResolvedEmoji as v, WebhookUrlMetadataKey as vt, hasAll as w, commandKey as wt, RequirePermissions as x, ContextMenus as xt, Silence as y, CommandInjector as yt, NotInDm as z, RowComponent as zt };
1913
- //# sourceMappingURL=subscribers-Ce3SWy23.mjs.map
1095
+ export { commandKey as $, serializeReply as A, contextMenuRouteOf as B, NotAllowed as C, OnCooldown as D, NotOwner as E, AckTrace as F, decodeComponentRoute as G, storeComponentRoute as H, checkAckLegality as I, CommandInjector as J, ConfigGuilds as K, sendTarget as L, attemptWrite as M, publishResponse as N, defineEffectGate as O, reportedWrite as P, warnLinks as Q, RegisterInteractionMiddleware as R, NeedsAny as S, NotInGuild as T, storeInteractionRoute as U, interactionRoutesOf as V, ComponentDefsKey as W, ContextMenus as X, Commands as Y, installLinks as Z, runCommits as _, RequireBotPermissions as a, guardedAccessor as at, MissingPermissions as b, PermissionNames as c, globalFirst as ct, presentNames as d, contextMenuLeaves as dt, commandRefOf as et, pickNotice as f, NoticeCard as ft, runCheck as g, rollbackCommits as h, Silence as i, clearStore as it, translateSerializationError as j, defineGate as k, hasAll as l, scopeIdsOf as lt, markCommits as m, pageCursor as n, linkCommands as nt, RequirePermissions as o, GLOBAL_ID as ot, discardCommits as p, Notice as pt, RegisterCommand as q, ResolvedEmoji as r, accessorStore as rt, RequireRole as s, commandsRoute as st, PAGE_MAX as t, indexById as tt, missingNames as u, skippedNote as ut, GateNotice as v, NotInDm as w, MissingRole as x, HasDangerousPermissions as y, interactionMiddlewareMetaOf as z };
1096
+ //# sourceMappingURL=subscribers-D4_HZcgw.mjs.map