@spatulox/simplediscordbot 1.0.31 → 1.0.32

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.
Files changed (44) hide show
  1. package/.npmignore_old +23 -0
  2. package/dist/index.d.mts +915 -0
  3. package/dist/index.d.ts +915 -17
  4. package/dist/index.js +2576 -36
  5. package/dist/index.mjs +2554 -0
  6. package/package.json +3 -2
  7. package/dist/SimpleDiscordBotInfo.js +0 -14
  8. package/dist/bot/Bot.js +0 -92
  9. package/dist/bot/BotEnv.js +0 -24
  10. package/dist/bot/BotInteraction.js +0 -74
  11. package/dist/bot/BotLog.js +0 -134
  12. package/dist/bot/BotMessage.js +0 -110
  13. package/dist/manager/FileManager.js +0 -136
  14. package/dist/manager/builder/SendableComponentBuilder.js +0 -63
  15. package/dist/manager/direct/BasicUserManager.js +0 -81
  16. package/dist/manager/direct/UserManager.js +0 -18
  17. package/dist/manager/guild/ChannelManager/ForumChannelManager.js +0 -33
  18. package/dist/manager/guild/ChannelManager/GuildChannelList.js +0 -20
  19. package/dist/manager/guild/ChannelManager/GuildChannelManager.js +0 -91
  20. package/dist/manager/guild/ChannelManager/GuildMessageManager.js +0 -93
  21. package/dist/manager/guild/ChannelManager/GuildTextChannelManager.js +0 -33
  22. package/dist/manager/guild/ChannelManager/GuildVoiceChannelManager.js +0 -33
  23. package/dist/manager/guild/ChannelManager/NewsChannelManager.js +0 -33
  24. package/dist/manager/guild/ChannelManager/StageChannelManager.js +0 -33
  25. package/dist/manager/guild/ChannelManager/ThreadChannelManager.js +0 -49
  26. package/dist/manager/guild/GuildManager.js +0 -144
  27. package/dist/manager/guild/GuildUserManager.js +0 -251
  28. package/dist/manager/guild/InviteManager.js +0 -68
  29. package/dist/manager/guild/InviteManager_old.js +0 -89
  30. package/dist/manager/guild/RoleManager.js +0 -83
  31. package/dist/manager/interactions/ModalManager.js +0 -113
  32. package/dist/manager/interactions/SelectMenuManager.js +0 -123
  33. package/dist/manager/messages/EmbedManager.js +0 -161
  34. package/dist/manager/messages/ReactionManager.js +0 -99
  35. package/dist/manager/messages/WebhookManager.js +0 -108
  36. package/dist/test/client.js +0 -15
  37. package/dist/test/index.js +0 -31
  38. package/dist/test/randomActivityList.js +0 -9
  39. package/dist/type/FolderName.js +0 -10
  40. package/dist/utils/DiscordRegex.js +0 -117
  41. package/dist/utils/Log.js +0 -28
  42. package/dist/utils/SimpleMutex.js +0 -39
  43. package/dist/utils/network/InternetChecker.js +0 -55
  44. package/dist/utils/times/UnitTime.js +0 -85
