lunibee 0.1.7 → 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.
- package/LICENSE +21 -21
- package/README.md +225 -223
- package/dist/builders/commands.d.ts +6 -4
- package/dist/builders/components.d.ts +23 -0
- package/dist/builders/index.d.ts +2 -2
- package/dist/builders/index.js +120 -24
- package/dist/builders/index.js.map +9 -8
- package/dist/collection/index.d.ts +68 -1
- package/dist/collection/index.js +335 -1
- package/dist/collection/index.js.map +4 -4
- package/dist/core/collector.d.ts +13 -0
- package/dist/core/events.d.ts +112 -2
- package/dist/core/index.d.ts +30 -93
- package/dist/core/index.js +3386 -957
- package/dist/core/index.js.map +48 -24
- package/dist/core/permissions.d.ts +48 -0
- package/dist/formatters/index.js.map +1 -1
- package/dist/handlers/index.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3806 -1193
- package/dist/index.js.map +64 -43
- 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 +109 -0
- package/dist/managers/guild.d.ts +33 -2
- package/dist/managers/index.d.ts +44 -6
- package/dist/managers/index.js +1186 -150
- package/dist/managers/index.js.map +27 -21
- package/dist/managers/message.d.ts +10 -1
- package/dist/rest/decoder.d.ts +23 -0
- package/dist/rest/errors.d.ts +53 -0
- package/dist/rest/index.d.ts +21 -17
- package/dist/rest/index.js +526 -264
- package/dist/rest/index.js.map +14 -8
- package/dist/rest/limiter.d.ts +42 -0
- package/dist/rest/redis.d.ts +18 -1
- package/dist/rest/route.d.ts +31 -0
- package/dist/rest/routes.d.ts +22 -0
- package/dist/rest/scheduler.d.ts +42 -0
- package/dist/rest/store.d.ts +29 -0
- package/dist/rest/transport.d.ts +40 -0
- package/dist/sharding/bus.d.ts +31 -0
- package/dist/sharding/cluster.d.ts +10 -0
- package/dist/sharding/index.d.ts +39 -2
- package/dist/sharding/index.js +1105 -404
- package/dist/sharding/index.js.map +18 -8
- package/dist/structures/base.d.ts +10 -0
- package/dist/structures/channels.d.ts +56 -0
- package/dist/structures/index.d.ts +1 -0
- package/dist/structures/index.js +305 -311
- package/dist/structures/index.js.map +18 -14
- package/dist/structures/interactions.d.ts +38 -52
- package/dist/structures/options.d.ts +55 -0
- package/dist/structures/resources.d.ts +3 -3
- package/dist/types/gateway-events.d.ts +132 -0
- package/dist/types/gateway.d.ts +197 -0
- package/dist/types/index.d.ts +53 -260
- package/dist/types/index.js +44 -2
- package/dist/types/index.js.map +5 -4
- package/dist/utils/index.js.map +1 -1
- package/dist/voice/index.d.ts +32 -1
- package/dist/voice/index.js +73 -7
- package/dist/voice/index.js.map +3 -3
- package/dist/ws/close-codes.d.ts +23 -0
- package/dist/ws/decoder.d.ts +58 -0
- package/dist/ws/heartbeat.d.ts +87 -0
- package/dist/ws/index.d.ts +18 -65
- package/dist/ws/index.js +911 -385
- package/dist/ws/index.js.map +15 -5
- package/dist/ws/opcodes.d.ts +14 -0
- package/dist/ws/protocol.d.ts +110 -0
- package/dist/ws/reconnect.d.ts +108 -0
- package/dist/ws/send-budget.d.ts +17 -0
- package/dist/ws/session.d.ts +100 -0
- package/dist/ws/state.d.ts +27 -0
- package/dist/ws/transport.d.ts +80 -0
- package/package.json +21 -20
|
@@ -67,6 +67,8 @@ export declare class Channel extends BaseStructure {
|
|
|
67
67
|
nsfw?: boolean;
|
|
68
68
|
rateLimitPerUser?: number;
|
|
69
69
|
position?: number;
|
|
70
|
+
/** Role and member permission overwrites (empty for DMs and when not provided). */
|
|
71
|
+
permissionOverwrites: import("@lunibee/types").APIOverwrite[];
|
|
70
72
|
/** Creates a channel structure from Discord channel data. */
|
|
71
73
|
constructor(data: import("@lunibee/types").APIChannel, context?: ResourceContext);
|
|
72
74
|
/** Sends a message to this channel. @param options Message payload. @returns The created message. @throws {Error} If the channel is not attached to a client. */
|
|
@@ -89,6 +91,14 @@ export declare class Channel extends BaseStructure {
|
|
|
89
91
|
delete(): Promise<void>;
|
|
90
92
|
/** Updates this channel using the same resource operation as edit. @param options Channel fields to change. @returns The updated channel. @throws {Error} If the channel is not attached to a client. */
|
|
91
93
|
update(options: Record<string, unknown>): Promise<Channel>;
|
|
94
|
+
/** Whether this is a thread (announcement, public or private). */
|
|
95
|
+
isThread(): boolean;
|
|
96
|
+
/** Whether messages can be sent in this channel (text, DM, announcement, voice, stage, threads). */
|
|
97
|
+
isTextBased(): boolean;
|
|
98
|
+
/** Whether this is a voice or stage channel. */
|
|
99
|
+
isVoiceBased(): boolean;
|
|
100
|
+
/** Whether this is a direct-message channel (DM or group DM). */
|
|
101
|
+
isDMBased(): boolean;
|
|
92
102
|
/** Returns the Discord channel mention string. Used automatically in template literals. */
|
|
93
103
|
toString(): string;
|
|
94
104
|
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { Channel, User, type ResourceContext } from "./base.js";
|
|
2
|
+
import { TextChannel } from "./resources.js";
|
|
3
|
+
import type { APIChannel, APIForumTag, APIPartialEmoji, APIThreadMetadata } from "@lunibee/types";
|
|
4
|
+
/** A guild announcement (news) channel. */
|
|
5
|
+
export declare class NewsChannel extends TextChannel {
|
|
6
|
+
}
|
|
7
|
+
/** A direct-message or group DM channel. */
|
|
8
|
+
export declare class DMChannel extends Channel {
|
|
9
|
+
/** Users in the conversation. */ readonly recipients: User[];
|
|
10
|
+
/** Owner of a group DM. */ readonly ownerId: string | null;
|
|
11
|
+
constructor(data: APIChannel, context?: ResourceContext);
|
|
12
|
+
}
|
|
13
|
+
/** A guild voice channel. */
|
|
14
|
+
export declare class VoiceChannel extends Channel {
|
|
15
|
+
/** Bitrate in bits per second. */ bitrate: number;
|
|
16
|
+
/** User limit (0 = unlimited). */ userLimit: number;
|
|
17
|
+
/** Voice region override, or null for automatic. */ rtcRegion: string | null;
|
|
18
|
+
/** Camera video quality mode. */ videoQualityMode: number;
|
|
19
|
+
constructor(data: APIChannel, context?: ResourceContext);
|
|
20
|
+
}
|
|
21
|
+
/** A guild stage channel. */
|
|
22
|
+
export declare class StageChannel extends VoiceChannel {
|
|
23
|
+
}
|
|
24
|
+
/** A guild category. */
|
|
25
|
+
export declare class CategoryChannel extends Channel {
|
|
26
|
+
}
|
|
27
|
+
/** A thread (announcement, public or private). */
|
|
28
|
+
export declare class ThreadChannel extends Channel {
|
|
29
|
+
/** User who created the thread. */ readonly ownerId: string | null;
|
|
30
|
+
/** Approximate message count. */ messageCount: number;
|
|
31
|
+
/** Approximate member count (stops counting at 50). */ memberCount: number;
|
|
32
|
+
/** Thread metadata. */ metadata: APIThreadMetadata | null;
|
|
33
|
+
constructor(data: APIChannel, context?: ResourceContext);
|
|
34
|
+
/** Whether the thread is archived. */
|
|
35
|
+
get archived(): boolean;
|
|
36
|
+
/** Whether the thread is locked. */
|
|
37
|
+
get locked(): boolean;
|
|
38
|
+
/** Minutes of inactivity before the thread auto-archives. */
|
|
39
|
+
get autoArchiveDuration(): number | null;
|
|
40
|
+
}
|
|
41
|
+
/** A guild forum channel. */
|
|
42
|
+
export declare class ForumChannel extends Channel {
|
|
43
|
+
/** Tags that threads can apply. */ availableTags: APIForumTag[];
|
|
44
|
+
/** Default reaction for new threads. */ defaultReactionEmoji: APIPartialEmoji | null;
|
|
45
|
+
/** Default slowmode for new threads. */ defaultThreadRateLimitPerUser: number;
|
|
46
|
+
/** Default auto-archive duration for new threads. */ defaultAutoArchiveDuration: number | null;
|
|
47
|
+
constructor(data: APIChannel, context?: ResourceContext);
|
|
48
|
+
}
|
|
49
|
+
/** A guild media channel. */
|
|
50
|
+
export declare class MediaChannel extends ForumChannel {
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Builds the most specific channel class for a payload's `type`, falling back
|
|
54
|
+
* to {@link Channel} for types without a dedicated class.
|
|
55
|
+
*/
|
|
56
|
+
export declare function createChannel(data: APIChannel, context?: ResourceContext): Channel;
|
|
@@ -81,6 +81,7 @@ export declare class Message extends BaseStructure {
|
|
|
81
81
|
toJSON(): Record<string, unknown>;
|
|
82
82
|
}
|
|
83
83
|
export { GuildMember, Role, TextChannel, Invite, Webhook, WebhookType, Emoji, AutoModerationRule, WelcomeScreenChannel, GuildWelcomeScreen, OnboardingPromptOption, OnboardingPrompt, GuildOnboarding, } from "./resources.js";
|
|
84
|
+
export { NewsChannel, DMChannel, VoiceChannel, StageChannel, CategoryChannel, ThreadChannel, ForumChannel, MediaChannel, createChannel, } from "./channels.js";
|
|
84
85
|
export * from "./interactions.js";
|
|
85
86
|
export { Embed } from "./embed.js";
|
|
86
87
|
export { AuditLog, AuditLogEntry } from "./audit-log.js";
|