lunibee 0.1.6 → 0.1.8

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 (80) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +223 -223
  3. package/dist/builders/commands.d.ts +39 -0
  4. package/dist/builders/components.d.ts +37 -12
  5. package/dist/builders/embed.d.ts +3 -1
  6. package/dist/builders/index.d.ts +2 -2
  7. package/dist/builders/index.js +192 -29
  8. package/dist/builders/index.js.map +9 -7
  9. package/dist/collection/index.d.ts +30 -0
  10. package/dist/collection/index.js +79 -5
  11. package/dist/collection/index.js.map +4 -4
  12. package/dist/core/events.d.ts +88 -2
  13. package/dist/core/index.d.ts +46 -85
  14. package/dist/core/index.js +2395 -789
  15. package/dist/core/index.js.map +44 -22
  16. package/dist/core/permissions.d.ts +112 -53
  17. package/dist/formatters/index.d.ts +43 -3
  18. package/dist/formatters/index.js +64 -1
  19. package/dist/formatters/index.js.map +3 -3
  20. package/dist/handlers/index.js.map +2 -2
  21. package/dist/index.d.ts +2 -2
  22. package/dist/index.js +3783 -1009
  23. package/dist/index.js.map +63 -38
  24. package/dist/managers/emoji.d.ts +38 -0
  25. package/dist/managers/guild-resources.d.ts +109 -0
  26. package/dist/managers/guild.d.ts +117 -1
  27. package/dist/managers/index.d.ts +37 -1
  28. package/dist/managers/index.js +1125 -81
  29. package/dist/managers/index.js.map +25 -20
  30. package/dist/rest/decoder.d.ts +23 -0
  31. package/dist/rest/errors.d.ts +20 -0
  32. package/dist/rest/index.d.ts +119 -25
  33. package/dist/rest/index.js +676 -204
  34. package/dist/rest/index.js.map +14 -6
  35. package/dist/rest/limiter.d.ts +42 -0
  36. package/dist/rest/redis.d.ts +54 -0
  37. package/dist/rest/route.d.ts +31 -0
  38. package/dist/rest/routes.d.ts +24 -0
  39. package/dist/rest/scheduler.d.ts +42 -0
  40. package/dist/rest/store.d.ts +67 -0
  41. package/dist/rest/transport.d.ts +40 -0
  42. package/dist/rest/webhook.d.ts +2 -2
  43. package/dist/sharding/bus.d.ts +31 -0
  44. package/dist/sharding/cluster.d.ts +71 -0
  45. package/dist/sharding/index.d.ts +18 -2
  46. package/dist/sharding/index.js +1202 -317
  47. package/dist/sharding/index.js.map +18 -7
  48. package/dist/structures/audit-log.d.ts +26 -0
  49. package/dist/structures/base.d.ts +40 -0
  50. package/dist/structures/channels.d.ts +56 -0
  51. package/dist/structures/index.d.ts +30 -1
  52. package/dist/structures/index.js +963 -87
  53. package/dist/structures/index.js.map +17 -10
  54. package/dist/structures/interactions.d.ts +12 -52
  55. package/dist/structures/options.d.ts +55 -0
  56. package/dist/structures/resources.d.ts +194 -6
  57. package/dist/types/gateway-events.d.ts +132 -0
  58. package/dist/types/gateway.d.ts +181 -0
  59. package/dist/types/index.d.ts +78 -263
  60. package/dist/types/index.js +44 -2
  61. package/dist/types/index.js.map +5 -4
  62. package/dist/utils/index.js.map +2 -2
  63. package/dist/voice/index.d.ts +116 -0
  64. package/dist/voice/index.js +261 -10
  65. package/dist/voice/index.js.map +3 -3
  66. package/dist/ws/close-codes.d.ts +23 -0
  67. package/dist/ws/decoder.d.ts +58 -0
  68. package/dist/ws/heartbeat.d.ts +87 -0
  69. package/dist/ws/index.d.ts +24 -32
  70. package/dist/ws/index.js +920 -318
  71. package/dist/ws/index.js.map +15 -5
  72. package/dist/ws/opcodes.d.ts +14 -0
  73. package/dist/ws/protocol.d.ts +110 -0
  74. package/dist/ws/reconnect.d.ts +108 -0
  75. package/dist/ws/send-budget.d.ts +17 -0
  76. package/dist/ws/session.d.ts +100 -0
  77. package/dist/ws/state.d.ts +27 -0
  78. package/dist/ws/transport.d.ts +80 -0
  79. package/package.json +23 -22
  80. package/dist/structures/permissions.d.ts +0 -73
