lunibee 0.1.4 → 0.1.6
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 +12 -23
- package/dist/builders/components.d.ts +108 -0
- package/dist/builders/index.d.ts +1 -1
- package/dist/builders/index.js +178 -2
- package/dist/builders/index.js.map +3 -3
- package/dist/collection/index.d.ts +6 -0
- package/dist/collection/index.js +33 -2
- package/dist/collection/index.js.map +4 -4
- package/dist/core/events.d.ts +67 -3
- package/dist/core/index.d.ts +120 -90
- package/dist/core/index.js +816 -1021
- package/dist/core/index.js.map +20 -21
- package/dist/formatters/index.js.map +1 -1
- package/dist/index.d.ts +5 -4
- package/dist/index.js +2215 -1392
- package/dist/index.js.map +29 -26
- package/dist/managers/guild.d.ts +30 -0
- package/dist/managers/index.d.ts +56 -75
- package/dist/managers/index.js +339 -48
- package/dist/managers/index.js.map +16 -12
- package/dist/managers/message.d.ts +7 -12
- package/dist/managers/user.d.ts +20 -0
- package/dist/rest/index.d.ts +83 -1
- package/dist/rest/index.js +48 -8
- package/dist/rest/index.js.map +4 -4
- package/dist/rest/routes.d.ts +4 -1
- package/dist/sharding/index.js +4 -1
- package/dist/sharding/index.js.map +4 -4
- package/dist/structures/base.d.ts +99 -48
- package/dist/structures/embed.d.ts +65 -0
- package/dist/structures/index.d.ts +45 -25
- package/dist/structures/index.js +569 -36
- package/dist/structures/index.js.map +10 -8
- package/dist/structures/interactions.d.ts +72 -17
- package/dist/structures/resources.d.ts +9 -5
- package/dist/types/index.d.ts +530 -85
- package/dist/types/index.js +71 -1
- package/dist/types/index.js.map +3 -3
- package/dist/voice/index.js.map +1 -1
- package/dist/ws/index.js +4 -1
- package/dist/ws/index.js.map +4 -4
- package/package.json +15 -15
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ResourceManager } from "./base.js";
|
|
2
|
+
import { Guild } from "@lunibee/structures";
|
|
3
|
+
import { type REST } from "@lunibee/rest";
|
|
4
|
+
import { type APIChannel, type APIGuildPreview, type APIInvite, type APIWebhook } from "@lunibee/types";
|
|
5
|
+
export interface GuildCreateOptions extends Record<string, unknown> {
|
|
6
|
+
name: string;
|
|
7
|
+
}
|
|
8
|
+
export interface GuildEditOptions extends Record<string, unknown> {
|
|
9
|
+
}
|
|
10
|
+
export declare class GuildManager extends ResourceManager<string, Guild> {
|
|
11
|
+
#private;
|
|
12
|
+
constructor(rest: REST);
|
|
13
|
+
/** Creates a new guild. (Bot must be in fewer than 10 guilds). */
|
|
14
|
+
create(options: GuildCreateOptions): Promise<Guild>;
|
|
15
|
+
/** Modifies a guild's settings. */
|
|
16
|
+
edit(id: string, options: GuildEditOptions): Promise<Guild>;
|
|
17
|
+
/** Deletes a guild permanently. User must be the owner. */
|
|
18
|
+
deleteGuild(id: string): Promise<void>;
|
|
19
|
+
/** Fetches a guild's preview (even if the bot is not in the guild). */
|
|
20
|
+
fetchPreview(id: string): Promise<APIGuildPreview>;
|
|
21
|
+
/** Fetches all active threads in the guild. */
|
|
22
|
+
fetchActiveThreads(id: string): Promise<{
|
|
23
|
+
threads: APIChannel[];
|
|
24
|
+
members: unknown[];
|
|
25
|
+
}>;
|
|
26
|
+
/** Fetches all webhooks in the guild. */
|
|
27
|
+
fetchWebhooks(id: string): Promise<APIWebhook[]>;
|
|
28
|
+
/** Fetches all invites in the guild. */
|
|
29
|
+
fetchInvites(id: string): Promise<APIInvite[]>;
|
|
30
|
+
}
|
package/dist/managers/index.d.ts
CHANGED
|
@@ -1,95 +1,76 @@
|
|
|
1
|
-
import { Manager
|
|
1
|
+
import { Manager } from "./base.js";
|
|
2
2
|
export { Manager, ResourceManager } from "./base.js";
|
|
3
3
|
import { REST } from "@lunibee/rest";
|
|
4
|
-
import { Channel, Message, User
|
|
5
|
-
import { MessageManager } from "./message.js";
|
|
4
|
+
import { Channel, Message, User } from "@lunibee/structures";
|
|
5
|
+
import { MessageManager, type MessageCreateOptions as ManagerMessageCreateOptions } from "./message.js";
|
|
6
6
|
import { ThreadManager } from "./thread.js";
|
|
7
|
-
|
|
8
|
-
export
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
/** Creates a guild manager. @param rest REST transport. */ constructor(rest: REST);
|
|
14
|
-
}
|
|
15
|
-
/** Message creation options. */
|
|
16
|
-
export interface MessageCreateOptions {
|
|
17
|
-
/** Message content. */ content?: string;
|
|
18
|
-
}
|
|
19
|
-
/** Message edit options. */
|
|
20
|
-
export interface MessageEditOptions {
|
|
21
|
-
/** New message content. */ content?: string;
|
|
22
|
-
}
|
|
23
|
-
/** Message fetch options. */
|
|
7
|
+
export { UserManager } from "./user.js";
|
|
8
|
+
export { GuildManager } from "./guild.js";
|
|
9
|
+
export type MessageCreateOptions = ManagerMessageCreateOptions;
|
|
10
|
+
export type MessageEditOptions = Record<string, unknown> & {
|
|
11
|
+
content?: string;
|
|
12
|
+
};
|
|
24
13
|
export interface MessageFetchOptions {
|
|
25
|
-
|
|
14
|
+
cache?: boolean;
|
|
26
15
|
}
|
|
27
|
-
/** Message list query options. */
|
|
28
16
|
export interface MessageQueryOptions {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
17
|
+
before?: string;
|
|
18
|
+
after?: string;
|
|
19
|
+
around?: string;
|
|
20
|
+
limit?: number;
|
|
33
21
|
}
|
|
34
|
-
/** Message thread creation options. */
|
|
35
22
|
export interface MessageThreadOptions {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
23
|
+
name: string;
|
|
24
|
+
autoArchiveDuration?: 60 | 1440 | 4320 | 10080;
|
|
25
|
+
rateLimitPerUser?: number;
|
|
39
26
|
}
|
|
40
|
-
/** Reaction list options. */
|
|
41
27
|
export interface ReactionFetchOptions {
|
|
42
|
-
|
|
43
|
-
|
|
28
|
+
limit?: number;
|
|
29
|
+
after?: string;
|
|
30
|
+
}
|
|
31
|
+
export interface ChannelCreateOptions extends Record<string, unknown> {
|
|
32
|
+
name: string;
|
|
33
|
+
type: number;
|
|
34
|
+
guild_id?: string;
|
|
35
|
+
parent_id?: string | null;
|
|
44
36
|
}
|
|
45
|
-
|
|
46
|
-
export declare const MessageCreateOptions: undefined;
|
|
47
|
-
/** Runtime compatibility placeholder. */
|
|
48
|
-
export declare const MessageEditOptions: undefined;
|
|
49
|
-
/** Runtime compatibility placeholder. */
|
|
50
|
-
export declare const MessageFetchOptions: undefined;
|
|
51
|
-
/** Runtime compatibility placeholder. */
|
|
52
|
-
export declare const MessageThreadOptions: undefined;
|
|
53
|
-
/** Runtime compatibility placeholder. */
|
|
54
|
-
export declare const ReactionFetchOptions: undefined;
|
|
55
|
-
/** Manages Discord channels and their message APIs. */
|
|
37
|
+
export type ChannelEditOptions = Record<string, unknown>;
|
|
56
38
|
export declare class ChannelManager extends Manager<string, Channel> {
|
|
57
39
|
#private;
|
|
58
|
-
/** Creates a channel manager. @param rest REST transport. */
|
|
59
40
|
constructor(rest: REST);
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
41
|
+
messages(channelId: string): MessageManager;
|
|
42
|
+
threads(channelId: string): ThreadManager;
|
|
43
|
+
fetch(channelId: string): Promise<Channel>;
|
|
44
|
+
resolve(channelId: string): Promise<Channel>;
|
|
45
|
+
upsert(data: ConstructorParameters<typeof Channel>[0]): Channel;
|
|
46
|
+
update(channel: Channel): this;
|
|
47
|
+
create(guildId: string, options: ChannelCreateOptions): Promise<Channel>;
|
|
48
|
+
edit(channelId: string, options: ChannelEditOptions): Promise<Channel>;
|
|
49
|
+
deleteChannel(channelId: string): Promise<void>;
|
|
50
|
+
send(channelId: string, options: MessageCreateOptions): Promise<Message>;
|
|
51
|
+
sendMessage(channelId: string, options: MessageCreateOptions): Promise<Message>;
|
|
52
|
+
fetchMessage(channelId: string, messageId: string, options?: MessageFetchOptions): Promise<Message>;
|
|
53
|
+
fetchMessages(channelId: string, query: MessageQueryOptions | Iterable<string>): Promise<Message[]>;
|
|
54
|
+
upsertMessage(data: ConstructorParameters<typeof Message>[0]): Message;
|
|
55
|
+
editMessage(channelId: string, messageId: string, options: MessageEditOptions): Promise<Message>;
|
|
56
|
+
deleteMessage(channelId: string, messageId: string): Promise<void>;
|
|
57
|
+
deleteCachedMessage(channelId: string, messageId: string): boolean;
|
|
58
|
+
crosspostMessage(channelId: string, messageId: string): Promise<Message>;
|
|
59
|
+
bulkDeleteMessages(channelId: string, messageIds: Iterable<string>): Promise<void>;
|
|
60
|
+
addReaction(channelId: string, messageId: string, emoji: string): Promise<void>;
|
|
61
|
+
fetchReactions(channelId: string, messageId: string, emoji: string, options?: ReactionFetchOptions): Promise<User[]>;
|
|
62
|
+
removeOwnReaction(channelId: string, messageId: string, emoji: string): Promise<void>;
|
|
63
|
+
removeReaction(channelId: string, messageId: string, emoji: string, userId: string): Promise<void>;
|
|
64
|
+
removeAllReactions(channelId: string, messageId: string): Promise<void>;
|
|
65
|
+
fetchPinnedMessages(channelId: string): Promise<Message[]>;
|
|
66
|
+
pinMessage(channelId: string, messageId: string): Promise<void>;
|
|
67
|
+
unpinMessage(channelId: string, messageId: string): Promise<void>;
|
|
68
|
+
createThreadFromMessage(channelId: string, messageId: string, options: MessageThreadOptions): Promise<Channel>;
|
|
69
|
+
delete(channelId: string): boolean;
|
|
70
|
+
clear(): void;
|
|
87
71
|
}
|
|
88
|
-
/** Backward-compatible message option alias. */
|
|
89
72
|
export type CreateMessageOptions = MessageCreateOptions;
|
|
90
|
-
/** Exposes the message manager class. */
|
|
91
73
|
export { MessageManager } from "./message.js";
|
|
92
|
-
/** Exposes the thread manager class. */
|
|
93
74
|
export { ThreadManager } from "./thread.js";
|
|
94
75
|
export { RoleManager, type RoleCreateOptions, type RoleEditOptions, } from "./role.js";
|
|
95
76
|
export { GuildMemberManager, type MemberEditOptions, type BanOptions, } from "./member.js";
|