lunibee 0.1.8 → 0.2.1
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 +2 -0
- package/dist/builders/components.d.ts +30 -2
- package/dist/builders/embed.d.ts +7 -7
- package/dist/builders/index.d.ts +1 -1
- package/dist/builders/index.js +110 -18
- package/dist/builders/index.js.map +6 -6
- package/dist/collection/index.d.ts +68 -1
- package/dist/collection/index.js +334 -1
- package/dist/collection/index.js.map +3 -3
- package/dist/core/collector.d.ts +13 -0
- package/dist/core/events.d.ts +29 -3
- package/dist/core/index.d.ts +25 -9
- package/dist/core/index.js +1745 -134
- package/dist/core/index.js.map +30 -26
- package/dist/core/permissions.d.ts +48 -0
- package/dist/index.js +2102 -362
- package/dist/index.js.map +36 -34
- package/dist/managers/advanced.d.ts +116 -0
- package/dist/managers/base.d.ts +13 -2
- package/dist/managers/emoji.d.ts +1 -1
- package/dist/managers/guild-resources.d.ts +22 -2
- package/dist/managers/guild.d.ts +31 -3
- package/dist/managers/index.d.ts +38 -6
- package/dist/managers/index.js +996 -160
- package/dist/managers/index.js.map +20 -18
- package/dist/managers/member.d.ts +13 -12
- package/dist/managers/message.d.ts +21 -4
- package/dist/rest/errors.d.ts +33 -0
- package/dist/rest/index.d.ts +1 -1
- package/dist/rest/index.js +52 -6
- package/dist/rest/index.js.map +5 -5
- package/dist/rest/routes.d.ts +20 -0
- package/dist/sharding/index.d.ts +29 -0
- package/dist/sharding/index.js +99 -15
- package/dist/sharding/index.js.map +8 -8
- package/dist/structures/base.d.ts +38 -0
- package/dist/structures/index.d.ts +29 -0
- package/dist/structures/index.js +208 -46
- package/dist/structures/index.js.map +13 -12
- package/dist/structures/interactions.d.ts +51 -1
- package/dist/structures/options.d.ts +2 -0
- package/dist/structures/resources.d.ts +29 -3
- package/dist/types/gateway.d.ts +16 -0
- package/dist/types/index.d.ts +67 -1
- package/dist/types/index.js.map +3 -3
- package/dist/utils/args.d.ts +79 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +190 -2
- package/dist/utils/index.js.map +5 -4
- package/dist/voice/index.d.ts +3 -0
- package/dist/voice/index.js +15 -1
- package/dist/voice/index.js.map +3 -3
- package/dist/ws/index.js +13 -5
- package/dist/ws/index.js.map +6 -6
- package/package.json +14 -14
package/dist/core/index.d.ts
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
export { Permission, Permissions, PermissionFlagsBits, PermissionSet, PermissionsBitField, PermissionOverwriteType, type PermissionName, } from "./permissions.js";
|
|
1
|
+
export { Permission, Permissions, PermissionFlagsBits, PermissionSet, PermissionsBitField, PermissionOverwriteType, computePermissions, type PermissionContext, type PermissionOverwrite, type PermissionRole, type PermissionName, } from "./permissions.js";
|
|
2
2
|
export { ClientEvent,
|
|
3
3
|
/** Discord.js-familiar alias for {@link ClientEvent}. */
|
|
4
4
|
ClientEvent as Events, type ClientEventName, type ClientEvents, type ClientListener, } from "./events.js";
|
|
5
5
|
export { Collector, type CollectorOptions } from "./collector.js";
|
|
6
6
|
export { GatewayIntentBits, IntentBits, Intents, IntentsBitField, resolveGatewayIntents, type GatewayIntentResolvable, } from "@lunibee/types";
|
|
7
|
-
import { ApplicationCommandManager, ChannelManager, GuildManager, StageInstanceManager, UserManager } from "@lunibee/managers";
|
|
7
|
+
import { ApplicationCommandManager, ChannelManager, GuildManager, MonetizationManager, StageInstanceManager, UserManager } from "@lunibee/managers";
|
|
8
8
|
import { REST } from "@lunibee/rest";
|
|
9
|
-
import { type InteractionClient } from "@lunibee/structures";
|
|
9
|
+
import { type InteractionClient, type ResourceContext } from "@lunibee/structures";
|
|
10
10
|
import { Gateway } from "@lunibee/ws";
|
|
11
|
-
import type { ClientOptions, ClientUser } from "@lunibee/types";
|
|
11
|
+
import type { APISoundboardSound, ClientOptions, ClientUser } from "@lunibee/types";
|
|
12
12
|
import { type ClientEvents } from "./events.js";
|
|
13
|
+
import { Collector, type CollectorOptions } from "./collector.js";
|
|
14
|
+
import { PermissionSet } from "./permissions.js";
|
|
13
15
|
/** Lifecycle state of a client. */
|
|
14
16
|
export type ClientState = "idle" | "connecting" | "ready" | "destroyed";
|
|
15
17
|
type Listener<T extends unknown[]> = (...args: T) => unknown;
|
|
@@ -39,6 +41,8 @@ export declare class Client extends EventEmitter<ClientEvents> implements Intera
|
|
|
39
41
|
readonly application: {
|
|
40
42
|
commands: ApplicationCommandManager;
|
|
41
43
|
};
|
|
44
|
+
/** SKUs, entitlements and subscriptions; available after READY (application ID known). */
|
|
45
|
+
monetization?: MonetizationManager;
|
|
42
46
|
get ws(): Gateway;
|
|
43
47
|
get gateway(): Gateway;
|
|
44
48
|
user?: ClientUser;
|
|
@@ -61,12 +65,23 @@ export declare class Client extends EventEmitter<ClientEvents> implements Intera
|
|
|
61
65
|
requestGuildMembers(data: Record<string, unknown>): boolean;
|
|
62
66
|
constructor(options: ClientOptions);
|
|
63
67
|
/**
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
* @returns The token used to log in.
|
|
68
|
-
* @throws {TypeError} If the resulting token is empty.
|
|
68
|
+
* Collects the first argument of a client event until a limit, timeout,
|
|
69
|
+
* idle timeout, abort or `stop()`. The collector unsubscribes itself when
|
|
70
|
+
* it ends. Items are keyed by `options.key`, else their `id`, else order.
|
|
69
71
|
*/
|
|
72
|
+
createCollector<E extends keyof ClientEvents>(event: E, options?: CollectorOptions<ClientEvents[E][0]> & {
|
|
73
|
+
key?: (item: ClientEvents[E][0]) => string;
|
|
74
|
+
}): Collector<string, ClientEvents[E][0]>;
|
|
75
|
+
/** Structures built by this client (members from interactions...) act through this. */
|
|
76
|
+
get resourceContext(): ResourceContext;
|
|
77
|
+
/**
|
|
78
|
+
* Resolves a member's permissions from cached state: guild-level for a
|
|
79
|
+
* guild ID, or channel-level (including overwrites) for a cached channel
|
|
80
|
+
* ID. Returns null when the guild or member is not cached.
|
|
81
|
+
*/
|
|
82
|
+
permissionsFor(memberId: string, guildOrChannelId: string): PermissionSet | null;
|
|
83
|
+
/** Fetches Discord's default soundboard sounds. */
|
|
84
|
+
fetchDefaultSoundboardSounds(): Promise<APISoundboardSound[]>;
|
|
70
85
|
login(token?: string): Promise<string>;
|
|
71
86
|
/**
|
|
72
87
|
* Destroys the client, permanently closing the Gateway connection.
|
|
@@ -76,6 +91,7 @@ export declare class Client extends EventEmitter<ClientEvents> implements Intera
|
|
|
76
91
|
editInteractionReply(token: string, data: Record<string, unknown>): Promise<unknown>;
|
|
77
92
|
deleteInteractionReply(token: string): Promise<void>;
|
|
78
93
|
followUpInteraction(token: string, data: Record<string, unknown>): Promise<unknown>;
|
|
94
|
+
interactionWebhookMessage(method: "GET" | "PATCH" | "DELETE", applicationId: string, token: string, messageId: string, data?: Record<string, unknown>): Promise<unknown>;
|
|
79
95
|
/** Fetches a webhook from Discord. */
|
|
80
96
|
fetchWebhook(id: string, token?: string): Promise<Record<string, unknown>>;
|
|
81
97
|
/** Fetches a guild preview from Discord. */
|