lunibee 0.1.0 → 0.1.2
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 +229 -0
- package/dist/builders/attachment.d.ts +20 -0
- package/dist/builders/commands.d.ts +118 -0
- package/dist/builders/components.d.ts +151 -0
- package/dist/builders/embed.d.ts +59 -0
- package/dist/builders/index.d.ts +5 -0
- package/dist/builders/index.js +828 -0
- package/dist/builders/index.js.map +13 -0
- package/dist/collection/cache.d.ts +37 -0
- package/dist/collection/index.d.ts +47 -0
- package/dist/collection/index.js +214 -0
- package/dist/collection/index.js.map +11 -0
- package/dist/core/client-state.d.ts +10 -0
- package/dist/core/collector.d.ts +27 -0
- package/dist/core/events.d.ts +5 -0
- package/dist/core/index.d.ts +111 -0
- package/dist/core/index.js +3188 -0
- package/dist/core/index.js.map +29 -0
- package/dist/core/permissions.d.ts +293 -0
- package/dist/formatters/index.d.ts +10 -0
- package/dist/formatters/index.js +43 -0
- package/dist/formatters/index.js.map +10 -0
- package/dist/handlers/index.d.ts +16 -0
- package/dist/handlers/index.js +37 -0
- package/dist/handlers/index.js.map +10 -0
- package/{src/index.ts → dist/index.d.ts} +2 -29
- package/dist/index.js +4182 -0
- package/dist/index.js.map +41 -0
- package/dist/managers/application.d.ts +28 -0
- package/dist/managers/base.d.ts +28 -0
- package/dist/managers/index.d.ts +96 -0
- package/dist/managers/index.js +947 -0
- package/dist/managers/index.js.map +22 -0
- package/dist/managers/member.d.ts +35 -0
- package/dist/managers/message.d.ts +25 -0
- package/dist/managers/role.d.ts +34 -0
- package/dist/managers/thread.d.ts +14 -0
- package/dist/rest/index.d.ts +49 -0
- package/dist/rest/index.js +344 -0
- package/dist/rest/index.js.map +12 -0
- package/dist/rest/routes.d.ts +44 -0
- package/dist/rest/types.d.ts +26 -0
- package/dist/rest/webhook.d.ts +40 -0
- package/dist/sharding/bus.d.ts +22 -0
- package/dist/sharding/index.d.ts +34 -0
- package/dist/sharding/index.js +732 -0
- package/dist/sharding/index.js.map +13 -0
- package/dist/structures/base.d.ts +75 -0
- package/dist/structures/index.d.ts +39 -0
- package/dist/structures/index.js +571 -0
- package/dist/structures/index.js.map +14 -0
- package/dist/structures/interactions.d.ts +136 -0
- package/dist/structures/permissions.d.ts +73 -0
- package/dist/structures/resources.d.ts +64 -0
- package/dist/types/index.d.ts +535 -0
- package/dist/types/index.js +132 -0
- package/dist/types/index.js.map +10 -0
- package/dist/utils/index.d.ts +6 -0
- package/dist/utils/index.js +18 -0
- package/dist/utils/index.js.map +10 -0
- package/dist/voice/index.d.ts +97 -0
- package/dist/voice/index.js +161 -0
- package/dist/voice/index.js.map +10 -0
- package/dist/ws/index.d.ts +76 -0
- package/dist/ws/index.js +582 -0
- package/dist/ws/index.js.map +11 -0
- package/package.json +113 -28
|
@@ -0,0 +1,535 @@
|
|
|
1
|
+
/** Discord API snowflake identifier. */
|
|
2
|
+
export type Snowflake = string;
|
|
3
|
+
/** Gateway intent bit flags supported by Discord (PascalCase). */
|
|
4
|
+
export declare const GatewayIntentBits: {
|
|
5
|
+
readonly Guilds: number;
|
|
6
|
+
readonly GuildMembers: number;
|
|
7
|
+
readonly GuildModeration: number;
|
|
8
|
+
readonly GuildExpressions: number;
|
|
9
|
+
readonly GuildIntegrations: number;
|
|
10
|
+
readonly GuildWebhooks: number;
|
|
11
|
+
readonly GuildInvites: number;
|
|
12
|
+
readonly GuildVoiceStates: number;
|
|
13
|
+
readonly GuildPresences: number;
|
|
14
|
+
readonly GuildMessages: number;
|
|
15
|
+
readonly GuildMessageReactions: number;
|
|
16
|
+
readonly GuildMessageTyping: number;
|
|
17
|
+
readonly DirectMessages: number;
|
|
18
|
+
readonly DirectMessageReactions: number;
|
|
19
|
+
readonly DirectMessageTyping: number;
|
|
20
|
+
readonly MessageContent: number;
|
|
21
|
+
readonly GuildScheduledEvents: number;
|
|
22
|
+
readonly AutoModerationConfiguration: number;
|
|
23
|
+
readonly AutoModerationExecution: number;
|
|
24
|
+
readonly GuildMessagePolls: number;
|
|
25
|
+
readonly DirectMessagePolls: number;
|
|
26
|
+
};
|
|
27
|
+
/** Idiomatic camelCase Gateway intent bit flags supported by Discord. */
|
|
28
|
+
export declare const IntentBits: {
|
|
29
|
+
readonly guild: number;
|
|
30
|
+
readonly guilds: number;
|
|
31
|
+
readonly guildMembers: number;
|
|
32
|
+
readonly guildModeration: number;
|
|
33
|
+
readonly guildBans: number;
|
|
34
|
+
readonly guildExpressions: number;
|
|
35
|
+
readonly guildEmojis: number;
|
|
36
|
+
readonly guildEmojisAndStickers: number;
|
|
37
|
+
readonly guildIntegrations: number;
|
|
38
|
+
readonly guildWebhooks: number;
|
|
39
|
+
readonly guildInvites: number;
|
|
40
|
+
readonly guildVoiceStates: number;
|
|
41
|
+
readonly guildPresences: number;
|
|
42
|
+
readonly guildMessages: number;
|
|
43
|
+
readonly guildMessage: number;
|
|
44
|
+
readonly guildMessageReactions: number;
|
|
45
|
+
readonly guildMessageTyping: number;
|
|
46
|
+
readonly directMessages: number;
|
|
47
|
+
readonly directMessageReactions: number;
|
|
48
|
+
readonly directMessageTyping: number;
|
|
49
|
+
readonly messageContent: number;
|
|
50
|
+
readonly guildScheduledEvents: number;
|
|
51
|
+
readonly autoModerationConfiguration: number;
|
|
52
|
+
readonly autoModerationExecution: number;
|
|
53
|
+
readonly guildMessagePolls: number;
|
|
54
|
+
readonly directMessagePolls: number;
|
|
55
|
+
};
|
|
56
|
+
/** Alias for IntentBits. */
|
|
57
|
+
export declare const Intents: {
|
|
58
|
+
readonly guild: number;
|
|
59
|
+
readonly guilds: number;
|
|
60
|
+
readonly guildMembers: number;
|
|
61
|
+
readonly guildModeration: number;
|
|
62
|
+
readonly guildBans: number;
|
|
63
|
+
readonly guildExpressions: number;
|
|
64
|
+
readonly guildEmojis: number;
|
|
65
|
+
readonly guildEmojisAndStickers: number;
|
|
66
|
+
readonly guildIntegrations: number;
|
|
67
|
+
readonly guildWebhooks: number;
|
|
68
|
+
readonly guildInvites: number;
|
|
69
|
+
readonly guildVoiceStates: number;
|
|
70
|
+
readonly guildPresences: number;
|
|
71
|
+
readonly guildMessages: number;
|
|
72
|
+
readonly guildMessage: number;
|
|
73
|
+
readonly guildMessageReactions: number;
|
|
74
|
+
readonly guildMessageTyping: number;
|
|
75
|
+
readonly directMessages: number;
|
|
76
|
+
readonly directMessageReactions: number;
|
|
77
|
+
readonly directMessageTyping: number;
|
|
78
|
+
readonly messageContent: number;
|
|
79
|
+
readonly guildScheduledEvents: number;
|
|
80
|
+
readonly autoModerationConfiguration: number;
|
|
81
|
+
readonly autoModerationExecution: number;
|
|
82
|
+
readonly guildMessagePolls: number;
|
|
83
|
+
readonly directMessagePolls: number;
|
|
84
|
+
};
|
|
85
|
+
/** Gateway intent resolvable value (single bitfield, enum key, or array of bitfields/strings). */
|
|
86
|
+
export type GatewayIntentResolvable = number | keyof typeof GatewayIntentBits | keyof typeof IntentBits | (number | keyof typeof GatewayIntentBits | keyof typeof IntentBits | string)[];
|
|
87
|
+
/** Resolves any GatewayIntentResolvable into a raw bitfield integer. */
|
|
88
|
+
export declare function resolveGatewayIntents(intents: GatewayIntentResolvable): number;
|
|
89
|
+
/** Gateway connection properties (OS, browser, device). */
|
|
90
|
+
export interface GatewayProperties {
|
|
91
|
+
os?: string;
|
|
92
|
+
browser?: string;
|
|
93
|
+
device?: string;
|
|
94
|
+
[key: string]: unknown;
|
|
95
|
+
}
|
|
96
|
+
/** Gateway presence activity. */
|
|
97
|
+
export interface GatewayPresenceActivity {
|
|
98
|
+
name: string;
|
|
99
|
+
type?: number;
|
|
100
|
+
url?: string;
|
|
101
|
+
state?: string;
|
|
102
|
+
}
|
|
103
|
+
/** Gateway presence data. */
|
|
104
|
+
export interface GatewayPresence {
|
|
105
|
+
status?: "online" | "dnd" | "idle" | "invisible" | "offline";
|
|
106
|
+
activities?: GatewayPresenceActivity[];
|
|
107
|
+
afk?: boolean;
|
|
108
|
+
since?: number | null;
|
|
109
|
+
}
|
|
110
|
+
/** Client configuration. */
|
|
111
|
+
export interface ClientOptions {
|
|
112
|
+
token: string;
|
|
113
|
+
intents: GatewayIntentResolvable;
|
|
114
|
+
gateway?: GatewayOptions;
|
|
115
|
+
rest?: RESTOptions;
|
|
116
|
+
}
|
|
117
|
+
/** Gateway connection configuration. */
|
|
118
|
+
export interface GatewayOptions {
|
|
119
|
+
intents?: GatewayIntentResolvable;
|
|
120
|
+
reconnect?: boolean;
|
|
121
|
+
maxReconnectAttempts?: number;
|
|
122
|
+
reconnectBaseDelay?: number;
|
|
123
|
+
reconnectMaxDelay?: number;
|
|
124
|
+
shardId?: number;
|
|
125
|
+
shardCount?: number;
|
|
126
|
+
properties?: GatewayProperties;
|
|
127
|
+
presence?: GatewayPresence;
|
|
128
|
+
}
|
|
129
|
+
/** REST request configuration. */
|
|
130
|
+
export interface RESTOptions {
|
|
131
|
+
timeout?: number;
|
|
132
|
+
retries?: number;
|
|
133
|
+
baseURL?: string;
|
|
134
|
+
}
|
|
135
|
+
/** Discord user object. */
|
|
136
|
+
export interface UserData {
|
|
137
|
+
id: Snowflake;
|
|
138
|
+
username: string;
|
|
139
|
+
discriminator?: string;
|
|
140
|
+
global_name?: string | null;
|
|
141
|
+
avatar?: string | null;
|
|
142
|
+
bot?: boolean;
|
|
143
|
+
system?: boolean;
|
|
144
|
+
public_flags?: number;
|
|
145
|
+
}
|
|
146
|
+
/** Current authenticated bot user. */
|
|
147
|
+
export type ClientUser = UserData;
|
|
148
|
+
/** Discord Gateway payload envelope. */
|
|
149
|
+
export interface GatewayPayload<T = unknown> {
|
|
150
|
+
op: number;
|
|
151
|
+
d: T | null;
|
|
152
|
+
s: number | null;
|
|
153
|
+
t: string | null;
|
|
154
|
+
}
|
|
155
|
+
/** Generic Discord API error payload. */
|
|
156
|
+
export interface APIError {
|
|
157
|
+
code?: number;
|
|
158
|
+
message?: string;
|
|
159
|
+
errors?: Record<string, unknown>;
|
|
160
|
+
}
|
|
161
|
+
/** Discord message flags. */
|
|
162
|
+
export declare const MessageFlags: {
|
|
163
|
+
readonly Crossposted: 1;
|
|
164
|
+
readonly IsCrosspost: 2;
|
|
165
|
+
readonly SuppressEmbeds: 4;
|
|
166
|
+
readonly SourceMessageDeleted: 8;
|
|
167
|
+
readonly Urgent: 16;
|
|
168
|
+
readonly HasThread: 32;
|
|
169
|
+
readonly Ephemeral: 64;
|
|
170
|
+
readonly Loading: 128;
|
|
171
|
+
readonly IsComponentsV2: 32768;
|
|
172
|
+
};
|
|
173
|
+
/** Discord channel types. */
|
|
174
|
+
export declare const ChannelType: {
|
|
175
|
+
readonly GuildText: 0;
|
|
176
|
+
readonly DM: 1;
|
|
177
|
+
readonly GuildVoice: 2;
|
|
178
|
+
readonly GroupDM: 3;
|
|
179
|
+
readonly GuildCategory: 4;
|
|
180
|
+
readonly GuildAnnouncement: 5;
|
|
181
|
+
readonly AnnouncementThread: 10;
|
|
182
|
+
readonly PublicThread: 11;
|
|
183
|
+
readonly PrivateThread: 12;
|
|
184
|
+
readonly GuildStageVoice: 13;
|
|
185
|
+
readonly GuildDirectory: 14;
|
|
186
|
+
readonly GuildForum: 15;
|
|
187
|
+
readonly GuildMedia: 16;
|
|
188
|
+
};
|
|
189
|
+
/** Raw Discord embed object. */
|
|
190
|
+
export interface APIEmbed {
|
|
191
|
+
title?: string;
|
|
192
|
+
type?: string;
|
|
193
|
+
description?: string;
|
|
194
|
+
url?: string;
|
|
195
|
+
timestamp?: string;
|
|
196
|
+
color?: number;
|
|
197
|
+
footer?: Record<string, unknown>;
|
|
198
|
+
image?: Record<string, unknown>;
|
|
199
|
+
thumbnail?: Record<string, unknown>;
|
|
200
|
+
video?: Record<string, unknown>;
|
|
201
|
+
provider?: Record<string, unknown>;
|
|
202
|
+
author?: Record<string, unknown>;
|
|
203
|
+
fields?: Array<Record<string, unknown>>;
|
|
204
|
+
}
|
|
205
|
+
/** Raw Discord attachment object. */
|
|
206
|
+
export interface APIAttachment {
|
|
207
|
+
id: Snowflake;
|
|
208
|
+
filename: string;
|
|
209
|
+
description?: string | null;
|
|
210
|
+
content_type?: string;
|
|
211
|
+
size: number;
|
|
212
|
+
url: string;
|
|
213
|
+
proxy_url: string;
|
|
214
|
+
height?: number | null;
|
|
215
|
+
width?: number | null;
|
|
216
|
+
ephemeral?: boolean;
|
|
217
|
+
duration_secs?: number;
|
|
218
|
+
waveform?: string;
|
|
219
|
+
flags?: number;
|
|
220
|
+
}
|
|
221
|
+
/** Raw Discord message component object. */
|
|
222
|
+
export interface APIMessageComponent {
|
|
223
|
+
type: number;
|
|
224
|
+
id?: number;
|
|
225
|
+
custom_id?: string;
|
|
226
|
+
style?: number;
|
|
227
|
+
label?: string;
|
|
228
|
+
disabled?: boolean;
|
|
229
|
+
emoji?: Record<string, unknown>;
|
|
230
|
+
url?: string;
|
|
231
|
+
options?: Array<Record<string, unknown>>;
|
|
232
|
+
components?: APIMessageComponent[];
|
|
233
|
+
}
|
|
234
|
+
/** Raw Discord message reference. */
|
|
235
|
+
export interface APIMessageReference {
|
|
236
|
+
type?: number;
|
|
237
|
+
message_id?: Snowflake;
|
|
238
|
+
channel_id?: Snowflake;
|
|
239
|
+
guild_id?: Snowflake;
|
|
240
|
+
fail_if_not_exists?: boolean;
|
|
241
|
+
}
|
|
242
|
+
/** Raw Discord message reaction. */
|
|
243
|
+
export interface APIMessageReaction {
|
|
244
|
+
count: number;
|
|
245
|
+
count_details?: Record<string, number>;
|
|
246
|
+
me?: boolean;
|
|
247
|
+
me_burst?: boolean;
|
|
248
|
+
emoji: Record<string, unknown>;
|
|
249
|
+
burst_colors?: string[];
|
|
250
|
+
}
|
|
251
|
+
/** Raw Discord message object. */
|
|
252
|
+
export interface APIMessage {
|
|
253
|
+
id: Snowflake;
|
|
254
|
+
channel_id: Snowflake;
|
|
255
|
+
author: UserData;
|
|
256
|
+
content: string;
|
|
257
|
+
timestamp?: string;
|
|
258
|
+
edited_timestamp?: string | null;
|
|
259
|
+
tts?: boolean;
|
|
260
|
+
mention_everyone?: boolean;
|
|
261
|
+
mentions?: UserData[];
|
|
262
|
+
mention_roles?: Snowflake[];
|
|
263
|
+
mention_channels?: Array<Record<string, unknown>>;
|
|
264
|
+
attachments?: APIAttachment[];
|
|
265
|
+
embeds?: APIEmbed[];
|
|
266
|
+
reactions?: APIMessageReaction[];
|
|
267
|
+
nonce?: string | number | null;
|
|
268
|
+
pinned?: boolean;
|
|
269
|
+
webhook_id?: Snowflake;
|
|
270
|
+
type?: number;
|
|
271
|
+
activity?: Record<string, unknown>;
|
|
272
|
+
application?: Record<string, unknown>;
|
|
273
|
+
application_id?: Snowflake;
|
|
274
|
+
message_reference?: APIMessageReference;
|
|
275
|
+
flags?: number;
|
|
276
|
+
referenced_message?: APIMessage | null;
|
|
277
|
+
interaction_metadata?: Record<string, unknown>;
|
|
278
|
+
thread?: Record<string, unknown>;
|
|
279
|
+
components?: APIMessageComponent[];
|
|
280
|
+
position?: number;
|
|
281
|
+
role_subscription_data?: Record<string, unknown>;
|
|
282
|
+
purchase_notification?: Record<string, unknown>;
|
|
283
|
+
poll?: Record<string, unknown>;
|
|
284
|
+
guild_id?: Snowflake;
|
|
285
|
+
}
|
|
286
|
+
/** Raw Discord channel object. */
|
|
287
|
+
export interface APIChannel {
|
|
288
|
+
id: Snowflake;
|
|
289
|
+
type: number;
|
|
290
|
+
guild_id?: Snowflake;
|
|
291
|
+
position?: number;
|
|
292
|
+
permission_overwrites?: Array<Record<string, unknown>>;
|
|
293
|
+
name?: string | null;
|
|
294
|
+
topic?: string | null;
|
|
295
|
+
nsfw?: boolean;
|
|
296
|
+
last_message_id?: Snowflake | null;
|
|
297
|
+
bitrate?: number;
|
|
298
|
+
user_limit?: number;
|
|
299
|
+
rate_limit_per_user?: number;
|
|
300
|
+
recipients?: UserData[];
|
|
301
|
+
icon?: string | null;
|
|
302
|
+
owner_id?: Snowflake;
|
|
303
|
+
application_id?: Snowflake;
|
|
304
|
+
parent_id?: Snowflake | null;
|
|
305
|
+
last_pin_timestamp?: string | null;
|
|
306
|
+
rtc_region?: string | null;
|
|
307
|
+
video_quality_mode?: number;
|
|
308
|
+
message_count?: number;
|
|
309
|
+
member_count?: number;
|
|
310
|
+
thread_metadata?: Record<string, unknown>;
|
|
311
|
+
default_auto_archive_duration?: number;
|
|
312
|
+
flags?: number;
|
|
313
|
+
total_message_sent?: number;
|
|
314
|
+
available_tags?: Array<Record<string, unknown>>;
|
|
315
|
+
default_reaction_emoji?: Record<string, unknown> | null;
|
|
316
|
+
default_thread_rate_limit_per_user?: number;
|
|
317
|
+
default_sort_order?: number | null;
|
|
318
|
+
default_forum_layout?: number;
|
|
319
|
+
}
|
|
320
|
+
/** Raw Discord guild object. */
|
|
321
|
+
export interface APIGuild {
|
|
322
|
+
id: Snowflake;
|
|
323
|
+
name: string;
|
|
324
|
+
icon?: string | null;
|
|
325
|
+
icon_hash?: string | null;
|
|
326
|
+
splash?: string | null;
|
|
327
|
+
discovery_splash?: string | null;
|
|
328
|
+
owner_id?: Snowflake;
|
|
329
|
+
afk_channel_id?: Snowflake | null;
|
|
330
|
+
afk_timeout?: number;
|
|
331
|
+
widget_enabled?: boolean;
|
|
332
|
+
widget_channel_id?: Snowflake | null;
|
|
333
|
+
verification_level?: number;
|
|
334
|
+
default_message_notifications?: number;
|
|
335
|
+
explicit_content_filter?: number;
|
|
336
|
+
roles?: Array<Record<string, unknown>>;
|
|
337
|
+
emojis?: Array<Record<string, unknown>>;
|
|
338
|
+
features?: string[];
|
|
339
|
+
mfa_level?: number;
|
|
340
|
+
application_id?: Snowflake | null;
|
|
341
|
+
system_channel_id?: Snowflake | null;
|
|
342
|
+
system_channel_flags?: number;
|
|
343
|
+
rules_channel_id?: Snowflake | null;
|
|
344
|
+
max_presences?: number | null;
|
|
345
|
+
max_members?: number;
|
|
346
|
+
vanity_url_code?: string | null;
|
|
347
|
+
description?: string | null;
|
|
348
|
+
banner?: string | null;
|
|
349
|
+
premium_tier?: number;
|
|
350
|
+
preferred_locale?: string;
|
|
351
|
+
public_updates_channel_id?: Snowflake | null;
|
|
352
|
+
max_video_channel_users?: number;
|
|
353
|
+
approximate_member_count?: number;
|
|
354
|
+
approximate_presence_count?: number;
|
|
355
|
+
nsfw_level?: number;
|
|
356
|
+
safety_alerts_channel_id?: Snowflake | null;
|
|
357
|
+
}
|
|
358
|
+
/** Raw Discord guild member object. */
|
|
359
|
+
export interface APIGuildMember {
|
|
360
|
+
user: UserData;
|
|
361
|
+
nick?: string | null;
|
|
362
|
+
avatar?: string | null;
|
|
363
|
+
roles: Snowflake[];
|
|
364
|
+
joined_at: string;
|
|
365
|
+
premium_since?: string | null;
|
|
366
|
+
deaf?: boolean;
|
|
367
|
+
mute?: boolean;
|
|
368
|
+
flags?: number;
|
|
369
|
+
pending?: boolean;
|
|
370
|
+
permissions?: string;
|
|
371
|
+
communication_disabled_until?: string | null;
|
|
372
|
+
guild_id?: Snowflake;
|
|
373
|
+
}
|
|
374
|
+
/** Raw Discord reaction event payload. */
|
|
375
|
+
export interface APIMessageReactionEvent {
|
|
376
|
+
user_id: Snowflake;
|
|
377
|
+
channel_id: Snowflake;
|
|
378
|
+
message_id: Snowflake;
|
|
379
|
+
guild_id?: Snowflake;
|
|
380
|
+
member?: APIGuildMember;
|
|
381
|
+
emoji: Record<string, unknown>;
|
|
382
|
+
message_author_id?: Snowflake;
|
|
383
|
+
burst?: boolean;
|
|
384
|
+
type?: number;
|
|
385
|
+
}
|
|
386
|
+
/** Raw Discord message deletion event payload. */
|
|
387
|
+
export interface APIMessageDeleteEvent {
|
|
388
|
+
id: Snowflake;
|
|
389
|
+
channel_id: Snowflake;
|
|
390
|
+
guild_id?: Snowflake;
|
|
391
|
+
}
|
|
392
|
+
/** Raw Discord bulk message deletion event payload. */
|
|
393
|
+
export interface APIMessageDeleteBulkEvent {
|
|
394
|
+
ids: Snowflake[];
|
|
395
|
+
channel_id: Snowflake;
|
|
396
|
+
guild_id?: Snowflake;
|
|
397
|
+
}
|
|
398
|
+
/** Raw Discord channel deletion event payload. */
|
|
399
|
+
export interface APIChannelDeleteEvent extends APIChannel {
|
|
400
|
+
}
|
|
401
|
+
/** Raw Discord guild deletion event payload. */
|
|
402
|
+
export interface APIGuildDeleteEvent {
|
|
403
|
+
id: Snowflake;
|
|
404
|
+
unavailable?: boolean;
|
|
405
|
+
}
|
|
406
|
+
/** Raw Discord thread lifecycle payload. */
|
|
407
|
+
export interface APIThreadEvent extends APIChannel {
|
|
408
|
+
guild_id: Snowflake;
|
|
409
|
+
member?: Record<string, unknown>;
|
|
410
|
+
}
|
|
411
|
+
/** Raw Discord READY event payload. */
|
|
412
|
+
export interface APIReadyEvent {
|
|
413
|
+
v: number;
|
|
414
|
+
user: UserData;
|
|
415
|
+
guilds: Array<{
|
|
416
|
+
id: Snowflake;
|
|
417
|
+
unavailable?: boolean;
|
|
418
|
+
}>;
|
|
419
|
+
session_id: string;
|
|
420
|
+
resume_gateway_url: string;
|
|
421
|
+
shard?: [number, number];
|
|
422
|
+
application?: {
|
|
423
|
+
id: Snowflake;
|
|
424
|
+
flags: number;
|
|
425
|
+
[key: string]: unknown;
|
|
426
|
+
};
|
|
427
|
+
}
|
|
428
|
+
/** Discord application command option types. */
|
|
429
|
+
export declare const ApplicationCommandOptionType: {
|
|
430
|
+
readonly SubCommand: 1;
|
|
431
|
+
readonly SubCommandGroup: 2;
|
|
432
|
+
readonly String: 3;
|
|
433
|
+
readonly Integer: 4;
|
|
434
|
+
readonly Boolean: 5;
|
|
435
|
+
readonly User: 6;
|
|
436
|
+
readonly Channel: 7;
|
|
437
|
+
readonly Role: 8;
|
|
438
|
+
readonly Mentionable: 9;
|
|
439
|
+
readonly Number: 10;
|
|
440
|
+
readonly Attachment: 11;
|
|
441
|
+
};
|
|
442
|
+
/** Discord application command types. */
|
|
443
|
+
export declare const ApplicationCommandType: {
|
|
444
|
+
readonly ChatInput: 1;
|
|
445
|
+
readonly User: 2;
|
|
446
|
+
readonly Message: 3;
|
|
447
|
+
};
|
|
448
|
+
/** Raw Discord application command option. */
|
|
449
|
+
export interface APIApplicationCommandOption {
|
|
450
|
+
type: number;
|
|
451
|
+
name: string;
|
|
452
|
+
description: string;
|
|
453
|
+
required?: boolean;
|
|
454
|
+
choices?: Array<{
|
|
455
|
+
name: string;
|
|
456
|
+
value: string | number;
|
|
457
|
+
}>;
|
|
458
|
+
options?: APIApplicationCommandOption[];
|
|
459
|
+
min_value?: number;
|
|
460
|
+
max_value?: number;
|
|
461
|
+
min_length?: number;
|
|
462
|
+
max_length?: number;
|
|
463
|
+
autocomplete?: boolean;
|
|
464
|
+
channel_types?: number[];
|
|
465
|
+
}
|
|
466
|
+
/** Raw Discord application command object (from API). */
|
|
467
|
+
export interface APIApplicationCommand {
|
|
468
|
+
id: Snowflake;
|
|
469
|
+
type?: number;
|
|
470
|
+
application_id: Snowflake;
|
|
471
|
+
guild_id?: Snowflake;
|
|
472
|
+
name: string;
|
|
473
|
+
description: string;
|
|
474
|
+
options?: APIApplicationCommandOption[];
|
|
475
|
+
default_member_permissions?: string | null;
|
|
476
|
+
dm_permission?: boolean;
|
|
477
|
+
nsfw?: boolean;
|
|
478
|
+
version: Snowflake;
|
|
479
|
+
}
|
|
480
|
+
/** Data for creating/overwriting an application command. */
|
|
481
|
+
export interface ApplicationCommandData {
|
|
482
|
+
name: string;
|
|
483
|
+
description: string;
|
|
484
|
+
type?: number;
|
|
485
|
+
options?: APIApplicationCommandOption[];
|
|
486
|
+
default_member_permissions?: string | null;
|
|
487
|
+
dm_permission?: boolean;
|
|
488
|
+
nsfw?: boolean;
|
|
489
|
+
}
|
|
490
|
+
/** Raw Discord role object. */
|
|
491
|
+
export interface APIRole {
|
|
492
|
+
id: Snowflake;
|
|
493
|
+
name: string;
|
|
494
|
+
color: number;
|
|
495
|
+
hoist: boolean;
|
|
496
|
+
icon?: string | null;
|
|
497
|
+
unicode_emoji?: string | null;
|
|
498
|
+
position: number;
|
|
499
|
+
permissions: string;
|
|
500
|
+
managed: boolean;
|
|
501
|
+
mentionable: boolean;
|
|
502
|
+
tags?: Record<string, unknown>;
|
|
503
|
+
flags?: number;
|
|
504
|
+
}
|
|
505
|
+
/** Raw Discord guild role event payload. */
|
|
506
|
+
export interface APIGuildRoleEvent {
|
|
507
|
+
guild_id: Snowflake;
|
|
508
|
+
role: APIRole;
|
|
509
|
+
}
|
|
510
|
+
/** Raw Discord guild role delete event payload. */
|
|
511
|
+
export interface APIGuildRoleDeleteEvent {
|
|
512
|
+
guild_id: Snowflake;
|
|
513
|
+
role_id: Snowflake;
|
|
514
|
+
}
|
|
515
|
+
/** Raw Discord guild ban event payload. */
|
|
516
|
+
export interface APIGuildBanEvent {
|
|
517
|
+
guild_id: Snowflake;
|
|
518
|
+
user: UserData;
|
|
519
|
+
}
|
|
520
|
+
/** Raw Discord emoji object. */
|
|
521
|
+
export interface APIEmoji {
|
|
522
|
+
id: Snowflake | null;
|
|
523
|
+
name: string | null;
|
|
524
|
+
roles?: Snowflake[];
|
|
525
|
+
user?: UserData;
|
|
526
|
+
require_colons?: boolean;
|
|
527
|
+
managed?: boolean;
|
|
528
|
+
animated?: boolean;
|
|
529
|
+
available?: boolean;
|
|
530
|
+
}
|
|
531
|
+
/** Raw Discord guild emojis update event payload. */
|
|
532
|
+
export interface APIGuildEmojisUpdateEvent {
|
|
533
|
+
guild_id: Snowflake;
|
|
534
|
+
emojis: APIEmoji[];
|
|
535
|
+
}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// packages/types/src/index.ts
|
|
3
|
+
var GatewayIntentBits = {
|
|
4
|
+
Guilds: 1 << 0,
|
|
5
|
+
GuildMembers: 1 << 1,
|
|
6
|
+
GuildModeration: 1 << 2,
|
|
7
|
+
GuildExpressions: 1 << 3,
|
|
8
|
+
GuildIntegrations: 1 << 4,
|
|
9
|
+
GuildWebhooks: 1 << 5,
|
|
10
|
+
GuildInvites: 1 << 6,
|
|
11
|
+
GuildVoiceStates: 1 << 7,
|
|
12
|
+
GuildPresences: 1 << 8,
|
|
13
|
+
GuildMessages: 1 << 9,
|
|
14
|
+
GuildMessageReactions: 1 << 10,
|
|
15
|
+
GuildMessageTyping: 1 << 11,
|
|
16
|
+
DirectMessages: 1 << 12,
|
|
17
|
+
DirectMessageReactions: 1 << 13,
|
|
18
|
+
DirectMessageTyping: 1 << 14,
|
|
19
|
+
MessageContent: 1 << 15,
|
|
20
|
+
GuildScheduledEvents: 1 << 16,
|
|
21
|
+
AutoModerationConfiguration: 1 << 20,
|
|
22
|
+
AutoModerationExecution: 1 << 21,
|
|
23
|
+
GuildMessagePolls: 1 << 24,
|
|
24
|
+
DirectMessagePolls: 1 << 25
|
|
25
|
+
};
|
|
26
|
+
var IntentBits = {
|
|
27
|
+
guild: 1 << 0,
|
|
28
|
+
guilds: 1 << 0,
|
|
29
|
+
guildMembers: 1 << 1,
|
|
30
|
+
guildModeration: 1 << 2,
|
|
31
|
+
guildBans: 1 << 2,
|
|
32
|
+
guildExpressions: 1 << 3,
|
|
33
|
+
guildEmojis: 1 << 3,
|
|
34
|
+
guildEmojisAndStickers: 1 << 3,
|
|
35
|
+
guildIntegrations: 1 << 4,
|
|
36
|
+
guildWebhooks: 1 << 5,
|
|
37
|
+
guildInvites: 1 << 6,
|
|
38
|
+
guildVoiceStates: 1 << 7,
|
|
39
|
+
guildPresences: 1 << 8,
|
|
40
|
+
guildMessages: 1 << 9,
|
|
41
|
+
guildMessage: 1 << 9,
|
|
42
|
+
guildMessageReactions: 1 << 10,
|
|
43
|
+
guildMessageTyping: 1 << 11,
|
|
44
|
+
directMessages: 1 << 12,
|
|
45
|
+
directMessageReactions: 1 << 13,
|
|
46
|
+
directMessageTyping: 1 << 14,
|
|
47
|
+
messageContent: 1 << 15,
|
|
48
|
+
guildScheduledEvents: 1 << 16,
|
|
49
|
+
autoModerationConfiguration: 1 << 20,
|
|
50
|
+
autoModerationExecution: 1 << 21,
|
|
51
|
+
guildMessagePolls: 1 << 24,
|
|
52
|
+
directMessagePolls: 1 << 25
|
|
53
|
+
};
|
|
54
|
+
var Intents = IntentBits;
|
|
55
|
+
function resolveGatewayIntents(intents) {
|
|
56
|
+
if (typeof intents === "number")
|
|
57
|
+
return intents;
|
|
58
|
+
if (Array.isArray(intents)) {
|
|
59
|
+
return intents.reduce((acc, intent) => {
|
|
60
|
+
return acc | resolveGatewayIntents(intent);
|
|
61
|
+
}, 0);
|
|
62
|
+
}
|
|
63
|
+
if (typeof intents === "string") {
|
|
64
|
+
if (intents in GatewayIntentBits)
|
|
65
|
+
return GatewayIntentBits[intents];
|
|
66
|
+
if (intents in IntentBits)
|
|
67
|
+
return IntentBits[intents];
|
|
68
|
+
const lower = intents.charAt(0).toLowerCase() + intents.slice(1);
|
|
69
|
+
if (lower in IntentBits)
|
|
70
|
+
return IntentBits[lower];
|
|
71
|
+
const num = Number(intents);
|
|
72
|
+
if (!Number.isNaN(num))
|
|
73
|
+
return num;
|
|
74
|
+
}
|
|
75
|
+
return 0;
|
|
76
|
+
}
|
|
77
|
+
var MessageFlags = {
|
|
78
|
+
Crossposted: 1,
|
|
79
|
+
IsCrosspost: 2,
|
|
80
|
+
SuppressEmbeds: 4,
|
|
81
|
+
SourceMessageDeleted: 8,
|
|
82
|
+
Urgent: 16,
|
|
83
|
+
HasThread: 32,
|
|
84
|
+
Ephemeral: 64,
|
|
85
|
+
Loading: 128,
|
|
86
|
+
IsComponentsV2: 32768
|
|
87
|
+
};
|
|
88
|
+
var ChannelType = {
|
|
89
|
+
GuildText: 0,
|
|
90
|
+
DM: 1,
|
|
91
|
+
GuildVoice: 2,
|
|
92
|
+
GroupDM: 3,
|
|
93
|
+
GuildCategory: 4,
|
|
94
|
+
GuildAnnouncement: 5,
|
|
95
|
+
AnnouncementThread: 10,
|
|
96
|
+
PublicThread: 11,
|
|
97
|
+
PrivateThread: 12,
|
|
98
|
+
GuildStageVoice: 13,
|
|
99
|
+
GuildDirectory: 14,
|
|
100
|
+
GuildForum: 15,
|
|
101
|
+
GuildMedia: 16
|
|
102
|
+
};
|
|
103
|
+
var ApplicationCommandOptionType = {
|
|
104
|
+
SubCommand: 1,
|
|
105
|
+
SubCommandGroup: 2,
|
|
106
|
+
String: 3,
|
|
107
|
+
Integer: 4,
|
|
108
|
+
Boolean: 5,
|
|
109
|
+
User: 6,
|
|
110
|
+
Channel: 7,
|
|
111
|
+
Role: 8,
|
|
112
|
+
Mentionable: 9,
|
|
113
|
+
Number: 10,
|
|
114
|
+
Attachment: 11
|
|
115
|
+
};
|
|
116
|
+
var ApplicationCommandType = {
|
|
117
|
+
ChatInput: 1,
|
|
118
|
+
User: 2,
|
|
119
|
+
Message: 3
|
|
120
|
+
};
|
|
121
|
+
export {
|
|
122
|
+
ApplicationCommandOptionType,
|
|
123
|
+
ApplicationCommandType,
|
|
124
|
+
ChannelType,
|
|
125
|
+
GatewayIntentBits,
|
|
126
|
+
IntentBits,
|
|
127
|
+
Intents,
|
|
128
|
+
MessageFlags,
|
|
129
|
+
resolveGatewayIntents
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
//# debugId=FE618CA7F2A5EFE164756E2164756E21
|