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
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { REST } from "
|
|
2
|
-
import { GuildMember, type ResourceContext } from "
|
|
1
|
+
import { REST } from "../rest/index.js";
|
|
2
|
+
import { GuildMember, type ResourceContext } from "../structures/index.js";
|
|
3
3
|
import { ResourceManager } from "./base.js";
|
|
4
4
|
/** Fields that can change when editing a guild member (nickname, roles, voice state, timeout). */
|
|
5
5
|
export interface MemberEditOptions {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Collection } from "
|
|
1
|
+
import { Collection } from "../collection/index.js";
|
|
2
2
|
/** Opt-in per-channel message cache. Messages are temporary data, so they
|
|
3
3
|
* use bounded TTL/LRU storage rather than permanent resource storage. */
|
|
4
4
|
export interface MessageCacheOptions {
|
|
@@ -7,9 +7,9 @@ export interface MessageCacheOptions {
|
|
|
7
7
|
/** Sliding TTL in ms. Omit for no expiry. */
|
|
8
8
|
ttl?: number;
|
|
9
9
|
}
|
|
10
|
-
import { REST, type RESTFileAttachment } from "
|
|
11
|
-
import type { AllowedMentions, MessageCreateOptions, MessageEditOptions, MessageFile, MessageFileSource } from "
|
|
12
|
-
import { Message, type ResourceContext } from "
|
|
10
|
+
import { REST, type RESTFileAttachment } from "../rest/index.js";
|
|
11
|
+
import type { AllowedMentions, MessageCreateOptions, MessageEditOptions, MessageFile, MessageFileSource } from "../types/index.js";
|
|
12
|
+
import { Message, type ResourceContext } from "../structures/index.js";
|
|
13
13
|
export type { MessageCreateOptions, MessageEditOptions, MessageFile, MessageFileSource, };
|
|
14
14
|
/**
|
|
15
15
|
* Turns message files into REST uploads, encoding string data as UTF-8. A file
|
|
@@ -27,9 +27,9 @@ export declare function toAttachments(files: readonly (MessageFile | MessageFile
|
|
|
27
27
|
* @throws {TypeError} If the object is invalid.
|
|
28
28
|
*/
|
|
29
29
|
export declare function assertAllowedMentions(mentions: AllowedMentions): void;
|
|
30
|
-
export declare function toRequest(options: MessageCreateOptions, allowedMentions?: AllowedMentions):
|
|
30
|
+
export declare function toRequest(options: MessageCreateOptions, allowedMentions?: AllowedMentions): {
|
|
31
31
|
body: Omit<MessageCreateOptions, "files">;
|
|
32
|
-
files
|
|
32
|
+
files?: RESTFileAttachment[];
|
|
33
33
|
};
|
|
34
34
|
export declare class MessageManager {
|
|
35
35
|
#private;
|
|
@@ -38,7 +38,15 @@ export declare class MessageManager {
|
|
|
38
38
|
constructor(rest: REST, context: ResourceContext, channelId: string, cache?: MessageCacheOptions, allowedMentions?: AllowedMentions);
|
|
39
39
|
resolve(messageId: string): Promise<Message>;
|
|
40
40
|
send(options: MessageCreateOptions): Promise<Message>;
|
|
41
|
+
/**
|
|
42
|
+
* Fetches a message. Concurrent fetches of one message share a request.
|
|
43
|
+
* If the message is stored or deleted (e.g. by a Gateway event) while the
|
|
44
|
+
* request is in flight, the result is returned but not cached, so it
|
|
45
|
+
* cannot overwrite fresher state or bring back a deleted message.
|
|
46
|
+
*/
|
|
41
47
|
fetch(messageId: string): Promise<Message>;
|
|
48
|
+
/** Stores a message as the cached version (when caching is on), replacing any cached one. @returns This manager. */
|
|
49
|
+
set(messageId: string, message: Message): this;
|
|
42
50
|
fetchMany(messageIds: Iterable<string>): Promise<Message[]>;
|
|
43
51
|
upsert(data: ConstructorParameters<typeof Message>[0]): Message;
|
|
44
52
|
delete(messageId: string): boolean;
|
package/dist/managers/role.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { REST } from "
|
|
2
|
-
import { Role } from "
|
|
1
|
+
import { REST } from "../rest/index.js";
|
|
2
|
+
import { Role } from "../structures/index.js";
|
|
3
3
|
import { ResourceManager } from "./base.js";
|
|
4
4
|
/** Role fields shared by create and edit. */
|
|
5
5
|
interface RoleStyleOptions {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { REST } from "
|
|
2
|
-
import { Channel, type ResourceContext } from "
|
|
3
|
-
import type { AllowedMentions, APIGuildMember, APIThreadMember, MessageCreateOptions } from "
|
|
1
|
+
import { REST } from "../rest/index.js";
|
|
2
|
+
import { Channel, type ResourceContext } from "../structures/index.js";
|
|
3
|
+
import type { AllowedMentions, APIGuildMember, APIThreadMember, MessageCreateOptions } from "../types/index.js";
|
|
4
4
|
/** Options shared by every way of starting a thread. */
|
|
5
5
|
export interface ThreadCreateOptions {
|
|
6
6
|
name: string;
|
package/dist/managers/user.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ResourceManager } from "./base.js";
|
|
2
|
-
import { User } from "
|
|
3
|
-
import { type REST } from "
|
|
4
|
-
import type { APIChannel } from "
|
|
2
|
+
import { User } from "../structures/index.js";
|
|
3
|
+
import { type REST } from "../rest/index.js";
|
|
4
|
+
import type { APIChannel } from "../types/index.js";
|
|
5
5
|
/** A guild as `GET /users/@me/guilds` lists it. */
|
|
6
6
|
export interface APIPartialGuild {
|
|
7
7
|
id: string;
|
|
@@ -19,7 +19,10 @@ export interface UserEditOptions {
|
|
|
19
19
|
}
|
|
20
20
|
export declare class UserManager extends ResourceManager<string, User> {
|
|
21
21
|
#private;
|
|
22
|
-
|
|
22
|
+
/** @param options.maxSize Most users kept; the least recently used go first. Default: unbounded. */
|
|
23
|
+
constructor(rest: REST, options?: {
|
|
24
|
+
maxSize?: number;
|
|
25
|
+
});
|
|
23
26
|
/** Gets the currently logged-in bot user. */
|
|
24
27
|
fetchMe(): Promise<User>;
|
|
25
28
|
/** Modifies the currently logged-in bot user. */
|
package/dist/rest/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { type RateLimitStore } from "./store.js";
|
|
2
|
-
import { RESTError } from "./errors.js";
|
|
3
2
|
import { type RESTQuery } from "./route.js";
|
|
4
3
|
import { type CoordinationMode, type RESTTelemetry } from "./telemetry.js";
|
|
5
4
|
import { HttpTransport } from "./transport.js";
|
|
@@ -13,9 +12,8 @@ export interface RESTFileAttachment {
|
|
|
13
12
|
/**
|
|
14
13
|
* Options controlling an individual REST request.
|
|
15
14
|
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* `reason`, `auth`) additively without changing that positional default.
|
|
15
|
+
* The body is positional (`post(path, body, options)`); these options carry the
|
|
16
|
+
* per-request knobs (`query`, `headers`, `reason`, `auth`, `signal`, `maxQueueWait`).
|
|
19
17
|
*/
|
|
20
18
|
export interface RESTRequestOptions {
|
|
21
19
|
/** Abort signal used to cancel the request and any queued wait. */
|
|
@@ -36,28 +34,15 @@ export interface RESTRequestOptions {
|
|
|
36
34
|
maxQueueWait?: number;
|
|
37
35
|
}
|
|
38
36
|
/**
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
* additive `method(path, { body })` overloads without breaking the positional signature.
|
|
37
|
+
* Request options plus `files` (which upgrade the request to multipart) and, for
|
|
38
|
+
* `get()` and `delete()` (which take no positional body), an optional `body`.
|
|
42
39
|
*/
|
|
43
40
|
export interface RequestData extends RESTRequestOptions {
|
|
44
|
-
/** Request body
|
|
41
|
+
/** Request body for `get()` and `delete()`; `request()`, `post()`, `put()` and `patch()` take theirs positionally. */
|
|
45
42
|
body?: unknown;
|
|
46
43
|
/** File attachments; presence upgrades the request to `multipart/form-data`. */
|
|
47
44
|
files?: RESTFileAttachment[];
|
|
48
45
|
}
|
|
49
|
-
/**
|
|
50
|
-
* The single-object form of {@link REST.request}, matching `@discordjs/rest`:
|
|
51
|
-
* the route is `path` (or its Discord.js name, `fullRoute`).
|
|
52
|
-
*/
|
|
53
|
-
export interface RequestOptionsObject extends RequestData {
|
|
54
|
-
/** HTTP method. */
|
|
55
|
-
method: string;
|
|
56
|
-
/** API path, starting with `/`. */
|
|
57
|
-
path?: string;
|
|
58
|
-
/** Alias of `path`, as `@discordjs/rest` names it. */
|
|
59
|
-
fullRoute?: string;
|
|
60
|
-
}
|
|
61
46
|
/** Context passed to `RESTHooks.onRequest`. */
|
|
62
47
|
export interface RESTRequestContext {
|
|
63
48
|
method: string;
|
|
@@ -219,23 +204,19 @@ export declare class REST {
|
|
|
219
204
|
* @param method HTTP method.
|
|
220
205
|
* @param path API path.
|
|
221
206
|
* @param body Optional JSON body, FormData for file uploads, or undefined.
|
|
222
|
-
* @param options Request options: cancellation `signal`
|
|
223
|
-
* `
|
|
207
|
+
* @param options Request options: cancellation `signal`, `query`, `headers`,
|
|
208
|
+
* `reason`, `auth`, and `files` (which upgrade to multipart).
|
|
224
209
|
* @returns Decoded response body.
|
|
225
210
|
* @throws {RESTError} If Discord or transport rejects the request.
|
|
226
211
|
*/
|
|
227
|
-
request<T>(options: RequestOptionsObject): Promise<T>;
|
|
228
212
|
request<T>(method: string, path: string, body?: unknown, options?: RequestData): Promise<T>;
|
|
229
213
|
/** Sends a GET request. @param path API path. @param options Request options (`query`, `headers`, `signal`, …). @returns Decoded response. @throws {RESTError} When the request fails. */
|
|
230
214
|
get<T>(path: string, options?: RequestData): Promise<T>;
|
|
231
|
-
/** Sends a POST request.
|
|
232
|
-
post<T>(path: string, options: RequestData): Promise<T>;
|
|
215
|
+
/** Sends a POST request. @param path API path. @param body Optional JSON body. @param options Request options (`files`, `reason`, `query`, `headers`, `signal`, …). @returns Decoded response. @throws {RESTError} When the request fails. */
|
|
233
216
|
post<T>(path: string, body?: unknown, options?: RequestData): Promise<T>;
|
|
234
|
-
/** Sends a PATCH request.
|
|
235
|
-
patch<T>(path: string, options: RequestData): Promise<T>;
|
|
217
|
+
/** Sends a PATCH request. @param path API path. @param body Optional JSON body. @param options Request options (`files`, `reason`, `query`, `headers`, `signal`, …). @returns Decoded response. @throws {RESTError} When the request fails. */
|
|
236
218
|
patch<T>(path: string, body?: unknown, options?: RequestData): Promise<T>;
|
|
237
|
-
/** Sends a PUT request.
|
|
238
|
-
put<T>(path: string, options: RequestData): Promise<T>;
|
|
219
|
+
/** Sends a PUT request. @param path API path. @param body Optional JSON body. @param options Request options (`files`, `reason`, `query`, `headers`, `signal`, …). @returns Decoded response. @throws {RESTError} When the request fails. */
|
|
239
220
|
put<T>(path: string, body?: unknown, options?: RequestData): Promise<T>;
|
|
240
221
|
/** Sends a DELETE request. @param path API path. @param options Request options (`reason`, `headers`, `signal`, …). @returns Decoded response. @throws {RESTError} When the request fails. */
|
|
241
222
|
delete<T>(path: string, options?: RequestData): Promise<T>;
|
|
@@ -275,9 +256,3 @@ export { ResponseDecoder, type DecodedError } from "./decoder.js";
|
|
|
275
256
|
export { type RateLimitStore, type BucketState, type BucketUpdate, type Reservation, type ReserveOptions, MemoryRateLimitStore, } from "./store.js";
|
|
276
257
|
export { RedisRateLimitStore, fromBunRedis, type RedisRateLimitStoreOptions, type RedisFailurePolicy, type RedisStoreDiagnostics, type MinimalRedisClient, } from "./redis.js";
|
|
277
258
|
export { WebhookClient, type WebhookClientOptions, type WebhookMessageOptions, } from "./webhook.js";
|
|
278
|
-
/**
|
|
279
|
-
* Discord.js-familiar alias for {@link RESTError}. `@discordjs/rest` throws `DiscordAPIError`
|
|
280
|
-
* on a Discord-rejected request; Lunibee keeps `RESTError` as the canonical class and exports
|
|
281
|
-
* this alias so Discord.js-shaped `catch (err) { if (err instanceof DiscordAPIError) … }` works.
|
|
282
|
-
*/
|
|
283
|
-
export { RESTError as DiscordAPIError };
|