@@ -107,58 +107,67 @@ export declare const Permissions: {
107
107
  readonly SendPolls: bigint;
108
108
  readonly UseExternalApps: bigint;
109
109
  };
110
- /** Permission Flags Enum. */
111
- export declare enum PermissionFlagsBits {
112
- CreateInstantInvite = "1",
113
- KickMembers = "2",
114
- BanMembers = "4",
115
- Administrator = "8",
116
- ManageChannels = "16",
117
- ManageGuild = "32",
118
- AddReactions = "64",
119
- ViewAuditLog = "128",
120
- PrioritySpeaker = "256",
121
- Stream = "512",
122
- ViewChannel = "1024",
123
- SendMessages = "2048",
124
- SendTTSMessages = "4096",
125
- ManageMessages = "8192",
126
- EmbedLinks = "16384",
127
- AttachFiles = "32768",
128
- ReadMessageHistory = "65536",
129
- MentionEveryone = "131072",
130
- UseExternalEmojis = "262144",
131
- ViewGuildInsights = "524288",
132
- Connect = "1048576",
133
- Speak = "2097152",
134
- MuteMembers = "4194304",
135
- DeafenMembers = "8388608",
136
- MoveMembers = "16777216",
137
- UseVAD = "33554432",
138
- ChangeNickname = "67108864",
139
- ManageNicknames = "134217728",
140
- ManageRoles = "268435456",
141
- ManageWebhooks = "536870912",
142
- ManageGuildExpressions = "1073741824",
143
- UseApplicationCommands = "2147483648",
144
- RequestToSpeak = "4294967296",
145
- ManageEvents = "8589934592",
146
- ManageThreads = "17179869184",
147
- CreatePublicThreads = "34359738368",
148
- CreatePrivateThreads = "68719476736",
149
- UseExternalStickers = "137438953472",
150
- SendMessagesInThreads = "274877906944",
151
- UseEmbeddedActivities = "549755813888",
152
- ModerateMembers = "1099511627776",
153
- ViewCreatorMonetizationAnalytics = "2199023255552",
154
- UseSoundboard = "4398046511104",
155
- CreateGuildExpressions = "8796093022208",
156
- CreateEvents = "17592186044416",
157
- UseExternalSounds = "35184372088832",
158
- SendVoiceMessages = "70368744177664",
159
- SendPolls = "562949953421312",
160
- UseExternalApps = "1125899906842624"
161
- }
110
+ /**
111
+ * Permission flag bits with **bigint** values matching Discord's permission bit
112
+ * positions. Mirrors discord.js's `PermissionFlagsBits`, so bitwise composition
113
+ * (`Flags.A | Flags.B`) OR-s the bits instead of concatenating strings.
114
+ *
115
+ * Implemented as a `const` object rather than a TS `enum` because enums cannot
116
+ * hold bigint members; the same-named union type below preserves usage as a type.
117
+ */
118
+ export declare const PermissionFlagsBits: {
119
+ readonly CreateInstantInvite: bigint;
120
+ readonly KickMembers: bigint;
121
+ readonly BanMembers: bigint;
122
+ readonly Administrator: bigint;
123
+ readonly ManageChannels: bigint;
124
+ readonly ManageGuild: bigint;
125
+ readonly AddReactions: bigint;
126
+ readonly ViewAuditLog: bigint;
127
+ readonly PrioritySpeaker: bigint;
128
+ readonly Stream: bigint;
129
+ readonly ViewChannel: bigint;
130
+ readonly SendMessages: bigint;
131
+ readonly SendTTSMessages: bigint;
132
+ readonly ManageMessages: bigint;
133
+ readonly EmbedLinks: bigint;
134
+ readonly AttachFiles: bigint;
135
+ readonly ReadMessageHistory: bigint;
136
+ readonly MentionEveryone: bigint;
137
+ readonly UseExternalEmojis: bigint;
138
+ readonly ViewGuildInsights: bigint;
139
+ readonly Connect: bigint;
140
+ readonly Speak: bigint;
141
+ readonly MuteMembers: bigint;
142
+ readonly DeafenMembers: bigint;
143
+ readonly MoveMembers: bigint;
144
+ readonly UseVAD: bigint;
145
+ readonly ChangeNickname: bigint;
146
+ readonly ManageNicknames: bigint;
147
+ readonly ManageRoles: bigint;
148
+ readonly ManageWebhooks: bigint;
149
+ readonly ManageGuildExpressions: bigint;
150
+ readonly UseApplicationCommands: bigint;
151
+ readonly RequestToSpeak: bigint;
152
+ readonly ManageEvents: bigint;
153
+ readonly ManageThreads: bigint;
154
+ readonly CreatePublicThreads: bigint;
155
+ readonly CreatePrivateThreads: bigint;
156
+ readonly UseExternalStickers: bigint;
157
+ readonly SendMessagesInThreads: bigint;
158
+ readonly UseEmbeddedActivities: bigint;
159
+ readonly ModerateMembers: bigint;
160
+ readonly ViewCreatorMonetizationAnalytics: bigint;
161
+ readonly UseSoundboard: bigint;
162
+ readonly CreateGuildExpressions: bigint;
163
+ readonly CreateEvents: bigint;
164
+ readonly UseExternalSounds: bigint;
165
+ readonly SendVoiceMessages: bigint;
166
+ readonly SendPolls: bigint;
167
+ readonly UseExternalApps: bigint;
168
+ };
169
+ /** Union of {@link PermissionFlagsBits} values (all bigint). */
170
+ export type PermissionFlagsBits = (typeof PermissionFlagsBits)[keyof typeof PermissionFlagsBits];
162
171
  export type PermissionName = keyof typeof Permission | keyof typeof Permissions | keyof typeof PermissionFlagsBits;
