lunibee 0.1.8 → 0.2.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 (44) hide show
  1. package/README.md +2 -0
  2. package/dist/builders/components.d.ts +5 -0
  3. package/dist/builders/index.js +72 -12
  4. package/dist/builders/index.js.map +5 -5
  5. package/dist/collection/index.d.ts +68 -1
  6. package/dist/collection/index.js +334 -1
  7. package/dist/collection/index.js.map +3 -3
  8. package/dist/core/collector.d.ts +13 -0
  9. package/dist/core/events.d.ts +29 -3
  10. package/dist/core/index.d.ts +22 -8
  11. package/dist/core/index.js +1526 -124
  12. package/dist/core/index.js.map +26 -22
  13. package/dist/core/permissions.d.ts +48 -0
  14. package/dist/index.js +1578 -268
  15. package/dist/index.js.map +30 -29
  16. package/dist/managers/advanced.d.ts +116 -0
  17. package/dist/managers/base.d.ts +13 -2
  18. package/dist/managers/emoji.d.ts +1 -1
  19. package/dist/managers/guild.d.ts +28 -2
  20. package/dist/managers/index.d.ts +37 -5
  21. package/dist/managers/index.js +870 -152
  22. package/dist/managers/index.js.map +18 -16
  23. package/dist/managers/message.d.ts +10 -1
  24. package/dist/rest/errors.d.ts +33 -0
  25. package/dist/rest/index.d.ts +1 -1
  26. package/dist/rest/index.js +52 -6
  27. package/dist/rest/index.js.map +5 -5
  28. package/dist/rest/routes.d.ts +20 -0
  29. package/dist/sharding/index.d.ts +29 -0
  30. package/dist/sharding/index.js +99 -15
  31. package/dist/sharding/index.js.map +8 -8
  32. package/dist/structures/base.d.ts +2 -0
  33. package/dist/structures/index.js +96 -42
  34. package/dist/structures/index.js.map +10 -9
  35. package/dist/structures/interactions.d.ts +26 -0
  36. package/dist/types/gateway.d.ts +16 -0
  37. package/dist/types/index.d.ts +55 -1
  38. package/dist/types/index.js.map +2 -2
  39. package/dist/voice/index.d.ts +3 -0
  40. package/dist/voice/index.js +15 -1
  41. package/dist/voice/index.js.map +3 -3
  42. package/dist/ws/index.js +13 -5
  43. package/dist/ws/index.js.map +6 -6
  44. package/package.json +14 -14
@@ -52,8 +52,11 @@ export declare const Permission: {
52
52
  readonly createEvents: bigint;
53
53
  readonly useExternalSounds: bigint;
54
54
  readonly sendVoiceMessages: bigint;
55
+ readonly setVoiceChannelStatus: bigint;
55
56
  readonly sendPolls: bigint;
56
57
  readonly useExternalApps: bigint;
58
+ readonly pinMessages: bigint;
59
+ readonly bypassSlowmode: bigint;
57
60
  };
58
61
  /** Canonical PascalCase permission constants. */
