lunibee 0.3.3 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/builders/commands.d.ts +1 -1
- package/dist/builders/components.d.ts +9 -11
- package/dist/builders/embed.d.ts +1 -1
- package/dist/builders/index.d.ts +1 -1
- package/dist/builders/index.js +87 -1298
- package/dist/builders/index.js.map +3 -11
- package/dist/chunks/index-0wn81eng.js +2492 -0
- package/dist/chunks/index-0wn81eng.js.map +17 -0
- package/dist/chunks/index-2en489j6.js +40 -0
- package/dist/chunks/index-2en489j6.js.map +10 -0
- package/dist/chunks/index-3hyps48a.js +203 -0
- package/dist/chunks/index-3hyps48a.js.map +11 -0
- package/dist/chunks/index-57c5n3ms.js +2274 -0
- package/dist/chunks/index-57c5n3ms.js.map +19 -0
- package/dist/chunks/index-5yx92e36.js +1170 -0
- package/dist/chunks/index-5yx92e36.js.map +14 -0
- package/dist/chunks/index-690bp093.js +95 -0
- package/dist/chunks/index-690bp093.js.map +10 -0
- package/dist/chunks/index-7fp2hvmg.js +2155 -0
- package/dist/chunks/index-7fp2hvmg.js.map +24 -0
- package/dist/chunks/index-cnmsajvk.js +1119 -0
- package/dist/chunks/index-cnmsajvk.js.map +12 -0
- package/dist/chunks/index-fdvgk2sw.js +1310 -0
- package/dist/chunks/index-fdvgk2sw.js.map +21 -0
- package/dist/chunks/index-gyvps8b9.js +214 -0
- package/dist/chunks/index-gyvps8b9.js.map +12 -0
- package/dist/chunks/index-jzg4bh99.js +1533 -0
- package/dist/chunks/index-jzg4bh99.js.map +21 -0
- package/dist/chunks/index-mgw2yvrm.js +3547 -0
- package/dist/chunks/index-mgw2yvrm.js.map +25 -0
- package/dist/chunks/index-yh76b55h.js +3449 -0
- package/dist/chunks/index-yh76b55h.js.map +29 -0
- package/dist/collection/index.js +9 -1118
- package/dist/collection/index.js.map +3 -6
- package/dist/core/api.d.ts +3 -3
- package/dist/core/channel-create.d.ts +2 -2
- package/dist/core/commands.d.ts +3 -3
- package/dist/core/events.d.ts +4 -4
- package/dist/core/handles.d.ts +4 -4
- package/dist/core/index.d.ts +25 -20
- package/dist/core/index.js +68 -10130
- package/dist/core/index.js.map +3 -65
- package/dist/core/permissions.d.ts +1 -1
- package/dist/core/redis-cache.d.ts +1 -1
- package/dist/formatters/index.js +41 -110
- package/dist/formatters/index.js.map +3 -4
- package/dist/handlers/index.js +5 -37
- package/dist/handlers/index.js.map +3 -4
- package/dist/index.d.ts +21 -21
- package/dist/index.js +641 -16325
- package/dist/index.js.map +3 -92
- package/dist/managers/advanced.d.ts +3 -3
- package/dist/managers/application.d.ts +2 -2
- package/dist/managers/base.d.ts +1 -1
- package/dist/managers/emoji.d.ts +2 -2
- package/dist/managers/guild-resources.d.ts +6 -6
- package/dist/managers/guild.d.ts +3 -3
- package/dist/managers/index.d.ts +4 -8
- package/dist/managers/index.js +51 -4060
- package/dist/managers/index.js.map +3 -29
- package/dist/managers/member.d.ts +2 -2
- package/dist/managers/message.d.ts +14 -6
- package/dist/managers/role.d.ts +2 -2
- package/dist/managers/thread.d.ts +3 -3
- package/dist/managers/user.d.ts +7 -4
- package/dist/rest/index.d.ts +10 -35
- package/dist/rest/index.js +57 -2184
- package/dist/rest/index.js.map +3 -18
- package/dist/rest/limiter.d.ts +9 -1
- package/dist/rest/webhook.d.ts +2 -8
- package/dist/sharding/bus.d.ts +2 -2
- package/dist/sharding/cluster.d.ts +45 -5
- package/dist/sharding/context.d.ts +45 -3
- package/dist/sharding/gateway-bot.d.ts +2 -1
- package/dist/sharding/health.d.ts +1 -1
- package/dist/sharding/identify.d.ts +12 -0
- package/dist/sharding/index.d.ts +44 -11
- package/dist/sharding/index.js +60 -4620
- package/dist/sharding/index.js.map +3 -33
- package/dist/sharding/supervisor.d.ts +4 -2
- package/dist/structures/audit-log.d.ts +1 -1
- package/dist/structures/base.d.ts +6 -6
- package/dist/structures/channels.d.ts +1 -1
- package/dist/structures/embed.d.ts +1 -1
- package/dist/structures/index.d.ts +14 -14
- package/dist/structures/index.js +109 -2382
- package/dist/structures/index.js.map +3 -16
- package/dist/structures/interactions.d.ts +13 -9
- package/dist/structures/options.d.ts +1 -1
- package/dist/structures/permissions.d.ts +2 -2
- package/dist/structures/resources.d.ts +10 -10
- package/dist/structures/sticker.d.ts +1 -1
- package/dist/types/gateway.d.ts +2 -79
- package/dist/types/index.d.ts +0 -6
- package/dist/types/index.js +41 -272
- package/dist/types/index.js.map +3 -6
- package/dist/utils/index.js +23 -209
- package/dist/utils/index.js.map +3 -5
- package/dist/voice/connection.d.ts +200 -0
- package/dist/voice/crypto.d.ts +50 -0
- package/dist/voice/dave.d.ts +85 -0
- package/dist/voice/effects.d.ts +31 -0
- package/dist/voice/emitter.d.ts +14 -0
- package/dist/voice/gateway.d.ts +59 -0
- package/dist/voice/index.d.ts +25 -228
- package/dist/voice/index.js +111 -442
- package/dist/voice/index.js.map +3 -4
- package/dist/voice/libopus.d.ts +88 -0
- package/dist/voice/networking.d.ts +80 -0
- package/dist/voice/ogg.d.ts +24 -0
- package/dist/voice/opus.d.ts +18 -0
- package/dist/voice/player.d.ts +79 -0
- package/dist/voice/protocol.d.ts +76 -0
- package/dist/voice/receiver.d.ts +59 -0
- package/dist/voice/resource.d.ts +102 -0
- package/dist/voice/udp.d.ts +40 -0
- package/dist/ws/close-codes.d.ts +1 -1
- package/dist/ws/index.d.ts +25 -4
- package/dist/ws/index.js +47 -1336
- package/dist/ws/index.js.map +3 -17
- package/dist/ws/protocol.d.ts +1 -1
- package/dist/ws/send-budget.d.ts +0 -2
- package/dist/ws/state.d.ts +0 -10
- package/package.json +19 -16
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* Permission bits and math live in `@lunibee/structures`, which needs them at
|
|
3
3
|
* runtime (member and role permissions); they are re-exported here unchanged.
|
|
4
4
|
*/
|
|
5
|
-
export { Permission, Permissions, PermissionFlagsBits, PermissionSet, PermissionsBitField, PermissionOverwriteEnum, computePermissions, type PermissionContext, type PermissionOverwrite, type PermissionRole, type PermissionName, type PermissionResolvable, } from "
|
|
5
|
+
export { Permission, Permissions, PermissionFlagsBits, PermissionSet, PermissionsBitField, PermissionOverwriteEnum, computePermissions, type PermissionContext, type PermissionOverwrite, type PermissionRole, type PermissionName, type PermissionResolvable, } from "../structures/index.js";
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* payloads, so any process — another cluster, a dashboard, a worker without
|
|
7
7
|
* a Gateway — can read any guild. It never replaces the synchronous cache.
|
|
8
8
|
*/
|
|
9
|
-
import type { RedisCommandClient } from "
|
|
9
|
+
import type { RedisCommandClient } from "../collection/index.js";
|
|
10
10
|
export type { RedisCommandClient };
|
|
11
11
|
/** What `attach()` listens to: a `Client` (its `raw` event) or a `Gateway` (`RAW`). */
|
|
12
12
|
export interface RawDispatchSource {
|
package/dist/formatters/index.js
CHANGED
|
@@ -1,114 +1,45 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
function italic(text) {
|
|
25
|
-
return `_${text}_`;
|
|
26
|
-
}
|
|
27
|
-
function underline(text) {
|
|
28
|
-
return `__${text}__`;
|
|
29
|
-
}
|
|
30
|
-
function strikethrough(text) {
|
|
31
|
-
return `~~${text}~~`;
|
|
32
|
-
}
|
|
33
|
-
function spoiler(text) {
|
|
34
|
-
return `||${text}||`;
|
|
35
|
-
}
|
|
36
|
-
function masked(text) {
|
|
37
|
-
return spoiler(text);
|
|
38
|
-
}
|
|
39
|
-
function inlineCode(text) {
|
|
40
|
-
return `\`${text}\``;
|
|
41
|
-
}
|
|
42
|
-
function codeBlock(text, language = "") {
|
|
43
|
-
const safe = text.replace(/`(?=`)/g, "`\u200B");
|
|
44
|
-
const lang = language.replace(/[^\w+#.-]/g, "");
|
|
45
|
-
return `\`\`\`${lang}
|
|
46
|
-
${safe}
|
|
47
|
-
\`\`\``;
|
|
48
|
-
}
|
|
49
|
-
function link(label, url, title) {
|
|
50
|
-
if (!/^(?:https?|discord):\/\//i.test(url))
|
|
51
|
-
throw new TypeError("link() only accepts http, https or discord URLs.");
|
|
52
|
-
const text = label.replace(/[[\]\\]/g, "\\$&").replace(/\n/g, " ");
|
|
53
|
-
const target = url.replace(/[()\s"]/g, (c) => `%${c.charCodeAt(0).toString(16).toUpperCase().padStart(2, "0")}`);
|
|
54
|
-
const titlePart = title ? ` "${title.replace(/["\n)]/g, "")}"` : "";
|
|
55
|
-
return `[${text}](${target}${titlePart})`;
|
|
56
|
-
}
|
|
57
|
-
function blockQuote(text) {
|
|
58
|
-
return text.split(`
|
|
59
|
-
`).map((line) => `> ${line}`).join(`
|
|
60
|
-
`);
|
|
61
|
-
}
|
|
62
|
-
function heading(text, level = 1) {
|
|
63
|
-
return `${"#".repeat(level)} ${text}`;
|
|
64
|
-
}
|
|
65
|
-
function subtext(text) {
|
|
66
|
-
return `-# ${text}`;
|
|
67
|
-
}
|
|
68
|
-
function orderedList(...items) {
|
|
69
|
-
return items.map((item, i) => `${i + 1}. ${item}`).join(`
|
|
70
|
-
`);
|
|
71
|
-
}
|
|
72
|
-
function bulletList(...items) {
|
|
73
|
-
return items.map((item) => `- ${item}`).join(`
|
|
74
|
-
`);
|
|
75
|
-
}
|
|
76
|
-
function escapeMarkdown(value) {
|
|
77
|
-
return value.replace(/[\\*_`~|>]/g, "\\$&");
|
|
78
|
-
}
|
|
79
|
-
function validateSnowflake(id, field) {
|
|
80
|
-
const len = id.length;
|
|
81
|
-
if (len < 1 || len > 20) {
|
|
82
|
-
throw new TypeError(`${field} must be a valid Discord snowflake.`);
|
|
83
|
-
}
|
|
84
|
-
for (let i = 0;i < len; i++) {
|
|
85
|
-
const code = id.charCodeAt(i);
|
|
86
|
-
if (code < 48 || code > 57) {
|
|
87
|
-
throw new TypeError(`${field} must be a valid Discord snowflake.`);
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
return id;
|
|
91
|
-
}
|
|
2
|
+
import {
|
|
3
|
+
userMention2,
|
|
4
|
+
channelMention2,
|
|
5
|
+
roleMention2,
|
|
6
|
+
timestamp2,
|
|
7
|
+
bold2,
|
|
8
|
+
italic2,
|
|
9
|
+
underline2,
|
|
10
|
+
strikethrough2,
|
|
11
|
+
spoiler2,
|
|
12
|
+
masked2,
|
|
13
|
+
inlineCode2,
|
|
14
|
+
codeBlock2,
|
|
15
|
+
link2,
|
|
16
|
+
blockQuote2,
|
|
17
|
+
heading2,
|
|
18
|
+
subtext2,
|
|
19
|
+
orderedList2,
|
|
20
|
+
bulletList2,
|
|
21
|
+
escapeMarkdown2
|
|
22
|
+
} from "../chunks/index-690bp093.js";
|
|
92
23
|
export {
|
|
93
|
-
blockQuote,
|
|
94
|
-
bold,
|
|
95
|
-
bulletList,
|
|
96
|
-
channelMention,
|
|
97
|
-
codeBlock,
|
|
98
|
-
escapeMarkdown,
|
|
99
|
-
heading,
|
|
100
|
-
inlineCode,
|
|
101
|
-
italic,
|
|
102
|
-
link,
|
|
103
|
-
masked,
|
|
104
|
-
orderedList,
|
|
105
|
-
roleMention,
|
|
106
|
-
spoiler,
|
|
107
|
-
strikethrough,
|
|
108
|
-
subtext,
|
|
109
|
-
timestamp,
|
|
110
|
-
underline,
|
|
111
|
-
userMention
|
|
24
|
+
blockQuote2 as blockQuote,
|
|
25
|
+
bold2 as bold,
|
|
26
|
+
bulletList2 as bulletList,
|
|
27
|
+
channelMention2 as channelMention,
|
|
28
|
+
codeBlock2 as codeBlock,
|
|
29
|
+
escapeMarkdown2 as escapeMarkdown,
|
|
30
|
+
heading2 as heading,
|
|
31
|
+
inlineCode2 as inlineCode,
|
|
32
|
+
italic2 as italic,
|
|
33
|
+
link2 as link,
|
|
34
|
+
masked2 as masked,
|
|
35
|
+
orderedList2 as orderedList,
|
|
36
|
+
roleMention2 as roleMention,
|
|
37
|
+
spoiler2 as spoiler,
|
|
38
|
+
strikethrough2 as strikethrough,
|
|
39
|
+
subtext2 as subtext,
|
|
40
|
+
timestamp2 as timestamp,
|
|
41
|
+
underline2 as underline,
|
|
42
|
+
userMention2 as userMention
|
|
112
43
|
};
|
|
113
44
|
|
|
114
|
-
//# debugId=
|
|
45
|
+
//# debugId=0CEDDFCB2026485264756E2164756E21
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": [
|
|
3
|
+
"sources": [],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
-
"// ─── Mentions ──────────────────────────────────────────────────────────────────\n\n/** Creates a user mention from a Discord snowflake. */\nexport function userMention(id: string): string {\n return `<@${validateSnowflake(id, \"User ID\")}>`;\n}\n\n/** Creates a channel mention from a Discord snowflake. */\nexport function channelMention(id: string): string {\n return `<#${validateSnowflake(id, \"Channel ID\")}>`;\n}\n\n/** Creates a role mention from a Discord snowflake. */\nexport function roleMention(id: string): string {\n return `<@&${validateSnowflake(id, \"Role ID\")}>`;\n}\n\n// ─── Timestamps ────────────────────────────────────────────────────────────────\n\n/** Discord timestamp style formats. */\nexport type TimestampStyle = \"t\" | \"T\" | \"d\" | \"D\" | \"f\" | \"F\" | \"R\";\n\n/** Creates a Discord timestamp tag.\n * @param unixSeconds Unix timestamp in seconds.\n * @param style Optional display style: t=short time, T=long time, d=short date, D=long date, f=short datetime, F=long datetime, R=relative.\n */\nexport function timestamp(\n unixSeconds: number,\n style?: TimestampStyle | string,\n): string {\n if (!Number.isFinite(unixSeconds))\n throw new TypeError(\"Timestamp must be a finite Unix timestamp.\");\n if (style !== undefined && !/^[tTdDfFR]$/.test(style))\n throw new RangeError(\"Invalid Discord timestamp style.\");\n if (!Number.isSafeInteger(Math.floor(unixSeconds)))\n throw new RangeError(\"Timestamp is out of range.\");\n return `<t:${Math.floor(unixSeconds)}${style ? `:${style}` : \"\"}>`;\n}\n\n// ─── Markdown ─────────────────────────────────────────────────────────────────\n\n/** Wraps text in Discord bold markdown. */\nexport function bold(text: string): string {\n return `**${text}**`;\n}\n\n/** Wraps text in Discord italic markdown. */\nexport function italic(text: string): string {\n return `_${text}_`;\n}\n\n/** Wraps text in Discord underline markdown. */\nexport function underline(text: string): string {\n return `__${text}__`;\n}\n\n/** Wraps text in Discord strikethrough markdown. */\nexport function strikethrough(text: string): string {\n return `~~${text}~~`;\n}\n\n/** Wraps text in a Discord spoiler tag (shown masked until clicked). */\nexport function spoiler(text: string): string {\n return `||${text}||`;\n}\n\n/** Alias for spoiler — hides text until revealed. */\nexport function masked(text: string): string {\n return spoiler(text);\n}\n\n/** Wraps text in Discord inline code. */\nexport function inlineCode(text: string): string {\n return `\\`${text}\\``;\n}\n\n/** Wraps text in a Discord fenced code block.\n * @param text Code content.\n * @param language Optional language identifier for syntax highlighting.\n */\nexport function codeBlock(text: string, language = \"\"): string {\n // A zero-width space between every two adjacent backticks: no run of any\n // length (```` included) can then form a closing fence.\n const safe = text.replace(/`(?=`)/g, \"`\\u200b\");\n const lang = language.replace(/[^\\w+#.-]/g, \"\");\n return `\\`\\`\\`${lang}\\n${safe}\\n\\`\\`\\``;\n}\n\n/** Creates a Discord masked hyperlink: [label](url).\n * @param label Display text.\n * @param url Destination URL.\n * @param title Optional hover title.\n */\nexport function link(label: string, url: string, title?: string): string {\n // Brackets in the label and parentheses, quotes or spaces in the URL would\n // otherwise end the link early and let the rest render as a second link.\n if (!/^(?:https?|discord):\\/\\//i.test(url))\n throw new TypeError(\"link() only accepts http, https or discord URLs.\");\n const text = label.replace(/[[\\]\\\\]/g, \"\\\\$&\").replace(/\\n/g, \" \");\n const target = url.replace(\n /[()\\s\"]/g,\n (c) =>\n `%${c.charCodeAt(0).toString(16).toUpperCase().padStart(2, \"0\")}`,\n );\n const titlePart = title ? ` \"${title.replace(/[\"\\n)]/g, \"\")}\"` : \"\";\n return `[${text}](${target}${titlePart})`;\n}\n\n/** Wraps each line of text in a Discord block quote (> prefix). */\nexport function blockQuote(text: string): string {\n return text\n .split(\"\\n\")\n .map((line) => `> ${line}`)\n .join(\"\\n\");\n}\n\n/** Creates a Discord heading at the given level (1–3). */\nexport function heading(text: string, level: 1 | 2 | 3 = 1): string {\n return `${\"#\".repeat(level)} ${text}`;\n}\n\n/** Wraps text in Discord's subtext markdown (-# prefix). */\nexport function subtext(text: string): string {\n return `-# ${text}`;\n}\n\n/** Creates a numbered ordered list from items. */\nexport function orderedList(...items: string[]): string {\n return items.map((item, i) => `${i + 1}. ${item}`).join(\"\\n\");\n}\n\n/** Creates an unordered bullet list from items. */\nexport function bulletList(...items: string[]): string {\n return items.map((item) => `- ${item}`).join(\"\\n\");\n}\n\n// ─── Utilities ─────────────────────────────────────────────────────────────────\n\n/**\n * Escapes the inline Discord markdown characters `\\ * _ ` ~ | >`. It does not\n * neutralise headings, lists or `[label](url)` links: pair it with\n * `allowedMentions` and never rely on it to sanitise untrusted text.\n */\nexport function escapeMarkdown(value: string): string {\n return value.replace(/[\\\\*_`~|>]/g, \"\\\\$&\");\n}\n\nfunction validateSnowflake(id: string, field: string): string {\n const len = id.length;\n if (len < 1 || len > 20) {\n throw new TypeError(`${field} must be a valid Discord snowflake.`);\n }\n for (let i = 0; i < len; i++) {\n const code = id.charCodeAt(i);\n if (code < 48 || code > 57) {\n throw new TypeError(`${field} must be a valid Discord snowflake.`);\n }\n }\n return id;\n}\n"
|
|
6
5
|
],
|
|
7
|
-
"mappings": "
|
|
8
|
-
"debugId": "
|
|
6
|
+
"mappings": "",
|
|
7
|
+
"debugId": "0CEDDFCB2026485264756E2164756E21",
|
|
9
8
|
"names": []
|
|
10
9
|
}
|
package/dist/handlers/index.js
CHANGED
|
@@ -1,41 +1,9 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
on(event, handler) {
|
|
6
|
-
(this.#handlers[event] ??= new Set).add(handler);
|
|
7
|
-
return this;
|
|
8
|
-
}
|
|
9
|
-
once(event, handler) {
|
|
10
|
-
const wrapped = (...args) => {
|
|
11
|
-
this.off(event, wrapped);
|
|
12
|
-
return handler(...args);
|
|
13
|
-
};
|
|
14
|
-
return this.on(event, wrapped);
|
|
15
|
-
}
|
|
16
|
-
off(event, handler) {
|
|
17
|
-
this.#handlers[event]?.delete(handler);
|
|
18
|
-
return this;
|
|
19
|
-
}
|
|
20
|
-
async dispatch(event, ...args) {
|
|
21
|
-
const errors = [];
|
|
22
|
-
for (const handler of this.#handlers[event] ?? [])
|
|
23
|
-
try {
|
|
24
|
-
await handler(...args);
|
|
25
|
-
} catch (error) {
|
|
26
|
-
errors.push(error);
|
|
27
|
-
}
|
|
28
|
-
if (errors.length === 1)
|
|
29
|
-
throw errors[0];
|
|
30
|
-
if (errors.length > 1)
|
|
31
|
-
throw new AggregateError(errors, "Several handlers failed.");
|
|
32
|
-
}
|
|
33
|
-
emit(event, ...args) {
|
|
34
|
-
return this.dispatch(event, ...args);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
2
|
+
import {
|
|
3
|
+
HandlerRegistry2
|
|
4
|
+
} from "../chunks/index-2en489j6.js";
|
|
37
5
|
export {
|
|
38
|
-
HandlerRegistry
|
|
6
|
+
HandlerRegistry2 as HandlerRegistry
|
|
39
7
|
};
|
|
40
8
|
|
|
41
|
-
//# debugId=
|
|
9
|
+
//# debugId=5F6A6CC05F6CA6B264756E2164756E21
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": [
|
|
3
|
+
"sources": [],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
-
"/** A typed handler registry for Lunibee events. */\nexport class HandlerRegistry<\n Events extends { [K in keyof Events]: unknown[] },\n> {\n /** Registered event handlers. */\n readonly #handlers: {\n [K in keyof Events]?: Set<(...args: Events[K]) => unknown>;\n } = {};\n /** Registers a handler for an event. @param event Event key. @param handler Handler callback. @returns This registry. */\n public on<K extends keyof Events>(\n event: K,\n handler: (...args: Events[K]) => unknown,\n ): this {\n (this.#handlers[event] ??= new Set()).add(handler);\n return this;\n }\n /** Registers a one-shot handler. @param event Event key. @param handler Handler callback. @returns This registry. */\n public once<K extends keyof Events>(\n event: K,\n handler: (...args: Events[K]) => unknown,\n ): this {\n const wrapped = (...args: Events[K]) => {\n this.off(event, wrapped);\n return handler(...args);\n };\n return this.on(event, wrapped);\n }\n /** Removes a handler. @param event Event key. @param handler Handler callback. @returns This registry. */\n public off<K extends keyof Events>(\n event: K,\n handler: (...args: Events[K]) => unknown,\n ): this {\n this.#handlers[event]?.delete(handler);\n return this;\n }\n /** Dispatches an event to registered handlers. @param event Event key. @param args Event arguments. @returns A promise fulfilled after handlers complete. */\n public async dispatch<K extends keyof Events>(\n event: K,\n ...args: Events[K]\n ): Promise<void> {\n const errors: unknown[] = [];\n for (const handler of this.#handlers[event] ?? [])\n try {\n await handler(...args);\n } catch (error) {\n errors.push(error);\n }\n if (errors.length === 1) throw errors[0];\n if (errors.length > 1)\n throw new AggregateError(errors, \"Several handlers failed.\");\n }\n /** Emits an event using the conventional emitter name. @param event Event key. @param args Event arguments. @returns A promise fulfilled after handlers complete. */\n public emit<K extends keyof Events>(\n event: K,\n ...args: Events[K]\n ): Promise<void> {\n return this.dispatch(event, ...args);\n }\n}\n"
|
|
6
5
|
],
|
|
7
|
-
"mappings": "
|
|
8
|
-
"debugId": "
|
|
6
|
+
"mappings": "",
|
|
7
|
+
"debugId": "5F6A6CC05F6CA6B264756E2164756E21",
|
|
9
8
|
"names": []
|
|
10
9
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
export * from "
|
|
2
|
-
export * from "
|
|
3
|
-
export * from "
|
|
4
|
-
export * from "
|
|
5
|
-
export * from "
|
|
6
|
-
export * from "
|
|
7
|
-
export * from "
|
|
8
|
-
export * from "
|
|
9
|
-
export * from "
|
|
10
|
-
export * from "
|
|
11
|
-
export * from "
|
|
12
|
-
export type { Snowflake, GatewayIntentResolvable, GatewayProperties, GatewayPresenceActivity, GatewayPresence, ClientOptions, RESTOptions, UserData,
|
|
13
|
-
export { GatewayIntentBits, IntentBits,
|
|
14
|
-
export * from "
|
|
15
|
-
export { CommandInteraction, ContextMenuCommandInteraction, ComponentInteraction, ModalSubmitInteraction, AutocompleteInteraction, Interaction, GuildMember, Role, TextChannel, Message, Embed, Webhook, AuditLog, AuditLogEntry, } from "
|
|
16
|
-
export { CreateEmbed, CreateSlashCommand, CreateButton, ButtonType, CreateStringSelect, CreateEntitySelect, CreateModal, CreateTextInput, TextInputType, CreateActionRow, CreateAttachment, } from "
|
|
17
|
-
export type { APIActionRowComponent as APIActionRowPayload, APIButtonComponent as APIButtonPayload, APITextInputComponent as APITextInputPayload, } from "
|
|
18
|
-
export { Gateway } from "
|
|
19
|
-
export type { GatewayOptions } from "
|
|
20
|
-
export { Collection, Cache } from "
|
|
21
|
-
export { REST, RESTError, Routes, WebhookClient, type WebhookClientOptions, type WebhookMessageOptions, } from "
|
|
1
|
+
export * from "./core/index.js";
|
|
2
|
+
export * from "./collection/index.js";
|
|
3
|
+
export * from "./formatters/index.js";
|
|
4
|
+
export * from "./handlers/index.js";
|
|
5
|
+
export * from "./managers/index.js";
|
|
6
|
+
export * from "./rest/index.js";
|
|
7
|
+
export * from "./sharding/index.js";
|
|
8
|
+
export * from "./structures/index.js";
|
|
9
|
+
export * from "./utils/index.js";
|
|
10
|
+
export * from "./voice/index.js";
|
|
11
|
+
export * from "./ws/index.js";
|
|
12
|
+
export type { Snowflake, GatewayIntentResolvable, GatewayProperties, GatewayPresenceActivity, GatewayPresence, ClientOptions, RESTOptions, UserData, GatewayPayload, APIError, APIEmbedFooter, APIEmbedMedia, APIEmbedProvider, APIEmbedAuthor, APIEmbedField, APIEmbed, APISelectMenuOption, APIPartialEmoji, APIButtonComponent, APISelectMenuComponent, APITextInputComponent, APIMessageActionRowComponent, APIActionRowComponent, APIMessageComponent, APIAttachment, APIStickerItem, APISticker, APIMessageReference, APIMessageReaction, APIMessage, APIPoll, APIMessageSnapshot, APIChannel, APIThreadMetadata, APIForumTag, APIThreadMember, APIRole, APIEmoji, APIGuild, APIGuildMember, APIVoiceState, APIVoiceServerUpdate, APIActivity, APIPresenceUpdate, APITypingStart, APIInviteCreate, APIInviteDelete, APIWebhooksUpdate, APIWebhook, APIAutoModerationAction, APIAutoModerationRule, APIAutoModerationActionExecution, APIGuildScheduledEventEntityMetadata, APIGuildScheduledEvent, APIStageInstance, APIApplicationCommandOption, APIApplicationCommand, ApplicationCommandData, APIReadyEvent, APIMessageReactionEvent, APIMessageReactionRemoveEmojiEvent, APIMessageDeleteEvent, APIMessageDeleteBulkEvent, APIChannelDeleteEvent, APIGuildDeleteEvent, APIThreadEvent, APIThreadListSync, APIThreadMembersUpdate, APIGuildRoleEvent, APIGuildRoleDeleteEvent, APIGuildBanEvent, APIGuildEmojisUpdateEvent, APIGuildStickersUpdateEvent, APIChannelPinsUpdate, APIGuildMembersChunk, APIGuildScheduledEventUserEvent, APIMessagePollVoteEvent, APIRoleColors, APIWelcomeScreen, APIWelcomeScreenChannel, APIGuildOnboarding, APIOnboardingPrompt, APIOnboardingOption, ChannelKind, ForumTagInput, MessagePoll, UnknownChannelKind, } from "./types/index.js";
|
|
13
|
+
export { GatewayIntentBits, IntentBits, resolveGatewayIntents, MessageFlags, ChannelEnum, ApplicationCommandOptionEnum, ApplicationCommandEnum, StickerFormatEnum, StickerEnum, ActivityEnum, VerificationLevel, PremiumTier, ChannelKinds, channelKindOf, channelTypesOf, } from "./types/index.js";
|
|
14
|
+
export * from "./builders/index.js";
|
|
15
|
+
export { CommandInteraction, ContextMenuCommandInteraction, ComponentInteraction, ModalSubmitInteraction, AutocompleteInteraction, Interaction, GuildMember, Role, TextChannel, Message, Embed, Webhook, AuditLog, AuditLogEntry, } from "./structures/index.js";
|
|
16
|
+
export { CreateEmbed, CreateSlashCommand, CreateButton, ButtonType, CreateStringSelect, CreateEntitySelect, CreateModal, CreateTextInput, TextInputType, CreateActionRow, CreateAttachment, } from "./builders/index.js";
|
|
17
|
+
export type { APIActionRowComponent as APIActionRowPayload, APIButtonComponent as APIButtonPayload, APITextInputComponent as APITextInputPayload, } from "./builders/index.js";
|
|
18
|
+
export { Gateway } from "./ws/index.js";
|
|
19
|
+
export type { GatewayOptions } from "./ws/index.js";
|
|
20
|
+
export { Collection, Cache } from "./collection/index.js";
|
|
21
|
+
export { REST, RESTError, Routes, WebhookClient, type WebhookClientOptions, type WebhookMessageOptions, } from "./rest/index.js";
|