163
172
  export type PermissionResolvable = bigint | number | string | PermissionName | PermissionFlagsBits | PermissionSet | PermissionResolvable[];
164
173
  /** Immutable permission bitfield with direct boolean getters. */
@@ -235,7 +244,57 @@ export declare class PermissionSet {
235
244
  /** Permissions bitfield alias. */
236
245
  export declare class PermissionsBitField extends PermissionSet {
237
246
  /** Permission flags bits enum. */
238
- static readonly Flags: typeof PermissionFlagsBits;
247
+ static readonly Flags: {
248
+ readonly CreateInstantInvite: bigint;
249
+ readonly KickMembers: bigint;
250
+ readonly BanMembers: bigint;
251
+ readonly Administrator: bigint;
252
+ readonly ManageChannels: bigint;
253
+ readonly ManageGuild: bigint;
254
+ readonly AddReactions: bigint;
255
+ readonly ViewAuditLog: bigint;
256
+ readonly PrioritySpeaker: bigint;
257
+ readonly Stream: bigint;
258
+ readonly ViewChannel: bigint;
259
+ readonly SendMessages: bigint;
260
+ readonly SendTTSMessages: bigint;
261
+ readonly ManageMessages: bigint;
262
+ readonly EmbedLinks: bigint;
263
+ readonly AttachFiles: bigint;
264
+ readonly ReadMessageHistory: bigint;
265
+ readonly MentionEveryone: bigint;
266
+ readonly UseExternalEmojis: bigint;
267
+ readonly ViewGuildInsights: bigint;
268
+ readonly Connect: bigint;
269
+ readonly Speak: bigint;
270
+ readonly MuteMembers: bigint;
271
+ readonly DeafenMembers: bigint;
272
+ readonly MoveMembers: bigint;
273
+ readonly UseVAD: bigint;
274
+ readonly ChangeNickname: bigint;
275
+ readonly ManageNicknames: bigint;
276
+ readonly ManageRoles: bigint;
277
+ readonly ManageWebhooks: bigint;
278
+ readonly ManageGuildExpressions: bigint;
279
+ readonly UseApplicationCommands: bigint;
280
+ readonly RequestToSpeak: bigint;
281
+ readonly ManageEvents: bigint;
282
+ readonly ManageThreads: bigint;
283
+ readonly CreatePublicThreads: bigint;
284
+ readonly CreatePrivateThreads: bigint;
285
+ readonly UseExternalStickers: bigint;
286
+ readonly SendMessagesInThreads: bigint;
287
+ readonly UseEmbeddedActivities: bigint;
288
+ readonly ModerateMembers: bigint;
289
+ readonly ViewCreatorMonetizationAnalytics: bigint;
290
+ readonly UseSoundboard: bigint;
291
+ readonly CreateGuildExpressions: bigint;
292
+ readonly CreateEvents: bigint;
293
+ readonly UseExternalSounds: bigint;
294
+ readonly SendVoiceMessages: bigint;
295
+ readonly SendPolls: bigint;
296
+ readonly UseExternalApps: bigint;
297
+ };
239
298
  /** Permission flags constants. */
240
299
  static readonly All: {
241
300
  readonly createInstantInvite: bigint;
@@ -4,7 +4,47 @@ export declare function userMention(id: string): string;
4
4
  export declare function channelMention(id: string): string;
5
5
  /** Creates a role mention from a Discord snowflake. */
6
6
  export declare function roleMention(id: string): string;
7
- /** Creates a Discord timestamp tag. */
8
- export declare function timestamp(unixSeconds: number, style?: string): string;
9
- /** Escapes Discord markdown control characters. */
7
+ /** Discord timestamp style formats. */
8
+ export type TimestampStyle = "t" | "T" | "d" | "D" | "f" | "F" | "R";
9
+ /** Creates a Discord timestamp tag.
10
+ * @param unixSeconds Unix timestamp in seconds.
11
+ * @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.
12
+ */
13
+ export declare function timestamp(unixSeconds: number, style?: TimestampStyle | string): string;
14
+ /** Wraps text in Discord bold markdown. */
15
+ export declare function bold(text: string): string;
16
+ /** Wraps text in Discord italic markdown. */
17
+ export declare function italic(text: string): string;
18
+ /** Wraps text in Discord underline markdown. */
19
+ export declare function underline(text: string): string;
20
+ /** Wraps text in Discord strikethrough markdown. */
21
+ export declare function strikethrough(text: string): string;
22
+ /** Wraps text in a Discord spoiler tag (shown masked until clicked). */
23
+ export declare function spoiler(text: string): string;
24
+ /** Alias for spoiler — hides text until revealed. */
25
+ export declare function masked(text: string): string;
26
+ /** Wraps text in Discord inline code. */
27
+ export declare function inlineCode(text: string): string;
28
+ /** Wraps text in a Discord fenced code block.
29
+ * @param text Code content.
30
+ * @param language Optional language identifier for syntax highlighting.
31
+ */
32
+ export declare function codeBlock(text: string, language?: string): string;
33
+ /** Creates a Discord masked hyperlink: [label](url).
34
+ * @param label Display text.
35
+ * @param url Destination URL.
36
+ * @param title Optional hover title.
37
+ */
38
+ export declare function link(label: string, url: string, title?: string): string;
39
+ /** Wraps each line of text in a Discord block quote (> prefix). */
40
+ export declare function blockQuote(text: string): string;
41
+ /** Creates a Discord heading at the given level (1–3). */
42
+ export declare function heading(text: string, level?: 1 | 2 | 3): string;
43
+ /** Wraps text in Discord's subtext markdown (-# prefix). */
44
+ export declare function subtext(text: string): string;
45
+ /** Creates a numbered ordered list from items. */
46
+ export declare function orderedList(...items: string[]): string;
47
+ /** Creates an unordered bullet list from items. */
48
+ export declare function bulletList(...items: string[]): string;
49
+ /** Escapes Discord markdown control characters in a string. */
10
50
  export declare function escapeMarkdown(value: string): string;
@@ -16,6 +16,55 @@ function timestamp(unixSeconds, style) {
16
16
  throw new RangeError("Invalid Discord timestamp style.");
17
17
  return `<t:${Math.floor(unixSeconds)}${style ? `:${style}` : ""}>`;
18
18
  }
19
+ function bold(text) {
20
+ return `**${text}**`;
21
+ }
22
+ function italic(text) {
23
+ return `_${text}_`;
24
+ }
25
+ function underline(text) {
26
+ return `__${text}__`;
27
+ }
28
+ function strikethrough(text) {
29
+ return `~~${text}~~`;
30
+ }
31
+ function spoiler(text) {
32
+ return `||${text}||`;
33
+ }
34
+ function masked(text) {
35
+ return spoiler(text);
36
+ }
37
+ function inlineCode(text) {
38
+ return `\`${text}\``;
39
+ }
40
+ function codeBlock(text, language = "") {
41
+ return `\`\`\`${language}
42
+ ${text}
43
+ \`\`\``;
44
+ }
45
+ function link(label, url, title) {
46
+ const titlePart = title ? ` "${title}"` : "";
47
+ return `[${label}](${url}${titlePart})`;
48
+ }
49
+ function blockQuote(text) {
50
+ return text.split(`
51
+ `).map((line) => `> ${line}`).join(`
52
+ `);
53
+ }
54
+ function heading(text, level = 1) {
55
+ return `${"#".repeat(level)} ${text}`;
56
+ }
57
+ function subtext(text) {
58
+ return `-# ${text}`;
59
+ }
60
+ function orderedList(...items) {
61
+ return items.map((item, i) => `${i + 1}. ${item}`).join(`
62
+ `);
63
+ }
64
+ function bulletList(...items) {
65
+ return items.map((item) => `- ${item}`).join(`
66
+ `);
67
+ }
19
68
  function escapeMarkdown(value) {
20
69
  return value.replace(/[\\*_`~|>]/g, "\\$&");
21
70
  }
@@ -33,11 +82,25 @@ function validateSnowflake(id, field) {
33
82
  return id;
34
83
  }
35
84
  export {
85
+ blockQuote,
86
+ bold,
87
+ bulletList,
36
88
  channelMention,
89
+ codeBlock,
37
90
  escapeMarkdown,
91
+ heading,
92
+ inlineCode,
93
+ italic,
94
+ link,
95
+ masked,
96
+ orderedList,
38
97
  roleMention,
98
+ spoiler,
99
+ strikethrough,
100
+ subtext,
39
101
  timestamp,
102
+ underline,
40
103
  userMention
41
104
  };
42
105
 
43
- //# debugId=73DCA2F128C2B50664756E2164756E21
106
+ //# debugId=5BA83CBED742A82864756E2164756E21
@@ -2,9 +2,9 @@
2
2
  "version": 3,
3
3
  "sources": ["../../packages/formatters/src/index.ts"],
4
4
  "sourcesContent": [
5
- "/** 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/** Creates a Discord timestamp tag. */\nexport function timestamp(unixSeconds: number, style?: string): 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 return `<t:${Math.floor(unixSeconds)}${style ? `:${style}` : \"\"}>`;\n}\n\n/** Escapes Discord markdown control characters. */\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"
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 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 return `\\`\\`\\`${language}\\n${text}\\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 const titlePart = title ? ` \"${title}\"` : \"\";\n return `[${label}](${url}${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/** Escapes Discord markdown control characters in a string. */\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
6
  ],
7
- "mappings": ";;AACO,SAAS,WAAW,CAAC,IAAoB;AAAA,EAC9C,OAAO,KAAK,kBAAkB,IAAI,SAAS;AAAA;AAItC,SAAS,cAAc,CAAC,IAAoB;AAAA,EACjD,OAAO,KAAK,kBAAkB,IAAI,YAAY;AAAA;AAIzC,SAAS,WAAW,CAAC,IAAoB;AAAA,EAC9C,OAAO,MAAM,kBAAkB,IAAI,SAAS;AAAA;AAIvC,SAAS,SAAS,CAAC,aAAqB,OAAwB;AAAA,EACrE,IAAI,CAAC,OAAO,SAAS,WAAW;AAAA,IAC9B,MAAM,IAAI,UAAU,4CAA4C;AAAA,EAClE,IAAI,UAAU,aAAa,CAAC,cAAc,KAAK,KAAK;AAAA,IAClD,MAAM,IAAI,WAAW,kCAAkC;AAAA,EACzD,OAAO,MAAM,KAAK,MAAM,WAAW,IAAI,QAAQ,IAAI,UAAU;AAAA;AAIxD,SAAS,cAAc,CAAC,OAAuB;AAAA,EACpD,OAAO,MAAM,QAAQ,eAAe,MAAM;AAAA;AAG5C,SAAS,iBAAiB,CAAC,IAAY,OAAuB;AAAA,EAC5D,MAAM,MAAM,GAAG;AAAA,EACf,IAAI,MAAM,KAAK,MAAM,IAAI;AAAA,IACvB,MAAM,IAAI,UAAU,GAAG,0CAA0C;AAAA,EACnE;AAAA,EACA,SAAS,IAAI,EAAG,IAAI,KAAK,KAAK;AAAA,IAC5B,MAAM,OAAO,GAAG,WAAW,CAAC;AAAA,IAC5B,IAAI,OAAO,MAAM,O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2
  "version": 3,
3
3
  "sources": ["../../packages/handlers/src/index.ts"],
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 = new Map<\n keyof Events,\n Set<(...args: any[]) => 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 let handlers = this.#handlers.get(event);\n if (!handlers) {\n handlers = new Set();\n this.#handlers.set(event, handlers);\n }\n handlers.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.get(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 for (const handler of this.#handlers.get(event) ?? [])\n await handler(...args);\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"
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 = new Map<\n keyof Events,\n Set<(...args: any[]) => 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 let handlers = this.#handlers.get(event);\n if (!handlers) {\n handlers = new Set();\n this.#handlers.set(event, handlers);\n }\n handlers.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.get(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 for (const handler of this.#handlers.get(event) ?? [])\n await handler(...args);\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
6
  ],
7
- "mappings": ";;AACO,MAAM,gBAEX;AAAA,EAES,YAAY,IAAI;AAAA,EAKlB,EAA0B,CAC/B,OACA,SACM;AAAA,IACN,IAAI,WAAW,KAAK,UAAU,IAAI,KAAK;AAAA,IACvC,IAAI,CAAC,UAAU;AAAA,MACb,WAAW,IAAI;AAAA,MACf,KAAK,UAAU,IAAI,OAAO,QAAQ;AAAA,IACpC;AAAA,IACA,SAAS,IAAI,OAAO;AAAA,IACpB,OAAO;AAAA;AAAA,EAGF,IAA4B,CACjC,OACA,SACM;AAAA,IACN,MAAM,UAAU,IAAI,SAAoB;AAAA,MACtC,KAAK,IAAI,OAAO,OAAO;AAAA,MACvB,OAAO,QAAQ,GAAG,IAAI;AAAA;AAAA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AI;AAAA;AAE3C;",
8
8
  "debugId": "C1392DF8895F311564756E2164756E21",
9
9
  "names": []
10
10
  }
package/dist/index.d.ts CHANGED
@@ -10,9 +10,9 @@ export * from "@lunibee/utils";
10
10
  export * from "@lunibee/voice";
11
11
  export * from "@lunibee/ws";
12
12
  export type { Snowflake, GatewayIntentResolvable, GatewayProperties, GatewayPresenceActivity, GatewayPresence, ClientOptions, RESTOptions, UserData, ClientUser, GatewayPayload, APIError, APIEmbedFooter, APIEmbedMedia, APIEmbedProvider, APIEmbedAuthor, APIEmbedField, APIEmbed, APISelectMenuOption, APIPartialEmoji, APIButtonComponent, APISelectMenuComponent, APITextInputComponent, APIMessageActionRowComponent, APIActionRowComponent, APIMessageComponent, APIAttachment, APIStickerItem, APISticker, APIMessageReference, APIMessageReaction, APIMessage, 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, } from "@lunibee/types";
13
- export { GatewayIntentBits, IntentBits, Intents, resolveGatewayIntents, MessageFlags, ChannelType, ApplicationCommandOptionType, ApplicationCommandType, StickerFormatType, StickerType, VerificationLevel, PremiumTier, } from "@lunibee/types";
13
+ export { GatewayIntentBits, IntentBits, Intents, IntentsBitField, resolveGatewayIntents, MessageFlags, ChannelType, ApplicationCommandOptionType, ApplicationCommandType, StickerFormatType, StickerType, VerificationLevel, PremiumTier, } from "@lunibee/types";
14
14
  export * from "@lunibee/builders";
15
- export { CommandInteraction, ComponentInteraction, ModalSubmitInteraction, AutocompleteInteraction, Interaction, GuildMember, Role, TextChannel, Message, Embed, } from "@lunibee/structures";
15
+ export { CommandInteraction, ComponentInteraction, ModalSubmitInteraction, AutocompleteInteraction, Interaction, GuildMember, Role, TextChannel, Message, Embed, Webhook, AuditLog, AuditLogEntry, } from "@lunibee/structures";
16
16
  export { EmbedBuilder, SlashCommandBuilder, ButtonBuilder, ButtonStyle, StringSelectBuilder, EntitySelectBuilder, ModalBuilder, TextInputBuilder, TextInputStyle, ActionRowBuilder, AttachmentBuilder, } from "@lunibee/builders";
17
17
  export { Gateway } from "@lunibee/ws";
18
18
  export type { GatewayOptions } from "@lunibee/ws";