lunibee 0.1.6 → 0.1.8
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 +223 -223
- package/dist/builders/commands.d.ts +39 -0
- package/dist/builders/components.d.ts +37 -12
- package/dist/builders/embed.d.ts +3 -1
- package/dist/builders/index.d.ts +2 -2
- package/dist/builders/index.js +192 -29
- package/dist/builders/index.js.map +9 -7
- package/dist/collection/index.d.ts +30 -0
- package/dist/collection/index.js +79 -5
- package/dist/collection/index.js.map +4 -4
- package/dist/core/events.d.ts +88 -2
- package/dist/core/index.d.ts +46 -85
- package/dist/core/index.js +2395 -789
- package/dist/core/index.js.map +44 -22
- package/dist/core/permissions.d.ts +112 -53
- package/dist/formatters/index.d.ts +43 -3
- package/dist/formatters/index.js +64 -1
- package/dist/formatters/index.js.map +3 -3
- package/dist/handlers/index.js.map +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +3783 -1009
- package/dist/index.js.map +63 -38
- package/dist/managers/emoji.d.ts +38 -0
- package/dist/managers/guild-resources.d.ts +109 -0
- package/dist/managers/guild.d.ts +117 -1
- package/dist/managers/index.d.ts +37 -1
- package/dist/managers/index.js +1125 -81
- package/dist/managers/index.js.map +25 -20
- package/dist/rest/decoder.d.ts +23 -0
- package/dist/rest/errors.d.ts +20 -0
- package/dist/rest/index.d.ts +119 -25
- package/dist/rest/index.js +676 -204
- package/dist/rest/index.js.map +14 -6
- package/dist/rest/limiter.d.ts +42 -0
- package/dist/rest/redis.d.ts +54 -0
- package/dist/rest/route.d.ts +31 -0
- package/dist/rest/routes.d.ts +24 -0
- package/dist/rest/scheduler.d.ts +42 -0
- package/dist/rest/store.d.ts +67 -0
- package/dist/rest/transport.d.ts +40 -0
- package/dist/rest/webhook.d.ts +2 -2
- package/dist/sharding/bus.d.ts +31 -0
- package/dist/sharding/cluster.d.ts +71 -0
- package/dist/sharding/index.d.ts +18 -2
- package/dist/sharding/index.js +1202 -317
- package/dist/sharding/index.js.map +18 -7
- package/dist/structures/audit-log.d.ts +26 -0
- package/dist/structures/base.d.ts +40 -0
- package/dist/structures/channels.d.ts +56 -0
- package/dist/structures/index.d.ts +30 -1
- package/dist/structures/index.js +963 -87
- package/dist/structures/index.js.map +17 -10
- package/dist/structures/interactions.d.ts +12 -52
- package/dist/structures/options.d.ts +55 -0
- package/dist/structures/resources.d.ts +194 -6
- package/dist/types/gateway-events.d.ts +132 -0
- package/dist/types/gateway.d.ts +181 -0
- package/dist/types/index.d.ts +78 -263
- package/dist/types/index.js +44 -2
- package/dist/types/index.js.map +5 -4
- package/dist/utils/index.js.map +2 -2
- package/dist/voice/index.d.ts +116 -0
- package/dist/voice/index.js +261 -10
- 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 +24 -32
- package/dist/ws/index.js +920 -318
- 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 +23 -22
- package/dist/structures/permissions.d.ts +0 -73
|
@@ -35,58 +35,8 @@ export interface InteractionClient {
|
|
|
35
35
|
/** Deletes the original interaction response. @param token Interaction token. @returns Promise fulfilled after deletion. @throws {Error} When REST fails. */ deleteInteractionReply(token: string): Promise<void>;
|
|
36
36
|
/** Sends a follow-up interaction webhook message. @param token Interaction token. @param data Message payload. @returns Discord response. @throws {Error} When REST fails. */ followUpInteraction(token: string, data: InteractionReplyOptions): Promise<unknown>;
|
|
37
37
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
name: string;
|
|
41
|
-
type: number;
|
|
42
|
-
value?: string | number | boolean;
|
|
43
|
-
options?: APIInteractionDataOption[];
|
|
44
|
-
focused?: boolean;
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Typed resolver for application command options.
|
|
48
|
-
* Attached as `CommandInteraction.options`.
|
|
49
|
-
*/
|
|
50
|
-
export declare class CommandOptions {
|
|
51
|
-
#private;
|
|
52
|
-
/** @internal */
|
|
53
|
-
constructor(options: APIInteractionDataOption[], resolved?: Record<string, unknown>);
|
|
54
|
-
/** Returns the invoked subcommand name, or null if none. */
|
|
55
|
-
getSubcommand(required?: false): string | null;
|
|
56
|
-
getSubcommand(required: true): string;
|
|
57
|
-
/** Returns the invoked subcommand group name, or null if none. */
|
|
58
|
-
getSubcommandGroup(required?: false): string | null;
|
|
59
|
-
getSubcommandGroup(required: true): string;
|
|
60
|
-
/** Gets a string option. @param name Option name. @param required If true, throws when missing. */
|
|
61
|
-
getString(name: string, required?: false): string | null;
|
|
62
|
-
getString(name: string, required: true): string;
|
|
63
|
-
/** Gets an integer option. @param name Option name. @param required If true, throws when missing. */
|
|
64
|
-
getInteger(name: string, required?: false): number | null;
|
|
65
|
-
getInteger(name: string, required: true): number;
|
|
66
|
-
/** Gets a number (float) option. @param name Option name. @param required If true, throws when missing. */
|
|
67
|
-
getNumber(name: string, required?: false): number | null;
|
|
68
|
-
getNumber(name: string, required: true): number;
|
|
69
|
-
/** Gets a boolean option. @param name Option name. @param required If true, throws when missing. */
|
|
70
|
-
getBoolean(name: string, required?: false): boolean | null;
|
|
71
|
-
getBoolean(name: string, required: true): boolean;
|
|
72
|
-
/** Gets the raw resolved user data for a user option. @param name Option name. @param required If true, throws when missing. */
|
|
73
|
-
getUser(name: string, required?: false): Record<string, unknown> | null;
|
|
74
|
-
getUser(name: string, required: true): Record<string, unknown>;
|
|
75
|
-
/** Gets the raw resolved channel data for a channel option. @param name Option name. @param required If true, throws when missing. */
|
|
76
|
-
getChannel(name: string, required?: false): Record<string, unknown> | null;
|
|
77
|
-
getChannel(name: string, required: true): Record<string, unknown>;
|
|
78
|
-
/** Gets the raw resolved role data for a role option. @param name Option name. @param required If true, throws when missing. */
|
|
79
|
-
getRole(name: string, required?: false): Record<string, unknown> | null;
|
|
80
|
-
getRole(name: string, required: true): Record<string, unknown>;
|
|
81
|
-
/** Gets the raw resolved user or role data for a mentionable option. @param name Option name. @param required If true, throws when missing. */
|
|
82
|
-
getMentionable(name: string, required?: false): Record<string, unknown> | null;
|
|
83
|
-
getMentionable(name: string, required: true): Record<string, unknown>;
|
|
84
|
-
/** Gets the raw resolved attachment data for an attachment option. @param name Option name. @param required If true, throws when missing. */
|
|
85
|
-
getAttachment(name: string, required?: false): Record<string, unknown> | null;
|
|
86
|
-
getAttachment(name: string, required: true): Record<string, unknown>;
|
|
87
|
-
/** Returns the raw option list for advanced use cases. */
|
|
88
|
-
get raw(): readonly APIInteractionDataOption[];
|
|
89
|
-
}
|
|
38
|
+
export { CommandOptions, type APIInteractionDataOption } from "./options.js";
|
|
39
|
+
import { CommandOptions } from "./options.js";
|
|
90
40
|
/** A Discord interaction callback payload. */
|
|
91
41
|
export declare class InteractionResponse {
|
|
92
42
|
readonly type: number;
|
|
@@ -118,6 +68,13 @@ export declare class Interaction<TData extends InteractionData = InteractionData
|
|
|
118
68
|
/** Whether this interaction is a message component. @returns True for component interactions. */ isMessageComponent(): this is ComponentInteraction;
|
|
119
69
|
/** Whether this interaction is a modal submission. @returns True for modal submissions. */ isModalSubmit(): this is ModalSubmitInteraction;
|
|
120
70
|
/** Whether this interaction is autocomplete. @returns True for autocomplete interactions. */ isAutocomplete(): this is AutocompleteInteraction;
|
|
71
|
+
/** Whether this is a button interaction. */ isButton(): this is ComponentInteraction;
|
|
72
|
+
/** Whether this is a string select menu interaction. */ isStringSelectMenu(): this is ComponentInteraction;
|
|
73
|
+
/** Whether this is a user select menu interaction. */ isUserSelectMenu(): this is ComponentInteraction;
|
|
74
|
+
/** Whether this is a role select menu interaction. */ isRoleSelectMenu(): this is ComponentInteraction;
|
|
75
|
+
/** Whether this is a mentionable select menu interaction. */ isMentionableSelectMenu(): this is ComponentInteraction;
|
|
76
|
+
/** Whether this is a channel select menu interaction. */ isChannelSelectMenu(): this is ComponentInteraction;
|
|
77
|
+
/** Whether this is any select menu interaction. */ isAnySelectMenu(): this is ComponentInteraction;
|
|
121
78
|
/** Ensures the interaction has not already been acknowledged. @returns Nothing. @throws {Error} When already acknowledged. */ protected assertUnacknowledged(): void;
|
|
122
79
|
/** Ensures the interaction has been acknowledged. @returns Nothing. @throws {Error} When not acknowledged. */ protected assertAcknowledged(): void;
|
|
123
80
|
/** Posts a raw interaction response callback. */
|
|
@@ -167,6 +124,9 @@ export declare class ModalSubmitInteraction extends Interaction {
|
|
|
167
124
|
}
|
|
168
125
|
/** Represents a Discord slash command autocomplete interaction. */
|
|
169
126
|
export declare class AutocompleteInteraction extends Interaction {
|
|
127
|
+
/** Option resolver; use `options.getFocused()` for the focused value. */
|
|
128
|
+
readonly options: CommandOptions;
|
|
129
|
+
constructor(client: InteractionClient, data: InteractionData);
|
|
170
130
|
/** Gets the target command name. */
|
|
171
131
|
get commandName(): string;
|
|
172
132
|
/** Gets the currently focused autocomplete option. */
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/** Raw Discord application command interaction data option. */
|
|
2
|
+
export interface APIInteractionDataOption {
|
|
3
|
+
name: string;
|
|
4
|
+
type: number;
|
|
5
|
+
value?: string | number | boolean;
|
|
6
|
+
options?: APIInteractionDataOption[];
|
|
7
|
+
focused?: boolean;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Typed resolver for application command options.
|
|
11
|
+
* Attached as `CommandInteraction.options`.
|
|
12
|
+
*/
|
|
13
|
+
export declare class CommandOptions {
|
|
14
|
+
#private;
|
|
15
|
+
/** @internal */
|
|
16
|
+
constructor(options: APIInteractionDataOption[], resolved?: Record<string, unknown>);
|
|
17
|
+
/** Returns the invoked subcommand name, or null if none. */
|
|
18
|
+
getSubcommand(required?: false): string | null;
|
|
19
|
+
getSubcommand(required: true): string;
|
|
20
|
+
/** Returns the invoked subcommand group name, or null if none. */
|
|
21
|
+
getSubcommandGroup(required?: false): string | null;
|
|
22
|
+
getSubcommandGroup(required: true): string;
|
|
23
|
+
/** Returns the focused option's value (autocomplete), or the full option when `full` is true. @throws {TypeError} If no option is focused. */
|
|
24
|
+
getFocused(full: true): APIInteractionDataOption;
|
|
25
|
+
getFocused(full?: false): string | number | boolean;
|
|
26
|
+
/** Gets a string option. @param name Option name. @param required If true, throws when missing. */
|
|
27
|
+
getString(name: string, required?: false): string | null;
|
|
28
|
+
getString(name: string, required: true): string;
|
|
29
|
+
/** Gets an integer option. @param name Option name. @param required If true, throws when missing. */
|
|
30
|
+
getInteger(name: string, required?: false): number | null;
|
|
31
|
+
getInteger(name: string, required: true): number;
|
|
32
|
+
/** Gets a number (float) option. @param name Option name. @param required If true, throws when missing. */
|
|
33
|
+
getNumber(name: string, required?: false): number | null;
|
|
34
|
+
getNumber(name: string, required: true): number;
|
|
35
|
+
/** Gets a boolean option. @param name Option name. @param required If true, throws when missing. */
|
|
36
|
+
getBoolean(name: string, required?: false): boolean | null;
|
|
37
|
+
getBoolean(name: string, required: true): boolean;
|
|
38
|
+
/** Gets the raw resolved user data for a user option. @param name Option name. @param required If true, throws when missing. */
|
|
39
|
+
getUser(name: string, required?: false): Record<string, unknown> | null;
|
|
40
|
+
getUser(name: string, required: true): Record<string, unknown>;
|
|
41
|
+
/** Gets the raw resolved channel data for a channel option. @param name Option name. @param required If true, throws when missing. */
|
|
42
|
+
getChannel(name: string, required?: false): Record<string, unknown> | null;
|
|
43
|
+
getChannel(name: string, required: true): Record<string, unknown>;
|
|
44
|
+
/** Gets the raw resolved role data for a role option. @param name Option name. @param required If true, throws when missing. */
|
|
45
|
+
getRole(name: string, required?: false): Record<string, unknown> | null;
|
|
46
|
+
getRole(name: string, required: true): Record<string, unknown>;
|
|
47
|
+
/** Gets the raw resolved user or role data for a mentionable option. @param name Option name. @param required If true, throws when missing. */
|
|
48
|
+
getMentionable(name: string, required?: false): Record<string, unknown> | null;
|
|
49
|
+
getMentionable(name: string, required: true): Record<string, unknown>;
|
|
50
|
+
/** Gets the raw resolved attachment data for an attachment option. @param name Option name. @param required If true, throws when missing. */
|
|
51
|
+
getAttachment(name: string, required?: false): Record<string, unknown> | null;
|
|
52
|
+
getAttachment(name: string, required: true): Record<string, unknown>;
|
|
53
|
+
/** Returns the raw option list for advanced use cases. */
|
|
54
|
+
get raw(): readonly APIInteractionDataOption[];
|
|
55
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BaseStructure, Channel, User } from "./base.js";
|
|
2
|
-
import { PermissionsBitField } from "
|
|
2
|
+
import { PermissionsBitField } from "@lunibee/core";
|
|
3
|
+
import type { ImageURLOptions } from "./base.js";
|
|
3
4
|
/** A Discord guild member. */
|
|
4
5
|
export declare class GuildMember {
|
|
5
6
|
/** User represented by the member. */ readonly user: User;
|
|
@@ -9,6 +10,10 @@ export declare class GuildMember {
|
|
|
9
10
|
/** Whether the member is pending membership screening. */ pending: boolean;
|
|
10
11
|
/** Member join timestamp. */ joinedAt?: Date;
|
|
11
12
|
/** Raw effective permission bitfield supplied by Discord. */ readonly permissions: PermissionsBitField;
|
|
13
|
+
/** Member-specific avatar hash, if set. */ avatarHash: string | null;
|
|
14
|
+
/** When the member started boosting the guild. */ premiumSince: Date | null;
|
|
15
|
+
/** When the member's timeout expires (null if not timed out). */ timedOutUntil: Date | null;
|
|
16
|
+
/** Member flags bitfield. */ flags: number;
|
|
12
17
|
/** Creates a guild member from Discord data. @param data Discord guild-member payload. @throws {TypeError} If the guild ID is invalid. @throws {RangeError} If joined_at is invalid. */
|
|
13
18
|
constructor(data: {
|
|
14
19
|
user: {
|
|
@@ -19,6 +24,7 @@ export declare class GuildMember {
|
|
|
19
24
|
bot?: boolean;
|
|
20
25
|
system?: boolean;
|
|
21
26
|
public_flags?: number;
|
|
27
|
+
discriminator?: string;
|
|
22
28
|
};
|
|
23
29
|
guild_id: string;
|
|
24
30
|
nick?: string | null;
|
|
@@ -26,20 +32,34 @@ export declare class GuildMember {
|
|
|
26
32
|
pending?: boolean;
|
|
27
33
|
joined_at?: string;
|
|
28
34
|
permissions?: string;
|
|
35
|
+
avatar?: string | null;
|
|
36
|
+
premium_since?: string | null;
|
|
37
|
+
communication_disabled_until?: string | null;
|
|
38
|
+
flags?: number;
|
|
29
39
|
});
|
|
30
|
-
/** Effective member display name
|
|
40
|
+
/** Effective member display name — nickname, falling back to user display name. */
|
|
31
41
|
get displayName(): string;
|
|
42
|
+
/** Whether this member is currently timed out. */
|
|
43
|
+
get isTimedOut(): boolean;
|
|
44
|
+
/** Returns the member-specific avatar URL, falling back to the user's avatar, or null if none. */
|
|
45
|
+
avatarURL(options?: ImageURLOptions): string | null;
|
|
46
|
+
/** Returns the resolved avatar URL — member avatar, user avatar, or default. */
|
|
47
|
+
displayAvatarURL(options?: ImageURLOptions): string;
|
|
32
48
|
/** Returns the Discord user mention for this member. */
|
|
33
49
|
toString(): string;
|
|
34
50
|
}
|
|
35
51
|
/** A Discord guild role. */
|
|
36
52
|
export declare class Role extends BaseStructure {
|
|
37
53
|
/** Role name. */ name: string;
|
|
38
|
-
/** Role color. */ color: number;
|
|
54
|
+
/** Role color as a 24-bit RGB integer. */ color: number;
|
|
39
55
|
/** Whether the role is hoisted. */ hoist: boolean;
|
|
40
56
|
/** Permission bitfield. */ permissions: PermissionsBitField;
|
|
41
|
-
/** Whether the role is managed. */ managed: boolean;
|
|
57
|
+
/** Whether the role is managed by an integration. */ managed: boolean;
|
|
42
58
|
/** Whether the role is mentionable. */ mentionable: boolean;
|
|
59
|
+
/** Role position in the hierarchy. */ position: number;
|
|
60
|
+
/** Unicode emoji used as the role icon, if any. */ unicodeEmoji: string | null;
|
|
61
|
+
/** Hash of the role's custom icon image, if any. */ iconHash: string | null;
|
|
62
|
+
/** Role tags metadata (bot, premium subscriber, etc). */ tags: Record<string, unknown> | null;
|
|
43
63
|
/** Creates a role from Discord data. @param data Discord role payload. */
|
|
44
64
|
constructor(data: {
|
|
45
65
|
id: string;
|
|
@@ -49,7 +69,17 @@ export declare class Role extends BaseStructure {
|
|
|
49
69
|
permissions?: string;
|
|
50
70
|
managed?: boolean;
|
|
51
71
|
mentionable?: boolean;
|
|
72
|
+
position?: number;
|
|
73
|
+
unicode_emoji?: string | null;
|
|
74
|
+
icon?: string | null;
|
|
75
|
+
tags?: Record<string, unknown> | null;
|
|
52
76
|
});
|
|
77
|
+
/** Returns the role's color as a `#RRGGBB` hex string. Returns `#000000` for colorless roles. */
|
|
78
|
+
get colorHex(): string;
|
|
79
|
+
/** Returns the role's custom icon URL, or null if the role has no icon. */
|
|
80
|
+
iconURL(options?: ImageURLOptions): string | null;
|
|
81
|
+
/** Whether this is the `@everyone` base role (its ID equals the guild ID). */
|
|
82
|
+
isEveryone(guildId: string): boolean;
|
|
53
83
|
/** Discord role mention string. Used automatically in template literals. */
|
|
54
84
|
toString(): string;
|
|
55
85
|
}
|
|
@@ -59,10 +89,168 @@ export declare class TextChannel extends Channel {
|
|
|
59
89
|
constructor(data: {
|
|
60
90
|
id: string;
|
|
61
91
|
type: number;
|
|
62
|
-
name?: string;
|
|
92
|
+
name?: string | null;
|
|
63
93
|
parent_id?: string | null;
|
|
64
94
|
guild_id?: string;
|
|
65
|
-
}
|
|
95
|
+
} & Partial<import("@lunibee/types").APIChannel>, context?: import("./base.js").ResourceContext);
|
|
66
96
|
/** Discord channel mention string. Used automatically in template literals. */
|
|
67
97
|
toString(): string;
|
|
68
98
|
}
|
|
99
|
+
/** A Discord invite link and its metadata. */
|
|
100
|
+
export declare class Invite {
|
|
101
|
+
/** Invite code (the unique part of the URL). */ readonly code: string;
|
|
102
|
+
/** Guild this invite belongs to, if any. */ readonly guildId: string | null;
|
|
103
|
+
/** Channel this invite points to, if any. */ readonly channelId: string | null;
|
|
104
|
+
/** User who created the invite, if available. */ readonly inviter: User | null;
|
|
105
|
+
/** Number of times the invite has been used. */ uses: number;
|
|
106
|
+
/** Maximum number of uses (0 = unlimited). */ maxUses: number;
|
|
107
|
+
/** Duration in seconds until the invite expires (0 = never). */ maxAge: number;
|
|
108
|
+
/** Whether the invite is temporary (kicks uninducted members on disconnect). */ temporary: boolean;
|
|
109
|
+
/** When the invite was created. */ readonly createdAt: Date | null;
|
|
110
|
+
/** When the invite expires, or null if it never expires. */ readonly expiresAt: Date | null;
|
|
111
|
+
/** Creates an invite from Discord data. */
|
|
112
|
+
constructor(data: {
|
|
113
|
+
code: string;
|
|
114
|
+
guild?: {
|
|
115
|
+
id: string;
|
|
116
|
+
} | null;
|
|
117
|
+
channel?: {
|
|
118
|
+
id: string;
|
|
119
|
+
} | null;
|
|
120
|
+
inviter?: {
|
|
121
|
+
id: string;
|
|
122
|
+
username: string;
|
|
123
|
+
global_name?: string | null;
|
|
124
|
+
avatar?: string | null;
|
|
125
|
+
bot?: boolean;
|
|
126
|
+
system?: boolean;
|
|
127
|
+
public_flags?: number;
|
|
128
|
+
discriminator?: string;
|
|
129
|
+
} | null;
|
|
130
|
+
uses?: number;
|
|
131
|
+
max_uses?: number;
|
|
132
|
+
max_age?: number;
|
|
133
|
+
temporary?: boolean;
|
|
134
|
+
created_at?: string | null;
|
|
135
|
+
expires_at?: string | null;
|
|
136
|
+
});
|
|
137
|
+
/** The full invite URL. */
|
|
138
|
+
get url(): string;
|
|
139
|
+
/** Returns the invite URL. Used automatically in template literals. */
|
|
140
|
+
toString(): string;
|
|
141
|
+
}
|
|
142
|
+
/** Webhook type constants. */
|
|
143
|
+
export declare const WebhookType: {
|
|
144
|
+
readonly Incoming: 1;
|
|
145
|
+
readonly ChannelFollower: 2;
|
|
146
|
+
readonly Application: 3;
|
|
147
|
+
};
|
|
148
|
+
/** A Discord webhook — an HTTP endpoint that can post messages to a channel. */
|
|
149
|
+
export declare class Webhook extends BaseStructure {
|
|
150
|
+
/** Webhook type. */ readonly type: number;
|
|
151
|
+
/** Webhook display name. */ name: string | null;
|
|
152
|
+
/** Webhook avatar hash. */ avatarHash: string | null;
|
|
153
|
+
/** Channel this webhook posts to. */ readonly channelId: string | null;
|
|
154
|
+
/** Guild this webhook belongs to. */ readonly guildId: string | null;
|
|
155
|
+
/** Application that created this webhook, if any. */ readonly applicationId: string | null;
|
|
156
|
+
/** Webhook token (only present for incoming webhooks). */ readonly token: string | null;
|
|
157
|
+
/** Creates a webhook from Discord data. */
|
|
158
|
+
constructor(data: {
|
|
159
|
+
id: string;
|
|
160
|
+
type?: number;
|
|
161
|
+
name?: string | null;
|
|
162
|
+
avatar?: string | null;
|
|
163
|
+
channel_id?: string | null;
|
|
164
|
+
guild_id?: string | null;
|
|
165
|
+
application_id?: string | null;
|
|
166
|
+
token?: string;
|
|
167
|
+
});
|
|
168
|
+
/** Returns the webhook avatar URL, or null if no avatar is set. */
|
|
169
|
+
avatarURL(options?: ImageURLOptions): string | null;
|
|
170
|
+
/** Returns the webhook execution URL, or null if no token is set. */
|
|
171
|
+
get url(): string | null;
|
|
172
|
+
/** Returns the webhook URL or its ID as a string. */
|
|
173
|
+
toString(): string;
|
|
174
|
+
}
|
|
175
|
+
/** A Discord emoji. */
|
|
176
|
+
export declare class Emoji extends BaseStructure {
|
|
177
|
+
/** Emoji name. */ name: string | null;
|
|
178
|
+
/** Roles allowed to use this emoji. */ roleIds: string[];
|
|
179
|
+
/** User that created this emoji. */ user: User | null;
|
|
180
|
+
/** Whether this emoji must be wrapped in colons. */ requireColons: boolean;
|
|
181
|
+
/** Whether this emoji is managed. */ managed: boolean;
|
|
182
|
+
/** Whether this emoji is animated. */ animated: boolean;
|
|
183
|
+
/** Whether this emoji can be used, may be false due to loss of Server Boosts. */ available: boolean;
|
|
184
|
+
/** Creates an emoji from Discord data. */
|
|
185
|
+
constructor(data: {
|
|
186
|
+
id: string | null;
|
|
187
|
+
name: string | null;
|
|
188
|
+
roles?: string[];
|
|
189
|
+
user?: import("@lunibee/types").UserData;
|
|
190
|
+
require_colons?: boolean;
|
|
191
|
+
managed?: boolean;
|
|
192
|
+
animated?: boolean;
|
|
193
|
+
available?: boolean;
|
|
194
|
+
});
|
|
195
|
+
/** Returns the URL for this emoji if it is custom, or null for unicode emojis. */
|
|
196
|
+
url(options?: ImageURLOptions): string | null;
|
|
197
|
+
/** Returns the text required to render this emoji in Discord. */
|
|
198
|
+
toString(): string;
|
|
199
|
+
}
|
|
200
|
+
/** A Discord AutoModeration Rule. */
|
|
201
|
+
export declare class AutoModerationRule extends BaseStructure {
|
|
202
|
+
guildId: string;
|
|
203
|
+
name: string;
|
|
204
|
+
creatorId: string;
|
|
205
|
+
eventType: number;
|
|
206
|
+
triggerType: number;
|
|
207
|
+
triggerMetadata: Record<string, unknown>;
|
|
208
|
+
actions: import("@lunibee/types").APIAutoModerationAction[];
|
|
209
|
+
enabled: boolean;
|
|
210
|
+
exemptRoles: string[];
|
|
211
|
+
exemptChannels: string[];
|
|
212
|
+
/** Creates an auto moderation rule from Discord data. */
|
|
213
|
+
constructor(data: import("@lunibee/types").APIAutoModerationRule);
|
|
214
|
+
toJSON(): Record<string, unknown>;
|
|
215
|
+
}
|
|
216
|
+
/** A channel listed in a guild's Welcome Screen. */
|
|
217
|
+
export declare class WelcomeScreenChannel {
|
|
218
|
+
channelId: string;
|
|
219
|
+
description: string;
|
|
220
|
+
emojiId: string | null;
|
|
221
|
+
emojiName: string | null;
|
|
222
|
+
constructor(data: import("@lunibee/types").APIWelcomeScreenChannel);
|
|
223
|
+
}
|
|
224
|
+
/** A Discord Guild Welcome Screen. */
|
|
225
|
+
export declare class GuildWelcomeScreen {
|
|
226
|
+
description: string | null;
|
|
227
|
+
channels: WelcomeScreenChannel[];
|
|
228
|
+
constructor(data: import("@lunibee/types").APIGuildWelcomeScreen);
|
|
229
|
+
}
|
|
230
|
+
/** An option within a Guild Onboarding Prompt. */
|
|
231
|
+
export declare class OnboardingPromptOption extends BaseStructure {
|
|
232
|
+
channelIds: string[];
|
|
233
|
+
roleIds: string[];
|
|
234
|
+
emoji: import("@lunibee/types").APIPartialEmoji | undefined;
|
|
235
|
+
title: string;
|
|
236
|
+
description: string | null;
|
|
237
|
+
constructor(data: import("@lunibee/types").APIOnboardingPromptOption);
|
|
238
|
+
}
|
|
239
|
+
/** A prompt shown during Guild Onboarding. */
|
|
240
|
+
export declare class OnboardingPrompt extends BaseStructure {
|
|
241
|
+
type: number;
|
|
242
|
+
options: OnboardingPromptOption[];
|
|
243
|
+
title: string;
|
|
244
|
+
singleSelect: boolean;
|
|
245
|
+
required: boolean;
|
|
246
|
+
inOnboarding: boolean;
|
|
247
|
+
constructor(data: import("@lunibee/types").APIOnboardingPrompt);
|
|
248
|
+
}
|
|
249
|
+
/** A Discord Guild Onboarding setup. */
|
|
250
|
+
export declare class GuildOnboarding extends BaseStructure {
|
|
251
|
+
prompts: OnboardingPrompt[];
|
|
252
|
+
defaultChannelIds: string[];
|
|
253
|
+
enabled: boolean;
|
|
254
|
+
mode: number;
|
|
255
|
+
constructor(data: import("@lunibee/types").APIGuildOnboarding);
|
|
256
|
+
}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import type { APIChannel, APIEmoji, APIGuildMember, APIPartialEmoji, APIPresenceUpdate, APIRole, APISticker, APIThreadMember, Snowflake, UserData } from "./index.js";
|
|
2
|
+
/** Raw Discord READY event payload. */
|
|
3
|
+
export interface APIReadyEvent {
|
|
4
|
+
v: number;
|
|
5
|
+
user: UserData;
|
|
6
|
+
guilds: Array<{
|
|
7
|
+
id: Snowflake;
|
|
8
|
+
unavailable?: boolean;
|
|
9
|
+
}>;
|
|
10
|
+
session_id: string;
|
|
11
|
+
resume_gateway_url: string;
|
|
12
|
+
shard?: [number, number];
|
|
13
|
+
application?: {
|
|
14
|
+
id: Snowflake;
|
|
15
|
+
flags: number;
|
|
16
|
+
[key: string]: unknown;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
/** Raw Discord reaction event payload. */
|
|
20
|
+
export interface APIMessageReactionEvent {
|
|
21
|
+
user_id: Snowflake;
|
|
22
|
+
channel_id: Snowflake;
|
|
23
|
+
message_id: Snowflake;
|
|
24
|
+
guild_id?: Snowflake;
|
|
25
|
+
member?: APIGuildMember;
|
|
26
|
+
emoji: APIPartialEmoji;
|
|
27
|
+
message_author_id?: Snowflake;
|
|
28
|
+
burst?: boolean;
|
|
29
|
+
type?: number;
|
|
30
|
+
}
|
|
31
|
+
/** Raw Discord reaction remove emoji event payload. */
|
|
32
|
+
export interface APIMessageReactionRemoveEmojiEvent {
|
|
33
|
+
channel_id: Snowflake;
|
|
34
|
+
guild_id?: Snowflake;
|
|
35
|
+
message_id: Snowflake;
|
|
36
|
+
emoji: APIPartialEmoji;
|
|
37
|
+
}
|
|
38
|
+
/** Raw Discord message deletion event payload. */
|
|
39
|
+
export interface APIMessageDeleteEvent {
|
|
40
|
+
id: Snowflake;
|
|
41
|
+
channel_id: Snowflake;
|
|
42
|
+
guild_id?: Snowflake;
|
|
43
|
+
}
|
|
44
|
+
/** Raw Discord bulk message deletion event payload. */
|
|
45
|
+
export interface APIMessageDeleteBulkEvent {
|
|
46
|
+
ids: Snowflake[];
|
|
47
|
+
channel_id: Snowflake;
|
|
48
|
+
guild_id?: Snowflake;
|
|
49
|
+
}
|
|
50
|
+
/** Raw Discord channel deletion event payload. */
|
|
51
|
+
export interface APIChannelDeleteEvent extends APIChannel {
|
|
52
|
+
}
|
|
53
|
+
/** Raw Discord guild deletion event payload. */
|
|
54
|
+
export interface APIGuildDeleteEvent {
|
|
55
|
+
id: Snowflake;
|
|
56
|
+
unavailable?: boolean;
|
|
57
|
+
}
|
|
58
|
+
/** Raw Discord thread lifecycle payload. */
|
|
59
|
+
export interface APIThreadEvent extends APIChannel {
|
|
60
|
+
guild_id: Snowflake;
|
|
61
|
+
member?: APIThreadMember;
|
|
62
|
+
}
|
|
63
|
+
/** Raw Discord thread list sync event. */
|
|
64
|
+
export interface APIThreadListSync {
|
|
65
|
+
guild_id: Snowflake;
|
|
66
|
+
channel_ids?: Snowflake[];
|
|
67
|
+
threads: APIChannel[];
|
|
68
|
+
members: APIThreadMember[];
|
|
69
|
+
}
|
|
70
|
+
/** Raw Discord thread members update event. */
|
|
71
|
+
export interface APIThreadMembersUpdate {
|
|
72
|
+
id: Snowflake;
|
|
73
|
+
guild_id: Snowflake;
|
|
74
|
+
member_count: number;
|
|
75
|
+
added_members?: APIThreadMember[];
|
|
76
|
+
removed_member_ids?: Snowflake[];
|
|
77
|
+
}
|
|
78
|
+
/** Raw Discord guild role event payload. */
|
|
79
|
+
export interface APIGuildRoleEvent {
|
|
80
|
+
guild_id: Snowflake;
|
|
81
|
+
role: APIRole;
|
|
82
|
+
}
|
|
83
|
+
/** Raw Discord guild role delete event payload. */
|
|
84
|
+
export interface APIGuildRoleDeleteEvent {
|
|
85
|
+
guild_id: Snowflake;
|
|
86
|
+
role_id: Snowflake;
|
|
87
|
+
}
|
|
88
|
+
/** Raw Discord guild ban event payload. */
|
|
89
|
+
export interface APIGuildBanEvent {
|
|
90
|
+
guild_id: Snowflake;
|
|
91
|
+
user: UserData;
|
|
92
|
+
}
|
|
93
|
+
/** Raw Discord guild emojis update event payload. */
|
|
94
|
+
export interface APIGuildEmojisUpdateEvent {
|
|
95
|
+
guild_id: Snowflake;
|
|
96
|
+
emojis: APIEmoji[];
|
|
97
|
+
}
|
|
98
|
+
/** Raw Discord guild stickers update event payload. */
|
|
99
|
+
export interface APIGuildStickersUpdateEvent {
|
|
100
|
+
guild_id: Snowflake;
|
|
101
|
+
stickers: APISticker[];
|
|
102
|
+
}
|
|
103
|
+
/** Raw Discord channel pins update event. */
|
|
104
|
+
export interface APIChannelPinsUpdate {
|
|
105
|
+
guild_id?: Snowflake;
|
|
106
|
+
channel_id: Snowflake;
|
|
107
|
+
last_pin_timestamp?: string | null;
|
|
108
|
+
}
|
|
109
|
+
/** Raw Discord guild members chunk event. */
|
|
110
|
+
export interface APIGuildMembersChunk {
|
|
111
|
+
guild_id: Snowflake;
|
|
112
|
+
members: APIGuildMember[];
|
|
113
|
+
chunk_index: number;
|
|
114
|
+
chunk_count: number;
|
|
115
|
+
not_found?: Snowflake[];
|
|
116
|
+
presences?: APIPresenceUpdate[];
|
|
117
|
+
nonce?: string;
|
|
118
|
+
}
|
|
119
|
+
/** Raw Discord guild scheduled event user add/remove event. */
|
|
120
|
+
export interface APIGuildScheduledEventUserEvent {
|
|
121
|
+
guild_scheduled_event_id: Snowflake;
|
|
122
|
+
user_id: Snowflake;
|
|
123
|
+
guild_id: Snowflake;
|
|
124
|
+
}
|
|
125
|
+
/** Raw Discord message poll vote add/remove event. */
|
|
126
|
+
export interface APIMessagePollVoteEvent {
|
|
127
|
+
user_id: Snowflake;
|
|
128
|
+
channel_id: Snowflake;
|
|
129
|
+
message_id: Snowflake;
|
|
130
|
+
guild_id?: Snowflake;
|
|
131
|
+
answer_id: number;
|
|
132
|
+
}
|