59
62
  export declare const Permissions: {
@@ -104,8 +107,11 @@ export declare const Permissions: {
104
107
  readonly CreateEvents: bigint;
105
108
  readonly UseExternalSounds: bigint;
106
109
  readonly SendVoiceMessages: bigint;
110
+ readonly SetVoiceChannelStatus: bigint;
107
111
  readonly SendPolls: bigint;
108
112
  readonly UseExternalApps: bigint;
113
+ readonly PinMessages: bigint;
114
+ readonly BypassSlowmode: bigint;
109
115
  };
110
116
  /**
111
117
  * Permission flag bits with **bigint** values matching Discord's permission bit
@@ -163,8 +169,11 @@ export declare const PermissionFlagsBits: {
163
169
  readonly CreateEvents: bigint;
164
170
  readonly UseExternalSounds: bigint;
165
171
  readonly SendVoiceMessages: bigint;
172
+ readonly SetVoiceChannelStatus: bigint;
166
173
  readonly SendPolls: bigint;
167
174
  readonly UseExternalApps: bigint;
175
+ readonly PinMessages: bigint;
176
+ readonly BypassSlowmode: bigint;
168
177
  };
169
178
  /** Union of {@link PermissionFlagsBits} values (all bigint). */
170
179
  export type PermissionFlagsBits = (typeof PermissionFlagsBits)[keyof typeof PermissionFlagsBits];
@@ -230,6 +239,8 @@ export declare class PermissionSet {
230
239
  has(...permissions: PermissionResolvable[]): boolean;
231
240
  /** Checks whether any supplied permission is present (OR). @param permissions Permission names or raw bits. @returns True when at least one requested permission is present. */
232
241
  any(...permissions: PermissionResolvable[]): boolean;
242
+ /** Returns the known permission names from `permissions` that this set lacks. @param permissions Permission names or raw bits. */
243
+ missing(...permissions: PermissionResolvable[]): PermissionName[];
233
244
  /** Returns a new set with permissions added. @param permissions Permission names or raw bits. @returns A new permission set. */
234
245
  add(...permissions: PermissionResolvable[]): PermissionSet;
235
246
  /** Returns a new set with permissions removed. @param permissions Permission names or raw bits. @returns A new permission set. */
@@ -292,8 +303,11 @@ export declare class PermissionsBitField extends PermissionSet {
292
303
  readonly CreateEvents: bigint;
293
304
  readonly UseExternalSounds: bigint;
294
305
  readonly SendVoiceMessages: bigint;
306
+ readonly SetVoiceChannelStatus: bigint;
295
307
  readonly SendPolls: bigint;
296
308
  readonly UseExternalApps: bigint;
309
+ readonly PinMessages: bigint;
310
+ readonly BypassSlowmode: bigint;
297
311
  };
298
312
  /** Permission flags constants. */
299
313
  static readonly All: {
@@ -344,9 +358,43 @@ export declare class PermissionsBitField extends PermissionSet {
344
358
  readonly createEvents: bigint;
345
359
  readonly useExternalSounds: bigint;
346
360
  readonly sendVoiceMessages: bigint;
361
+ readonly setVoiceChannelStatus: bigint;
347
362
  readonly sendPolls: bigint;
348
363
  readonly useExternalApps: bigint;
364
+ readonly pinMessages: bigint;
365
+ readonly bypassSlowmode: bigint;
349
366
  };
350
367
  /** Creates a permissions bitfield. @param value Initial permission bitfield or array of permissions. */
351
368
  constructor(value?: PermissionResolvable);
352
369
  }
370
+ /** A role as needed for permission resolution. */
371
+ export interface PermissionRole {
372
+ id: string;
373
+ permissions: PermissionResolvable;
374
+ }
375
+ /** A channel permission overwrite (Discord's `permission_overwrites` entry). */
376
+ export interface PermissionOverwrite {
377
+ id: string;
378
+ type: PermissionOverwriteType | number;
379
+ allow: PermissionResolvable;
380
+ deny: PermissionResolvable;
381
+ }
382
+ /** Everything needed to resolve a member's permissions. */
383
+ export interface PermissionContext {
384
+ guildId: string;
385
+ /** Guild owner ID; the owner has every permission. */
386
+ ownerId?: string;
387
+ memberId: string;
388
+ memberRoleIds: readonly string[];
389
+ /** Guild roles, including `@everyone` (whose ID is the guild ID). */
390
+ roles: readonly PermissionRole[];
391
+ /** Channel overwrites; omit for guild-level permissions. */
392
+ overwrites?: readonly PermissionOverwrite[];
393
+ }
394
+ /**
395
+ * Resolves a member's effective permissions the way Discord does: base
396
+ * permissions from `@everyone` and the member's roles (owner and
397
+ * administrator get everything), then the channel's `@everyone` overwrite,
398
+ * the combined role overwrites, and finally the member overwrite.
399
+ */
400
+ export declare function computePermissions(context: PermissionContext): PermissionSet;