@@ -0,0 +1,915 @@
1
+ import { EmbedBuilder, Message, InteractionDeferReplyOptions, InteractionReplyOptions, InteractionEditReplyOptions, MessageCreateOptions, ActionRowBuilder, MessageActionRowComponentBuilder, TextChannel, DMChannel, ThreadChannel, User, GuildMember, BaseInteraction, InteractionResponse, Client, ActivityType, WebhookMessageCreateOptions, EmojiResolvable, Guild, BanOptions, Snowflake, GuildBasedChannel, GuildChannelCreateOptions, ForumChannel, NewsChannel, StageChannel, StartThreadOptions, VoiceChannel, Invite, Channel, Collection, GuildBan, ModalBuilder, StringSelectMenuBuilder, UserSelectMenuBuilder, RoleSelectMenuBuilder, MentionableSelectMenuBuilder, ChannelType, ChannelSelectMenuBuilder, StringSelectMenuOptionBuilder } from 'discord.js';
2
+
3
+ type ConfigLog = {
4
+ logChannelId: string;
5
+ errorChannelId: string;
6
+ info: {
7
+ console: boolean;
8
+ discord: boolean;
9
+ };
10
+ error: {
11
+ console: boolean;
12
+ discord: boolean;
13
+ };
14
+ warn: {
15
+ console: boolean;
16
+ discord: boolean;
17
+ };
18
+ debug: {
19
+ console: boolean;
20
+ discord: boolean;
21
+ };
22
+ };
23
+ declare class BotLog {
24
+ private static logChannel;
25
+ private static errorChannel;
26
+ constructor();
27
+ static config(): ConfigLog | undefined;
28
+ /**
29
+ * Initialize Discord logging channels and update Bot.log references
30
+ */
31
+ static initDiscordLogging(): Promise<void>;
32
+ /**
33
+ * Send content to specific Discord channel
34
+ */
35
+ private static _sendToChannel;
36
+ /**
37
+ * Send INFO log - TEXT or EMBED ! Respecte config.log.info
38
+ */
39
+ static info(content: string | EmbedBuilder): Promise<Message | void>;
40
+ /**
41
+ * Send ERROR log - TEXT or EMBED ! Respecte config.log.error
42
+ */
43
+ static error(content: string | EmbedBuilder): Promise<Message | void>;
44
+ /**
45
+ * Send WARNING log - TEXT or EMBED ! Respecte config.log.warn
46
+ */
47
+ static warn(content: string | EmbedBuilder): Promise<Message | void>;
48
+ /**
49
+ * Send DEBUG log - TEXT or EMBED ! Respecte config.log.debug
50
+ */
51
+ static debug(content: string | EmbedBuilder): Promise<Message | void>;
52
+ }
53
+
54
+ declare enum EmbedColor {
55
+ error = 8912917,
56
+ success = 65280,
57
+ black = 0,
58
+ white = 16777215,
59
+ red = 16711680,
60
+ green = 65280,
61
+ blue = 255,
62
+ yellow = 16776960,
63
+ cyan = 65535,
64
+ magenta = 16711935,
65
+ gray = 8421504,
66
+ lightgray = 13882323,
67
+ darkgray = 11119017,
68
+ orange = 16753920,
69
+ purple = 8388736,
70
+ pink = 16761035,
71
+ brown = 10824234,
72
+ lime = 65280,
73
+ navy = 128,
74
+ teal = 32896,
75
+ olive = 8421376,
76
+ gold = 16766720,
77
+ silver = 12632256,
78
+ coral = 16744272,
79
+ salmon = 16416882,
80
+ khaki = 15787660,
81
+ plum = 14524637,
82
+ lavender = 15132410,
83
+ beige = 16119260,
84
+ mint = 10026904,
85
+ peach = 16767673,
86
+ chocolate = 13789470,
87
+ crimson = 14423100,
88
+ youtube = 16718362,
89
+ default = 6064856,
90
+ minecraft = 25600
91
+ }
92
+ declare class EmbedManager {
93
+ private static get BOT_ICON();
94
+ private static get DEFAULT_COLOR();
95
+ /**
96
+ * Creates base embed - SAME SIMPLE API !
97
+ */
98
+ static create(color?: EmbedColor | null): EmbedBuilder;
99
+ /**
100
+ * Creates simple embed with just description
101
+ */
102
+ static simple(description: string, color?: EmbedColor | null): EmbedBuilder;
103
+ /**
104
+ * Creates error embed
105
+ */
106
+ static error(description: string): EmbedBuilder;
107
+ /**
108
+ * Creates success embed
109
+ */
110
+ static success(description: string): EmbedBuilder;
111
+ /**
112
+ * Creates success embed
113
+ */
114
+ static description(description: string): EmbedBuilder;
115
+ /**
116
+ * Creates debug embed
117
+ */
118
+ static debug(description: string): EmbedBuilder;
119
+ /**
120
+ * Defer ephemeral reply
121
+ */
122
+ static deferEphemeral(): InteractionDeferReplyOptions;
123
+ /**
124
+ * Quick field adder
125
+ */
126
+ static field(embed: EmbedBuilder, name: string, value: string, inline?: boolean): EmbedBuilder;
127
+ static fields(embed: EmbedBuilder, fields: {
128
+ name: string;
129
+ value: string;
130
+ inline?: boolean;
131
+ }[]): EmbedBuilder;
132
+ /**
133
+ * Fluent API shortcuts
134
+ */
135
+ static title(embed: EmbedBuilder, title: string): EmbedBuilder;
136
+ static desc(embed: EmbedBuilder, description: string): EmbedBuilder;
137
+ static thumb(embed: EmbedBuilder, url: string): EmbedBuilder;
138
+ static image(embed: EmbedBuilder, url: string): EmbedBuilder;
139
+ static footer(embed: EmbedBuilder, text: string): EmbedBuilder;
140
+ /**
141
+ * Transform embed into objet for interaction.reply()
142
+ */
143
+ static toInteraction(embed: EmbedBuilder, ephemeral?: boolean): InteractionReplyOptions | InteractionEditReplyOptions;
144
+ /**
145
+ * Transform embed into objet to send a message
146
+ */
147
+ static toMessage(embed: EmbedBuilder): MessageCreateOptions;
148
+ }
149
+
150
+ type SendableComponent = EmbedBuilder | ActionRowBuilder<MessageActionRowComponentBuilder>;
151
+
152
+ declare class BotMessage {
153
+ /**
154
+ * Send message to any text-based channel
155
+ */
156
+ static send(channel: TextChannel | DMChannel | ThreadChannel | string, content?: string | null, component?: SendableComponent): Promise<Message | null>;
157
+ static send(channel: TextChannel | DMChannel | ThreadChannel | string, content: SendableComponent): Promise<Message | null>;
158
+ static send(channel: TextChannel | DMChannel | ThreadChannel | string, content: MessageCreateOptions): Promise<Message | null>;
159
+ static sendDM(user: User | GuildMember | string, content?: string, component?: SendableComponent): Promise<Message | null>;
160
+ /**
161
+ * Quick success message
162
+ */
163
+ static success(channel: TextChannel | DMChannel | ThreadChannel | User | GuildMember, message: string): Promise<Message | null>;
164
+ /**
165
+ * Quick error message
166
+ */
167
+ static error(channel: TextChannel | DMChannel | ThreadChannel | User | GuildMember, message: string): Promise<Message | null>;
168
+ }
169
+
170
+ declare class BotInteraction {
171
+ /**
172
+ * InteractionReplyOptions && InteractionUpdateOptions
173
+ * The two have "content", "embeds" & "flags" field, so an internal cast is ok, unless discord/discordjs deprecate it
174
+ */
175
+ private static buildReplyOptions;
176
+ private static buildUpdateOptions;
177
+ private static _buildOptions;
178
+ static send(interaction: BaseInteraction, content: SendableComponent, ephemeral?: boolean): Promise<InteractionResponse<boolean> | Message<boolean> | boolean>;
179
+ static send(interaction: BaseInteraction, content: string, component: SendableComponent, ephemeral?: boolean): Promise<InteractionResponse<boolean> | Message<boolean> | boolean>;
180
+ static reply(interaction: BaseInteraction, content: SendableComponent, ephemeral?: boolean): Promise<InteractionResponse<boolean> | Message<boolean> | boolean>;
181
+ static reply(interaction: BaseInteraction, content: string, component: SendableComponent, ephemeral?: boolean): Promise<InteractionResponse<boolean> | Message<boolean> | boolean>;
182
+ static followUp(interaction: BaseInteraction, content: SendableComponent, ephemeral?: boolean): Promise<InteractionResponse<boolean> | Message<boolean> | boolean>;
183
+ static followUp(interaction: BaseInteraction, content: string, component: SendableComponent, ephemeral?: boolean): Promise<InteractionResponse<boolean> | Message<boolean> | boolean>;
184
+ static defer(interaction: BaseInteraction): Promise<void>;
185
+ static update(interaction: BaseInteraction, content: SendableComponent): Promise<InteractionResponse<boolean> | Message<boolean> | boolean>;
186
+ static update(interaction: BaseInteraction, content: string, component: SendableComponent): Promise<InteractionResponse<boolean> | Message<boolean> | boolean>;
187
+ }
188
+
189
+ type BotConfig = {
190
+ botIconUrl?: string;
191
+ defaultEmbedColor?: number | EmbedColor;
192
+ botName?: string;
193
+ log?: ConfigLog;
194
+ };
195
+ type InternalBotConfig = {
196
+ clientId: string;
197
+ } & BotConfig;
198
+ type RandomBotActivity = {
199
+ type: ActivityType;
200
+ message: string;
201
+ }[];
202
+ declare class Bot {
203
+ static readonly log: typeof BotLog;
204
+ static readonly message: typeof BotMessage;
205
+ static readonly interaction: typeof BotInteraction;
206
+ static _client: Client;
207
+ private static criticConfig;
208
+ private static _config;
209
+ get config(): InternalBotConfig;
210
+ get client(): Client;
211
+ static get client(): Client;
212
+ static get config(): InternalBotConfig;
213
+ constructor(client: Client, config: BotConfig);
214
+ login(maxTries?: number): Promise<boolean>;
215
+ static setActivity(message: string, type: ActivityType): void;
216
+ static setRandomActivity(randomActivity: RandomBotActivity, intervalMs?: number | null): void;
217
+ }
218
+
219
+ declare const BotEnv: {
220
+ readonly token: string;
221
+ readonly dev: boolean;
222
+ readonly clientId: string;
223
+ };
224
+
225
+ declare class FileManager {
226
+ /**
227
+ * Reads a JSON file synchronously.
228
+ * @param filePath Full path to the JSON file
229
+ * @returns Parsed JSON object or 'Error' string on failure
230
+ */
231
+ static readJsonFile(filePath: string): Promise<any | false>;
232
+ /**
233
+ * Lists all directories in a given path.
234
+ * @param directoryPath Path to scan for directories
235
+ * @returns Array of directory names or false on error
236
+ */
237
+ static listDirectories(directoryPath: string): Promise<string[] | false>;
238
+ /**
239
+ * Lists all JSON files in a directory.
240
+ * @param directoryPath Path to scan for JSON files
241
+ * @returns Array of JSON filenames or false on error
242
+ */
243
+ static listJsonFiles(directoryPath: string): Promise<string[] | false>;
244
+ /**
245
+ * Lists files with specific extension in a directory.
246
+ * @param directoryPath Path to scan
247
+ * @param extension File extension (with or without dot)
248
+ * @returns Array of matching filenames or 'Error' string on failure
249
+ */
250
+ static listFiles(directoryPath: string, extension: string): Promise<string[] | false>;
251
+ /**
252
+ * Creates directory structure and writes JSON data to file.
253
+ * @param directoryPath Full directory path (creates if missing)
254
+ * @param filename Filename without extension
255
+ * @param data Data to write (JSON serializable)
256
+ * @param sendErrorToErrorChannel Send error to the error channel
257
+ * @returns true on success, false on failure
258
+ */
259
+ static writeJsonFile(directoryPath: string, filename: string, data: any, sendErrorToErrorChannel?: boolean): Promise<boolean>;
260
+ }
261
+
262
+ declare class WebhookManager {
263
+ private readonly channel;
264
+ private readonly name;
265
+ private readonly avatarURL?;
266
+ private webhook;
267
+ constructor(channel: TextChannel | ThreadChannel, name?: string, avatarURL?: string | undefined);
268
+ private get textChannel();
269
+ /**
270
+ * Get or create webhook (lazy initialization)
271
+ */
272
+ private getWebhook;
273
+ /**
274
+ * Send message/text/component !
275
+ */
276
+ send(content: string): Promise<Message | null>;
277
+ send(content: SendableComponent): Promise<Message | null>;
278
+ send(content: WebhookMessageCreateOptions): Promise<Message | null>;
279
+ /**
280
+ * Quick success embed
281
+ */
282
+ success(message: string): Promise<Message | null>;
283
+ /**
284
+ * Quick error embed
285
+ */
286
+ error(message: string): Promise<Message | null>;
287
+ /**
288
+ * Delete webhook
289
+ */
290
+ delete(reason?: string): Promise<void>;
291
+ }
292
+
293
+ declare class ReactionManager {
294
+ /**
295
+ * Add a reaction to a message
296
+ */
297
+ static add(channelId: string, messageId: string, emoji: string | EmojiResolvable): Promise<void>;
298
+ /**
299
+ * Delete a reaction from a user
300
+ */
301
+ static remove(channelId: string, messageId: string, emoji: string, userId: string): Promise<void>;
302
+ /**
303
+ * Get all reaction of a message
304
+ */
305
+ static getAll(channelId: string, messageId: string): Promise<Reaction[]>;
306
+ /**
307
+ * Delete all reaction
308
+ */
309
+ static clear(channelId: string, messageId: string): Promise<void>;
310
+ }
311
+ interface Reaction {
312
+ emoji: any;
313
+ count: number;
314
+ users: User[];
315
+ }
316
+
317
+ declare abstract class BasicUserManager {
318
+ /**
319
+ * Find member in specific guild
320
+ */
321
+ static findInGuild(guildId: string, memberId: string): Promise<GuildMember | null>;
322
+ /**
323
+ * Check if user is still in guild
324
+ */
325
+ static isInGuild(guildId: string, userId: string): Promise<boolean>;
326
+ /**
327
+ * Overload for send
328
+ */
329
+ static send(user_id: string, content: string): Promise<Message>;
330
+ static send(user: User, content: string): Promise<Message>;
331
+ static send(user: GuildMember, content: string): Promise<Message>;
332
+ static send(user_id: string, component: SendableComponent | SendableComponent[]): Promise<Message>;
333
+ static send(user: User, component: SendableComponent | SendableComponent[]): Promise<Message>;
334
+ static send(user: GuildMember, component: SendableComponent | SendableComponent[]): Promise<Message>;
335
+ static send(user_id: string, content: string, component: SendableComponent | SendableComponent[]): Promise<Message>;
336
+ static send(user: User, content: string, component: SendableComponent | SendableComponent[]): Promise<Message>;
337
+ static send(user: GuildMember, content: string, component: SendableComponent | SendableComponent[]): Promise<Message>;
338
+ static send(user_id_or_user: string, options: MessageCreateOptions): Promise<Message>;
339
+ static send(user_id_or_user: User, options: MessageCreateOptions): Promise<Message>;
340
+ static send(user_id_or_user: GuildMember, options: MessageCreateOptions): Promise<Message>;
341
+ }
342
+
343
+ declare class GuildUserManager extends BasicUserManager {
344
+ static find(userId: string, guild: Guild | string): Promise<GuildMember | null>;
345
+ static rename(member: GuildMember, nickname: string, maxAttempts?: number): Promise<boolean>;
346
+ /**
347
+ * Check if user is banned from guild
348
+ */
349
+ static isBanned(guildId: string, userId: string): Promise<boolean>;
350
+ /**
351
+ * Deconnect a member from a voice
352
+ */
353
+ static deconnectFromVoice(guildId: string, memberId: string): Promise<void>;
354
+ /**
355
+ * Check if a member is in voice
356
+ */
357
+ static isInVoice(memberId: string, guildId: string): Promise<boolean>;
358
+ /**
359
+ * Mute a member
360
+ */
361
+ static mute(guildId: string, memberId: string, reason?: string): Promise<void>;
362
+ /**
363
+ * Unmute a member
364
+ */
365
+ static unmute(guildId: string, memberId: string, reason?: string): Promise<void>;
366
+ /**
367
+ * Deafen a member
368
+ */
369
+ static deafen(guildId: string, memberId: string, reason?: string): Promise<void>;
370
+ /**
371
+ * Undeafen member voice
372
+ */
373
+ static undeafen(guildId: string, memberId: string, reason?: string): Promise<void>;
374
+ /**
375
+ * Timeout a member
376
+ */
377
+ static timeout(guildId: string, memberId: string, duration: number, reason?: string): Promise<void>;
378
+ /**
379
+ * Remove the timeout of a member
380
+ */
381
+ static untimeout(guildId: string, memberId: string, reason?: string): Promise<void>;
382
+ /**
383
+ * Kick a member
384
+ */
385
+ static kick(guildId: string, memberId: string, reason?: string): Promise<void>;
386
+ static ban(guildId: string, userId: string, banOption?: BanOptions): Promise<void>;
387
+ static unban(guildId: string, userId: string, reason?: string): Promise<void>;
388
+ }
389
+
390
+ declare class RoleManager {
391
+ /**
392
+ * Add role - CACHE ONLY
393
+ * @param member - GuildMember ALREADY FETCHED
394
+ * @param roleId - Role ID (string)
395
+ */
396
+ static add(member: GuildMember, roleId: Snowflake): Promise<boolean>;
397
+ /**
398
+ * Remove role - CACHE ONLY
399
+ * @param member - GuildMember ALREADY FETCHED
400
+ * @param roleIdOrName - Role ID or name
401
+ */
402
+ static remove(member: GuildMember, roleIdOrName: Snowflake | string): Promise<boolean>;
403
+ /**
404
+ * Toggle role (add/remove)
405
+ */
406
+ static toggle(member: GuildMember, roleIdOrName: Snowflake | string): Promise<'added' | 'removed'>;
407
+ /**
408
+ * Check if member has role
409
+ */
410
+ static hasRole(member: GuildMember, roleIdOrName: Snowflake | string): boolean;
411
+ }
412
+
413
+ declare class GuildMessageManager {
414
+ /**
415
+ * Overloads for send
416
+ */
417
+ static send(channelId: string, content: string): Promise<Message>;
418
+ static send(channelId: string, component: SendableComponent | SendableComponent[]): Promise<Message>;
419
+ static send(channelId: string, options: MessageCreateOptions): Promise<Message>;
420
+ /**
421
+ * Delete message
422
+ */
423
+ static delete(channelId: string, messageId: string): Promise<boolean>;
424
+ /**
425
+ * Fetch messages (last X messages, default 10)
426
+ */
427
+ static fetch(channelId: string, limit?: number): Promise<Message[]>;
428
+ /**
429
+ * Fetch single message
430
+ */
431
+ static fetchOne(channelId: string, messageId: string): Promise<Message | null>;
432
+ }
433
+
434
+ declare class GuildChannelManager {
435
+ static readonly message: typeof GuildMessageManager;
436
+ /**
437
+ * Recherche un channel par ID dans une guild spécifique
438
+ */
439
+ static findInGuild(guildId: string, channelId: string): Promise<GuildBasedChannel | null>;
440
+ static find(channelId: string): Promise<GuildBasedChannel | null>;
441
+ static findAll(guildId: string): GuildBasedChannel[];
442
+ /**
443
+ * Recherche channels par nom (insensible à la casse)
444
+ */
445
+ static findByName(guildId: string, name: string): GuildBasedChannel[];
446
+ protected static _create(guildId: string, options: GuildChannelCreateOptions): Promise<GuildBasedChannel>;
447
+ static delete(channelId: string): Promise<boolean>;
448
+ }
449
+
450
+ declare class ForumChannelManager extends GuildChannelManager {
451
+ static findInGuild(guildId: string, channelId: string): Promise<ForumChannel | null>;
452
+ static find(channelId: string): Promise<ForumChannel | null>;
453
+ static findAll(guildId: string): ForumChannel[];
454
+ static create(guildId: string, name: string, options?: Omit<GuildChannelCreateOptions, 'type'>): Promise<ForumChannel>;
455
+ }
456
+
457
+ declare class NewsChannelManager extends GuildChannelManager {
458
+ static findInGuild(guildId: string, channelId: string): Promise<NewsChannel | null>;
459
+ static find(channelId: string): Promise<NewsChannel | null>;
460
+ static findAll(guildId: string): NewsChannel[];
461
+ static create(guildId: string, name: string, options?: Omit<GuildChannelCreateOptions, 'type'>): Promise<NewsChannel>;
462
+ }
463
+
464
+ declare class StageChannelManager extends GuildChannelManager {
465
+ static findInGuild(guildId: string, channelId: string): Promise<StageChannel | null>;
466
+ static find(channelId: string): Promise<StageChannel | null>;
467
+ static findAll(guildId: string): StageChannel[];
468
+ static create(guildId: string, name: string, options?: Omit<GuildChannelCreateOptions, 'type'>): Promise<StageChannel>;
469
+ }
470
+
471
+ declare class GuildTextChannelManager extends GuildChannelManager {
472
+ static findInGuild(guildId: string, channelId: string): Promise<TextChannel | null>;
473
+ static find(channelId: string): Promise<TextChannel | null>;
474
+ static findAll(guildId: string): TextChannel[];
475
+ static create(guildId: string, name: string, options?: Omit<GuildChannelCreateOptions, 'type'>): Promise<TextChannel>;
476
+ }
477
+
478
+ declare class ThreadChannelManager {
479
+ static findInGuild(guildId: string, channelId: string): Promise<ThreadChannel | null>;
480
+ static find(channelId: string): Promise<ThreadChannel | null>;
481
+ static findAll(guildId: string): ThreadChannel[];
482
+ static createFromChannel(parentId: string, options: StartThreadOptions): Promise<ThreadChannel>;
483
+ static createFromMessage(message: Message, options: StartThreadOptions): Promise<ThreadChannel>;
484
+ static send(channelId: string, content: string): Promise<Message>;
485
+ static send(channelId: string, component: SendableComponent | SendableComponent[]): Promise<Message>;
486
+ static send(channelId: string, options: MessageCreateOptions): Promise<Message>;
487
+ }
488
+
489
+ declare class GuildVoiceChannelManager extends GuildChannelManager {
490
+ static findInGuild(guildId: string, channelId: string): Promise<VoiceChannel | null>;
491
+ static find(channelId: string): Promise<VoiceChannel | null>;
492
+ static findAll(guildId: string): VoiceChannel[];
493
+ static create(guildId: string, name: string, options?: Omit<GuildChannelCreateOptions, 'type'>): Promise<VoiceChannel>;
494
+ }
495
+
496
+ declare class GuildChannelList {
497
+ static readonly forum: typeof ForumChannelManager;
498
+ static readonly any: typeof GuildChannelManager;
499
+ static readonly news: typeof NewsChannelManager;
500
+ static readonly stage: typeof StageChannelManager;
501
+ static readonly text: typeof GuildTextChannelManager;
502
+ static readonly thread: typeof ThreadChannelManager;
503
+ static readonly voice: typeof GuildVoiceChannelManager;
504
+ }
505
+
506
+ declare class InviteManager {
507
+ /**
508
+ * Create an invite for a channel
509
+ */
510
+ static create(channelId: string, options?: {
511
+ maxAge?: number;
512
+ maxUses?: number;
513
+ reason?: string;
514
+ temporary?: boolean;
515
+ }): Promise<Invite>;
516
+ /**
517
+ * Delete an invitation
518
+ */
519
+ static delete(invite: Invite): Promise<boolean>;
520
+ /**
521
+ * List every invitation from a guild
522
+ */
523
+ static list(guildId: string): Promise<Invite[]>;
524
+ }
525
+
526
+ declare class GuildManager {
527
+ static readonly role: typeof RoleManager;
528
+ static readonly user: typeof GuildUserManager;
529
+ static readonly channel: typeof GuildChannelList;
530
+ static readonly invite: typeof InviteManager;
531
+ static list(): Guild[];
532
+ static find(guild_id: string): Promise<Guild>;
533
+ /**
534
+ * Search channel by ID (TextChannel, DMChannel, ThreadChannel)
535
+ */
536
+ static searchChannel(guildId: string, channelId: string): Promise<Channel | null>;
537
+ /**
538
+ * Search guild member by ID
539
+ */
540
+ static searchMember(memberId: string, guildId: string): Promise<GuildMember | null>;
541
+ /**
542
+ * Check if member is still in guild
543
+ */
544
+ static isMemberInGuild(memberId: string, guildId: string): Promise<boolean>;
545
+ /**
546
+ * Fetch all members with retry (heavy operation)
547
+ */
548
+ static fetchAllMembers(guildId: string | Guild, MAX_ATTEMPTS?: number, RETRY_DELAY?: number): Promise<Collection<string, GuildMember>>;
549
+ static listban(guildId: string, limit?: number): Promise<GuildBan[]>;
550
+ static moveMember(memberId: string, fromChannelId: string, toChannelId: string): Promise<boolean>;
551
+ }
552
+
553
+ declare class UserManager extends BasicUserManager {
554
+ static find(userId: string): Promise<User | null>;
555
+ }
556
+
557
+ declare class ModalManager {
558
+ /**
559
+ * Load modal from JSON file and return ModalBuilder
560
+ */
561
+ static load(filename: string): Promise<ModalBuilder | false>;
562
+ /**
563
+ * List all modal files
564
+ */
565
+ static list(): Promise<string[] | false>;
566
+ private static jsonToBuilder;
567
+ private static fieldJsonToInput;
568
+ static parseNumber(value: string): number | null;
569
+ static parsePhone(value: string): string | null;
570
+ static parseDate(value: string): Date | null;
571
+ }
572
+
573
+ type SelectMenuCreateOption = {
574
+ label: string;
575
+ description?: string;
576
+ emoji?: string;
577
+ value: string;
578
+ };
579
+ declare class SelectMenuManager {
580
+ /**
581
+ * Creates base StringSelectMenu - SIMPLE API !
582
+ */
583
+ static create(customId: string, placeholder?: string): StringSelectMenuBuilder;
584
+ /**
585
+ * Quick StringSelectMenu
586
+ */
587
+ static simple(customId: string, options: SelectMenuCreateOption[], placeholder?: string): StringSelectMenuBuilder;
588
+ /**
589
+ * Pagination menu
590
+ */
591
+ static paginated(customId: string, options: SelectMenuCreateOption[], pageSize?: number): ActionRowBuilder<MessageActionRowComponentBuilder>;
592
+ /**
593
+ * User Select Menu (Components V2)
594
+ */
595
+ static users(customId: string, placeholder?: string): UserSelectMenuBuilder;
596
+ /**
597
+ * Role Select Menu (Components V2)
598
+ */
599
+ static roles(customId: string, placeholder?: string): RoleSelectMenuBuilder;
600
+ /**
601
+ * Mentionable Select Menu (Components V2)
602
+ */
603
+ static mentionables(customId: string, placeholder?: string): MentionableSelectMenuBuilder;
604
+ /**
605
+ * Channel Select Menu (Components V2)
606
+ */
607
+ static channels(customId: string, placeholder?: string, channelTypes?: ChannelType[]): ChannelSelectMenuBuilder;
608
+ /**
609
+ * Quick option creator
610
+ */
611
+ static option(option: SelectMenuCreateOption): StringSelectMenuOptionBuilder;
612
+ static option(options: SelectMenuCreateOption[]): StringSelectMenuOptionBuilder[];
613
+ private static _createOption;
614
+ /**
615
+ * Fluent API pour personnaliser
616
+ */
617
+ static placeholder(menu: StringSelectMenuBuilder, placeholder: string): StringSelectMenuBuilder;
618
+ static minMax(menu: StringSelectMenuBuilder, min: number, max: number): StringSelectMenuBuilder;
619
+ static disabled(menu: StringSelectMenuBuilder, disabled: boolean): StringSelectMenuBuilder;
620
+ /**
621
+ * ActionRow
622
+ */
623
+ static row<T extends MessageActionRowComponentBuilder>(component: T): ActionRowBuilder<MessageActionRowComponentBuilder>;
624
+ /**
625
+ * Rows multiples (5 max)
626
+ */
627
+ static rows(...components: MessageActionRowComponentBuilder[]): ActionRowBuilder<MessageActionRowComponentBuilder>[];
628
+ }
629
+
630
+ declare class UnitTime {
631
+ private readonly val;
632
+ constructor(val: number);
633
+ toMilliseconds(): number;
634
+ toSeconds(): number;
635
+ toMinutes(): number;
636
+ toHours(): number;
637
+ toDays(): number;
638
+ toString(): string;
639
+ valueOf(): number;
640
+ value(): number;
641
+ }
642
+ declare const Time: {
643
+ milisecond: {
644
+ MS_100: UnitTime;
645
+ MS_200: UnitTime;
646
+ MS_500: UnitTime;
647
+ MS_800: UnitTime;
648
+ MS_1000: UnitTime;
649
+ };
650
+ second: {
651
+ SEC_01: UnitTime;
652
+ SEC_02: UnitTime;
653
+ SEC_03: UnitTime;
654
+ SEC_04: UnitTime;
655
+ SEC_05: UnitTime;
656
+ SEC_06: UnitTime;
657
+ SEC_07: UnitTime;
658
+ SEC_08: UnitTime;
659
+ SEC_09: UnitTime;
660
+ SEC_10: UnitTime;
661
+ SEC_11: UnitTime;
662
+ SEC_12: UnitTime;
663
+ SEC_13: UnitTime;
664
+ SEC_14: UnitTime;
665
+ SEC_15: UnitTime;
666
+ SEC_16: UnitTime;
667
+ SEC_17: UnitTime;
668
+ SEC_18: UnitTime;
669
+ SEC_19: UnitTime;
670
+ SEC_20: UnitTime;
671
+ SEC_21: UnitTime;
672
+ SEC_22: UnitTime;
673
+ SEC_23: UnitTime;
674
+ SEC_24: UnitTime;
675
+ SEC_25: UnitTime;
676
+ SEC_26: UnitTime;
677
+ SEC_27: UnitTime;
678
+ SEC_28: UnitTime;
679
+ SEC_29: UnitTime;
680
+ SEC_30: UnitTime;
681
+ SEC_31: UnitTime;
682
+ SEC_32: UnitTime;
683
+ SEC_33: UnitTime;
684
+ SEC_34: UnitTime;
685
+ SEC_35: UnitTime;
686
+ SEC_36: UnitTime;
687
+ SEC_37: UnitTime;
688
+ SEC_38: UnitTime;
689
+ SEC_39: UnitTime;
690
+ SEC_40: UnitTime;
691
+ SEC_41: UnitTime;
692
+ SEC_42: UnitTime;
693
+ SEC_43: UnitTime;
694
+ SEC_44: UnitTime;
695
+ SEC_45: UnitTime;
696
+ SEC_46: UnitTime;
697
+ SEC_47: UnitTime;
698
+ SEC_48: UnitTime;
699
+ SEC_49: UnitTime;
700
+ SEC_50: UnitTime;
701
+ SEC_51: UnitTime;
702
+ SEC_52: UnitTime;
703
+ SEC_53: UnitTime;
704
+ SEC_54: UnitTime;
705
+ SEC_55: UnitTime;
706
+ SEC_56: UnitTime;
707
+ SEC_57: UnitTime;
708
+ SEC_58: UnitTime;
709
+ SEC_59: UnitTime;
710
+ SEC_60: UnitTime;
711
+ };
712
+ minute: {
713
+ MIN_01: UnitTime;
714
+ MIN_02: UnitTime;
715
+ MIN_03: UnitTime;
716
+ MIN_04: UnitTime;
717
+ MIN_05: UnitTime;
718
+ MIN_06: UnitTime;
719
+ MIN_07: UnitTime;
720
+ MIN_08: UnitTime;
721
+ MIN_09: UnitTime;
722
+ MIN_10: UnitTime;
723
+ MIN_11: UnitTime;
724
+ MIN_12: UnitTime;
725
+ MIN_13: UnitTime;
726
+ MIN_14: UnitTime;
727
+ MIN_15: UnitTime;
728
+ MIN_16: UnitTime;
729
+ MIN_17: UnitTime;
730
+ MIN_18: UnitTime;
731
+ MIN_19: UnitTime;
732
+ MIN_20: UnitTime;
733
+ MIN_21: UnitTime;
734
+ MIN_22: UnitTime;
735
+ MIN_23: UnitTime;
736
+ MIN_24: UnitTime;
737
+ MIN_25: UnitTime;
738
+ MIN_26: UnitTime;
739
+ MIN_27: UnitTime;
740
+ MIN_28: UnitTime;
741
+ MIN_29: UnitTime;
742
+ MIN_30: UnitTime;
743
+ MIN_31: UnitTime;
744
+ MIN_32: UnitTime;
745
+ MIN_33: UnitTime;
746
+ MIN_34: UnitTime;
747
+ MIN_35: UnitTime;
748
+ MIN_36: UnitTime;
749
+ MIN_37: UnitTime;
750
+ MIN_38: UnitTime;
751
+ MIN_39: UnitTime;
752
+ MIN_40: UnitTime;
753
+ MIN_41: UnitTime;
754
+ MIN_42: UnitTime;
755
+ MIN_43: UnitTime;
756
+ MIN_44: UnitTime;
757
+ MIN_45: UnitTime;
758
+ MIN_46: UnitTime;
759
+ MIN_47: UnitTime;
760
+ MIN_48: UnitTime;
761
+ MIN_49: UnitTime;
762
+ MIN_50: UnitTime;
763
+ MIN_51: UnitTime;
764
+ MIN_52: UnitTime;
765
+ MIN_53: UnitTime;
766
+ MIN_54: UnitTime;
767
+ MIN_55: UnitTime;
768
+ MIN_56: UnitTime;
769
+ MIN_57: UnitTime;
770
+ MIN_58: UnitTime;
771
+ MIN_59: UnitTime;
772
+ MIN_60: UnitTime;
773
+ };
774
+ hour: {
775
+ HOUR_01: UnitTime;
776
+ HOUR_02: UnitTime;
777
+ HOUR_03: UnitTime;
778
+ HOUR_04: UnitTime;
779
+ HOUR_05: UnitTime;
780
+ HOUR_06: UnitTime;
781
+ HOUR_07: UnitTime;
782
+ HOUR_08: UnitTime;
783
+ HOUR_09: UnitTime;
784
+ HOUR_10: UnitTime;
785
+ HOUR_11: UnitTime;
786
+ HOUR_12: UnitTime;
787
+ HOUR_13: UnitTime;
788
+ HOUR_14: UnitTime;
789
+ HOUR_15: UnitTime;
790
+ HOUR_16: UnitTime;
791
+ HOUR_17: UnitTime;
792
+ HOUR_18: UnitTime;
793
+ HOUR_19: UnitTime;
794
+ HOUR_20: UnitTime;
795
+ HOUR_21: UnitTime;
796
+ HOUR_22: UnitTime;
797
+ HOUR_23: UnitTime;
798
+ HOUR_24: UnitTime;
799
+ };
800
+ day: {
801
+ DAY_01: UnitTime;
802
+ DAY_02: UnitTime;
803
+ DAY_03: UnitTime;
804
+ DAY_04: UnitTime;
805
+ DAY_05: UnitTime;
806
+ DAY_06: UnitTime;
807
+ DAY_07: UnitTime;
808
+ DAY_08: UnitTime;
809
+ DAY_09: UnitTime;
810
+ DAY_10: UnitTime;
811
+ };
812
+ readonly DAY: boolean;
813
+ readonly NIGHT: boolean;
814
+ };
815
+
816
+ declare class Log {
817
+ private static getPrefix;
818
+ static info(message: string): void;
819
+ static warn(message: string): void;
820
+ static error(message: string): void;
821
+ static debug(message: string): void;
822
+ static table(data: Record<string, any>[]): void;
823
+ }
824
+
825
+ declare class SimpleMutex {
826
+ private _locked;
827
+ private queue;
828
+ constructor();
829
+ /**
830
+ * Verrouille le mutex. Si le mutex est déjà verrouillé, la méthode retourne une promesse qui sera résolue une fois que le mutex sera disponible.
831
+ * @returns Une promesse résolue lorsque le mutex est verrouillé.
832
+ */
833
+ lock(): Promise<void>;
834
+ /**
835
+ * Déverrouille le mutex. Si une file d'attente existe, débloque le prochain élément dans la file.
836
+ */
837
+ unlock(): void;
838
+ get locked(): boolean;
839
+ }
840
+
841
+ /**
842
+ * Classe utilitaire pour valider tous les formats Discord avec regex
843
+ */
844
+ declare class DiscordRegex {
845
+ static readonly SPACE = "\u200B";
846
+ static readonly URL_REGEX: RegExp;
847
+ static readonly USER_REGEX: RegExp;
848
+ static readonly BOT_REGEX: RegExp;
849
+ static readonly CHANNEL_REGEX: RegExp;
850
+ static readonly ROLE_REGEX: RegExp;
851
+ /**
852
+ * Mention a User
853
+ * Mention a Role
854
+ */
855
+ static readonly DISCORD_PING_REGEX: RegExp;
856
+ /**
857
+ * Mention a User
858
+ * Mention a Role
859
+ * Mention a Channel
860
+ */
861
+ static readonly DISCORD_MENTION_REGEX: RegExp;
862
+ static readonly USER_ID: RegExp;
863
+ static readonly CHANNEL_ID: RegExp;
864
+ static readonly GUILD_ID: RegExp;
865
+ static readonly BOT_ID: RegExp;
866
+ static readonly USERNAME: RegExp;
867
+ static readonly USERNAME_DISCRIM: RegExp;
868
+ static readonly CHANNEL_MENTION: RegExp;
869
+ static readonly USER_MENTION: RegExp;
870
+ static readonly ROLE_MENTION: RegExp;
871
+ static readonly INVITE: RegExp;
872
+ static readonly EMOJI: RegExp;
873
+ /**
874
+ * Validate Discord ID Discord (18)
875
+ */
876
+ static isDiscordId(id: string): boolean;
877
+ /**
878
+ * Validate a bot ID (19)
879
+ */
880
+ static isBotMention(mention: string): boolean;
881
+ /**
882
+ * Validate a User ping
883
+ */
884
+ static isUserMention(mention: string): boolean;
885
+ /**
886
+ * Validate a Discord username
887
+ */
888
+ static isUsername(username: string): boolean;
889
+ /**
890
+ * Type guard for Discord ID
891
+ */
892
+ static isDiscordIdType(id: string): id is string;
893
+ /**
894
+ * Any Discord URL
895
+ */
896
+ static isDiscordUrl(url: string): boolean;
897
+ /**
898
+ * Any discord mention
899
+ */
900
+ static isAnyMention(text: string): boolean;
901
+ /**
902
+ * List all regex
903
+ */
904
+ static listAll(): Record<string, RegExp | string>;
905
+ }
906
+
907
+ declare const SimpleDiscordBotInfo: {
908
+ name: string;
909
+ version: string;
910
+ author: string;
911
+ description: string;
912
+ license: string;
913
+ };
914
+
915
+ export { Bot, type BotConfig, BotEnv, DiscordRegex, EmbedColor, EmbedManager, FileManager, GuildManager, Log, ModalManager, type RandomBotActivity, ReactionManager, SelectMenuManager, SimpleDiscordBotInfo, SimpleMutex, Time, UserManager, WebhookManager };