@spatulox/simplediscordbot 1.0.7 → 1.0.9
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/dist/bot/Bot.d.ts +33 -0
- package/dist/bot/Bot.d.ts.map +1 -0
- package/dist/bot/BotEnv.d.ts +6 -0
- package/dist/bot/BotEnv.d.ts.map +1 -0
- package/dist/bot/BotLog.d.ts +52 -0
- package/dist/bot/BotLog.d.ts.map +1 -0
- package/dist/bot/BotMessage.d.ts +19 -0
- package/dist/bot/BotMessage.d.ts.map +1 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/manager/FileManager.d.ts +37 -0
- package/dist/manager/FileManager.d.ts.map +1 -0
- package/dist/manager/builder/SendableComponentBuilder.d.ts +13 -0
- package/dist/manager/builder/SendableComponentBuilder.d.ts.map +1 -0
- package/dist/manager/direct/UserManager.d.ts +27 -0
- package/dist/manager/direct/UserManager.d.ts.map +1 -0
- package/dist/manager/guild/ChannelManager/ForumChannelManager.d.ts +9 -0
- package/dist/manager/guild/ChannelManager/ForumChannelManager.d.ts.map +1 -0
- package/dist/manager/guild/ChannelManager/GuildChannelList.d.ts +17 -0
- package/dist/manager/guild/ChannelManager/GuildChannelList.d.ts.map +1 -0
- package/dist/manager/guild/ChannelManager/GuildChannelManager.d.ts +18 -0
- package/dist/manager/guild/ChannelManager/GuildChannelManager.d.ts.map +1 -0
- package/dist/manager/guild/ChannelManager/GuildMessageManager.d.ts +23 -0
- package/dist/manager/guild/ChannelManager/GuildMessageManager.d.ts.map +1 -0
- package/dist/manager/guild/ChannelManager/GuildTextChannelManager.d.ts +9 -0
- package/dist/manager/guild/ChannelManager/GuildTextChannelManager.d.ts.map +1 -0
- package/dist/manager/guild/ChannelManager/GuildVoiceChannelManager.d.ts +9 -0
- package/dist/manager/guild/ChannelManager/GuildVoiceChannelManager.d.ts.map +1 -0
- package/dist/manager/guild/ChannelManager/NewsChannelManager.d.ts +9 -0
- package/dist/manager/guild/ChannelManager/NewsChannelManager.d.ts.map +1 -0
- package/dist/manager/guild/ChannelManager/StageChannelManager.d.ts +9 -0
- package/dist/manager/guild/ChannelManager/StageChannelManager.d.ts.map +1 -0
- package/dist/manager/guild/ChannelManager/ThreadChannelManager.d.ts +13 -0
- package/dist/manager/guild/ChannelManager/ThreadChannelManager.d.ts.map +1 -0
- package/dist/manager/guild/GuildManager.d.ts +31 -0
- package/dist/manager/guild/GuildManager.d.ts.map +1 -0
- package/dist/manager/guild/GuildUserManager.d.ts +47 -0
- package/dist/manager/guild/GuildUserManager.d.ts.map +1 -0
- package/dist/manager/guild/InviteManager.d.ts +21 -0
- package/dist/manager/guild/InviteManager.d.ts.map +1 -0
- package/dist/manager/guild/InviteManager_old.d.ts +24 -0
- package/dist/manager/guild/InviteManager_old.d.ts.map +1 -0
- package/dist/manager/guild/RoleManager.d.ts +24 -0
- package/dist/manager/guild/RoleManager.d.ts.map +1 -0
- package/dist/manager/interactions/InteractionManager.d.ts +17 -0
- package/dist/manager/interactions/InteractionManager.d.ts.map +1 -0
- package/dist/manager/interactions/ModalManager.d.ts +23 -0
- package/dist/manager/interactions/ModalManager.d.ts.map +1 -0
- package/dist/manager/interactions/SelectMenuManager.d.ts +58 -0
- package/dist/manager/interactions/SelectMenuManager.d.ts.map +1 -0
- package/dist/manager/messages/EmbedManager.d.ts +84 -0
- package/dist/manager/messages/EmbedManager.d.ts.map +1 -0
- package/dist/manager/messages/ReactionManager.d.ts +26 -0
- package/dist/manager/messages/ReactionManager.d.ts.map +1 -0
- package/dist/manager/messages/WebhookManager.d.ts +33 -0
- package/dist/manager/messages/WebhookManager.d.ts.map +1 -0
- package/dist/test/client.d.ts +3 -0
- package/dist/test/client.d.ts.map +1 -0
- package/dist/test/client.js +15 -0
- package/dist/test/index.d.ts +2 -0
- package/dist/test/index.d.ts.map +1 -0
- package/dist/test/index.js +26 -0
- package/dist/test/randomActivityList.d.ts +3 -0
- package/dist/test/randomActivityList.d.ts.map +1 -0
- package/dist/test/randomActivityList.js +9 -0
- package/dist/type/FolderName.d.ts +6 -0
- package/dist/type/FolderName.d.ts.map +1 -0
- package/dist/utils/DiscordRegex.d.ts +66 -0
- package/dist/utils/DiscordRegex.d.ts.map +1 -0
- package/dist/utils/Log.d.ts +9 -0
- package/dist/utils/Log.d.ts.map +1 -0
- package/dist/utils/SimpleMutex.d.ts +16 -0
- package/dist/utils/SimpleMutex.d.ts.map +1 -0
- package/dist/utils/network/InternetChecker.d.ts +10 -0
- package/dist/utils/network/InternetChecker.d.ts.map +1 -0
- package/dist/utils/times/UnitTime.d.ts +187 -0
- package/dist/utils/times/UnitTime.d.ts.map +1 -0
- package/package.json +6 -2
- package/.env.example +0 -2
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { BaseInteraction, InteractionResponse, Message } from "discord.js";
|
|
2
|
+
import { SendableComponent } from "../builder/SendableComponentBuilder";
|
|
3
|
+
export declare class InteractionManager {
|
|
4
|
+
/**
|
|
5
|
+
* InteractionReplyOptions && InteractionUpdateOptions
|
|
6
|
+
* The two have "content", "embeds" & "flags" field, so an internal cast is ok, unless discord/discordjs deprecate it
|
|
7
|
+
*/
|
|
8
|
+
private static buildReplyOptions;
|
|
9
|
+
private static buildUpdateOptions;
|
|
10
|
+
private static _buildOptions;
|
|
11
|
+
static send(interaction: BaseInteraction, content: string, component: SendableComponent, ephemeral?: boolean): Promise<InteractionResponse<boolean> | Message<boolean> | boolean>;
|
|
12
|
+
static reply(interaction: BaseInteraction, content: string, component: SendableComponent, ephemeral?: boolean): Promise<InteractionResponse<boolean> | Message<boolean> | boolean>;
|
|
13
|
+
static followUp(interaction: BaseInteraction, content: string, component: SendableComponent, ephemeral?: boolean): Promise<InteractionResponse<boolean> | Message<boolean> | boolean>;
|
|
14
|
+
static defer(interaction: BaseInteraction): Promise<void>;
|
|
15
|
+
static update(interaction: BaseInteraction, content: string, component: SendableComponent): Promise<void>;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=InteractionManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InteractionManager.d.ts","sourceRoot":"","sources":["../../../src/manager/interactions/InteractionManager.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,eAAe,EACU,mBAAmB,EAClB,OAAO,EACpC,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAC,iBAAiB,EAA2B,MAAM,qCAAqC,CAAC;AAEhG,qBAAa,kBAAkB;IAE3B;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,iBAAiB;IAIhC,OAAO,CAAC,MAAM,CAAC,kBAAkB;IAIjC,OAAO,CAAC,MAAM,CAAC,aAAa;WAIf,IAAI,CACb,WAAW,EAAE,eAAe,EAC5B,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,iBAAiB,EAC5B,SAAS,GAAE,OAAe,GAC3B,OAAO,CAAC,mBAAmB,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;WAaxD,KAAK,CACd,WAAW,EAAE,eAAe,EAC5B,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,iBAAiB,EAC5B,SAAS,GAAE,OAAe,GAC3B,OAAO,CAAC,mBAAmB,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;WAIxD,QAAQ,CACjB,WAAW,EAAE,eAAe,EAC5B,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,iBAAiB,EAC5B,SAAS,GAAE,OAAe,GAC3B,OAAO,CAAC,mBAAmB,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;WAIxD,KAAK,CAAC,WAAW,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC;WAqBlD,MAAM,CACf,WAAW,EAAE,eAAe,EAC5B,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,iBAAiB,GAC7B,OAAO,CAAC,IAAI,CAAC;CAgBnB"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ModalBuilder } from "discord.js";
|
|
2
|
+
export interface ModalJson {
|
|
3
|
+
title: string;
|
|
4
|
+
customId: string;
|
|
5
|
+
label: string;
|
|
6
|
+
fields: any[];
|
|
7
|
+
}
|
|
8
|
+
export declare class ModalManager {
|
|
9
|
+
/**
|
|
10
|
+
* Load modal from JSON file and return ModalBuilder
|
|
11
|
+
*/
|
|
12
|
+
static load(filename: string): Promise<ModalBuilder | false>;
|
|
13
|
+
/**
|
|
14
|
+
* List all modal files
|
|
15
|
+
*/
|
|
16
|
+
static list(): Promise<string[] | false>;
|
|
17
|
+
private static jsonToBuilder;
|
|
18
|
+
private static fieldJsonToInput;
|
|
19
|
+
static parseNumber(value: string): number | null;
|
|
20
|
+
static parsePhone(value: string): string | null;
|
|
21
|
+
static parseDate(value: string): Date | null;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=ModalManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModalManager.d.ts","sourceRoot":"","sources":["../../../src/manager/interactions/ModalManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAGH,YAAY,EAGf,MAAM,YAAY,CAAC;AAIpB,MAAM,WAAW,SAAS;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,GAAG,EAAE,CAAC;CACjB;AAED,qBAAa,YAAY;IACrB;;OAEG;WACU,IAAI,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,GAAG,KAAK,CAAC;IAUlE;;OAEG;WACU,IAAI,IAAI,OAAO,CAAC,MAAM,EAAE,GAAG,KAAK,CAAC;IAS9C,OAAO,CAAC,MAAM,CAAC,aAAa;IAgB5B,OAAO,CAAC,MAAM,CAAC,gBAAgB;IAmC/B,MAAM,CAAC,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAMhD,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAgB/C,MAAM,CAAC,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;CAiB/C"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { ActionRowBuilder, StringSelectMenuBuilder, StringSelectMenuOptionBuilder, UserSelectMenuBuilder, RoleSelectMenuBuilder, MentionableSelectMenuBuilder, ChannelSelectMenuBuilder, MessageActionRowComponentBuilder, ChannelType } from "discord.js";
|
|
2
|
+
export type SelectMenuCreateOption = {
|
|
3
|
+
label: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
emoji?: string;
|
|
6
|
+
value: string;
|
|
7
|
+
};
|
|
8
|
+
export declare class SelectMenuManager {
|
|
9
|
+
/**
|
|
10
|
+
* Creates base StringSelectMenu - SIMPLE API !
|
|
11
|
+
*/
|
|
12
|
+
static create(customId: string, placeholder?: string): StringSelectMenuBuilder;
|
|
13
|
+
/**
|
|
14
|
+
* Quick StringSelectMenu
|
|
15
|
+
*/
|
|
16
|
+
static simple(customId: string, options: SelectMenuCreateOption[], placeholder?: string): StringSelectMenuBuilder;
|
|
17
|
+
/**
|
|
18
|
+
* Pagination menu
|
|
19
|
+
*/
|
|
20
|
+
static paginated(customId: string, options: SelectMenuCreateOption[], pageSize?: number): ActionRowBuilder<MessageActionRowComponentBuilder>;
|
|
21
|
+
/**
|
|
22
|
+
* User Select Menu (Components V2)
|
|
23
|
+
*/
|
|
24
|
+
static users(customId: string, placeholder?: string): UserSelectMenuBuilder;
|
|
25
|
+
/**
|
|
26
|
+
* Role Select Menu (Components V2)
|
|
27
|
+
*/
|
|
28
|
+
static roles(customId: string, placeholder?: string): RoleSelectMenuBuilder;
|
|
29
|
+
/**
|
|
30
|
+
* Mentionable Select Menu (Components V2)
|
|
31
|
+
*/
|
|
32
|
+
static mentionables(customId: string, placeholder?: string): MentionableSelectMenuBuilder;
|
|
33
|
+
/**
|
|
34
|
+
* Channel Select Menu (Components V2)
|
|
35
|
+
*/
|
|
36
|
+
static channels(customId: string, placeholder?: string, channelTypes?: ChannelType[]): ChannelSelectMenuBuilder;
|
|
37
|
+
/**
|
|
38
|
+
* Quick option creator
|
|
39
|
+
*/
|
|
40
|
+
static option(option: SelectMenuCreateOption): StringSelectMenuOptionBuilder;
|
|
41
|
+
static option(options: SelectMenuCreateOption[]): StringSelectMenuOptionBuilder[];
|
|
42
|
+
private static _createOption;
|
|
43
|
+
/**
|
|
44
|
+
* Fluent API pour personnaliser
|
|
45
|
+
*/
|
|
46
|
+
static placeholder(menu: StringSelectMenuBuilder, placeholder: string): StringSelectMenuBuilder;
|
|
47
|
+
static minMax(menu: StringSelectMenuBuilder, min: number, max: number): StringSelectMenuBuilder;
|
|
48
|
+
static disabled(menu: StringSelectMenuBuilder, disabled: boolean): StringSelectMenuBuilder;
|
|
49
|
+
/**
|
|
50
|
+
* ActionRow
|
|
51
|
+
*/
|
|
52
|
+
static row<T extends MessageActionRowComponentBuilder>(component: T): ActionRowBuilder<MessageActionRowComponentBuilder>;
|
|
53
|
+
/**
|
|
54
|
+
* Rows multiples (5 max)
|
|
55
|
+
*/
|
|
56
|
+
static rows(...components: MessageActionRowComponentBuilder[]): ActionRowBuilder<MessageActionRowComponentBuilder>[];
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=SelectMenuManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SelectMenuManager.d.ts","sourceRoot":"","sources":["../../../src/manager/interactions/SelectMenuManager.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,gBAAgB,EAChB,uBAAuB,EACvB,6BAA6B,EAC7B,qBAAqB,EACrB,qBAAqB,EACrB,4BAA4B,EAC5B,wBAAwB,EACxB,gCAAgC,EAAE,WAAW,EAChD,MAAM,YAAY,CAAC;AAEpB,MAAM,MAAM,sBAAsB,GAAG;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,qBAAa,iBAAiB;IAE1B;;OAEG;IACH,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,GAAE,MAA8B,GAAG,uBAAuB;IAQrG;;OAEG;IACH,MAAM,CAAC,MAAM,CACT,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,sBAAsB,EAAE,EACjC,WAAW,GAAE,MAA2B,GACzC,uBAAuB;IAa1B;;OAEG;IACH,MAAM,CAAC,SAAS,CACZ,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,sBAAsB,EAAE,EACjC,QAAQ,GAAE,MAAW,GACtB,gBAAgB,CAAC,gCAAgC,CAAC;IAmBrD;;OAEG;IACH,MAAM,CAAC,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,GAAE,MAA0B,GAAG,qBAAqB;IAQ9F;;OAEG;IACH,MAAM,CAAC,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,GAAE,MAA0B,GAAG,qBAAqB;IAQ9F;;OAEG;IACH,MAAM,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,GAAE,MAAgC,GAAG,4BAA4B;IAQlH;;OAEG;IACH,MAAM,CAAC,QAAQ,CACX,QAAQ,EAAE,MAAM,EAChB,WAAW,GAAE,MAA6B,EAC1C,YAAY,GAAE,WAAW,EAAO,GACjC,wBAAwB;IAS3B;;OAEG;IACH,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,sBAAsB,GAAG,6BAA6B;IAC5E,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,sBAAsB,EAAE,GAAG,6BAA6B,EAAE;IASjF,OAAO,CAAC,MAAM,CAAC,aAAa;IAW5B;;OAEG;IACH,MAAM,CAAC,WAAW,CAAC,IAAI,EAAE,uBAAuB,EAAE,WAAW,EAAE,MAAM,GAAG,uBAAuB;IAI/F,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,uBAAuB,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,uBAAuB;IAI/F,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,uBAAuB,EAAE,QAAQ,EAAE,OAAO,GAAG,uBAAuB;IAI1F;;OAEG;IACH,MAAM,CAAC,GAAG,CAAC,CAAC,SAAS,gCAAgC,EAAE,SAAS,EAAE,CAAC,GAAG,gBAAgB,CAAC,gCAAgC,CAAC;IAIxH;;OAEG;IACH,MAAM,CAAC,IAAI,CAAC,GAAG,UAAU,EAAE,gCAAgC,EAAE,GAAG,gBAAgB,CAAC,gCAAgC,CAAC,EAAE;CAKvH"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { EmbedBuilder, InteractionDeferReplyOptions } from "discord.js";
|
|
2
|
+
export declare enum EmbedColor {
|
|
3
|
+
error = 8912917,
|
|
4
|
+
success = 65280,
|
|
5
|
+
black = 0,
|
|
6
|
+
white = 16777215,
|
|
7
|
+
red = 16711680,
|
|
8
|
+
green = 65280,
|
|
9
|
+
blue = 255,
|
|
10
|
+
yellow = 16776960,
|
|
11
|
+
cyan = 65535,
|
|
12
|
+
magenta = 16711935,
|
|
13
|
+
gray = 8421504,
|
|
14
|
+
lightgray = 13882323,
|
|
15
|
+
darkgray = 11119017,
|
|
16
|
+
orange = 16753920,
|
|
17
|
+
purple = 8388736,
|
|
18
|
+
pink = 16761035,
|
|
19
|
+
brown = 10824234,
|
|
20
|
+
lime = 65280,
|
|
21
|
+
navy = 128,
|
|
22
|
+
teal = 32896,
|
|
23
|
+
olive = 8421376,
|
|
24
|
+
gold = 16766720,
|
|
25
|
+
silver = 12632256,
|
|
26
|
+
coral = 16744272,
|
|
27
|
+
salmon = 16416882,
|
|
28
|
+
khaki = 15787660,
|
|
29
|
+
plum = 14524637,
|
|
30
|
+
lavender = 15132410,
|
|
31
|
+
beige = 16119260,
|
|
32
|
+
mint = 10026904,
|
|
33
|
+
peach = 16767673,
|
|
34
|
+
chocolate = 13789470,
|
|
35
|
+
crimson = 14423100,
|
|
36
|
+
youtube = 16718362,
|
|
37
|
+
default = 6064856,
|
|
38
|
+
minecraft = 25600
|
|
39
|
+
}
|
|
40
|
+
export declare class EmbedManager {
|
|
41
|
+
private static get BOT_ICON();
|
|
42
|
+
private static get DEFAULT_COLOR();
|
|
43
|
+
/**
|
|
44
|
+
* Creates base embed - SAME SIMPLE API !
|
|
45
|
+
*/
|
|
46
|
+
static create(color?: EmbedColor | null): EmbedBuilder;
|
|
47
|
+
/**
|
|
48
|
+
* Creates simple embed with just description
|
|
49
|
+
*/
|
|
50
|
+
static simple(description: string, color?: EmbedColor | null): EmbedBuilder;
|
|
51
|
+
/**
|
|
52
|
+
* Creates error embed
|
|
53
|
+
*/
|
|
54
|
+
static error(description: string): EmbedBuilder;
|
|
55
|
+
/**
|
|
56
|
+
* Creates success embed
|
|
57
|
+
*/
|
|
58
|
+
static success(description: string): EmbedBuilder;
|
|
59
|
+
/**
|
|
60
|
+
* Creates success embed
|
|
61
|
+
*/
|
|
62
|
+
static description(description: string): EmbedBuilder;
|
|
63
|
+
/**
|
|
64
|
+
* Creates debug embed
|
|
65
|
+
*/
|
|
66
|
+
static debug(description: string): EmbedBuilder;
|
|
67
|
+
/**
|
|
68
|
+
* Defer ephemeral reply
|
|
69
|
+
*/
|
|
70
|
+
static deferEphemeral(): InteractionDeferReplyOptions;
|
|
71
|
+
/**
|
|
72
|
+
* Quick field adder
|
|
73
|
+
*/
|
|
74
|
+
static field(embed: EmbedBuilder, name: string, value: string, inline?: boolean): EmbedBuilder;
|
|
75
|
+
/**
|
|
76
|
+
* Fluent API shortcuts
|
|
77
|
+
*/
|
|
78
|
+
static title(embed: EmbedBuilder, title: string): EmbedBuilder;
|
|
79
|
+
static desc(embed: EmbedBuilder, description: string): EmbedBuilder;
|
|
80
|
+
static thumb(embed: EmbedBuilder, url: string): EmbedBuilder;
|
|
81
|
+
static image(embed: EmbedBuilder, url: string): EmbedBuilder;
|
|
82
|
+
static footer(embed: EmbedBuilder, text: string): EmbedBuilder;
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=EmbedManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EmbedManager.d.ts","sourceRoot":"","sources":["../../../src/manager/messages/EmbedManager.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,YAAY,EACZ,4BAA4B,EAE/B,MAAM,YAAY,CAAC;AAGpB,oBAAY,UAAU;IAClB,KAAK,UAAW;IAChB,OAAO,QAAW;IAClB,KAAK,IAAW;IAChB,KAAK,WAAW;IAChB,GAAG,WAAW;IACd,KAAK,QAAW;IAChB,IAAI,MAAW;IACf,MAAM,WAAW;IACjB,IAAI,QAAW;IACf,OAAO,WAAW;IAClB,IAAI,UAAW;IACf,SAAS,WAAW;IACpB,QAAQ,WAAW;IACnB,MAAM,WAAW;IACjB,MAAM,UAAW;IACjB,IAAI,WAAW;IACf,KAAK,WAAW;IAChB,IAAI,QAAW;IACf,IAAI,MAAW;IACf,IAAI,QAAW;IACf,KAAK,UAAW;IAChB,IAAI,WAAW;IACf,MAAM,WAAW;IACjB,KAAK,WAAW;IAChB,MAAM,WAAW;IACjB,KAAK,WAAW;IAChB,IAAI,WAAW;IACf,QAAQ,WAAW;IACnB,KAAK,WAAW;IAChB,IAAI,WAAW;IACf,KAAK,WAAW;IAChB,SAAS,WAAW;IACpB,OAAO,WAAW;IAClB,OAAO,WAAW;IAClB,OAAO,UAAW;IAClB,SAAS,QAAW;CACvB;AAED,qBAAa,YAAY;IACrB,OAAO,CAAC,MAAM,KAAK,QAAQ,GAE1B;IACD,OAAO,CAAC,MAAM,KAAK,aAAa,GAE/B;IAED;;OAEG;IACH,MAAM,CAAC,MAAM,CAAC,KAAK,GAAE,UAAU,GAAG,IAAW,GAAG,YAAY;IAc5D;;OAEG;IACH,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,GAAE,UAAU,GAAG,IAAW,GAAG,YAAY;IAOjF;;OAEG;IACH,MAAM,CAAC,KAAK,CAAC,WAAW,EAAE,MAAM,GAAG,YAAY;IAM/C;;OAEG;IACH,MAAM,CAAC,OAAO,CAAC,WAAW,EAAE,MAAM,GAAG,YAAY;IAMjD;;OAEG;IACH,MAAM,CAAC,WAAW,CAAC,WAAW,EAAE,MAAM,GAAG,YAAY;IAKrD;;OAEG;IACH,MAAM,CAAC,KAAK,CAAC,WAAW,EAAE,MAAM,GAAG,YAAY;IAM/C;;OAEG;IACH,MAAM,CAAC,cAAc,IAAI,4BAA4B;IAIrD;;OAEG;IACH,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,GAAE,OAAe,GAAG,YAAY;IAIrG;;OAEG;IACH,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,GAAG,YAAY;IAI9D,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,GAAG,YAAY;IAInE,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,GAAG,YAAY;IAI5D,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,GAAG,YAAY;IAI5D,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,GAAG,YAAY;CAGjE"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { User, EmojiResolvable } from 'discord.js';
|
|
2
|
+
export declare class ReactionManager {
|
|
3
|
+
/**
|
|
4
|
+
* Add a reaction to a message
|
|
5
|
+
*/
|
|
6
|
+
static add(channelId: string, messageId: string, emoji: string | EmojiResolvable): Promise<void>;
|
|
7
|
+
/**
|
|
8
|
+
* Delete a reaction from a user
|
|
9
|
+
*/
|
|
10
|
+
static remove(channelId: string, messageId: string, emoji: string, userId: string): Promise<void>;
|
|
11
|
+
/**
|
|
12
|
+
* Get all reaction of a message
|
|
13
|
+
*/
|
|
14
|
+
static getAll(channelId: string, messageId: string): Promise<Reaction[]>;
|
|
15
|
+
/**
|
|
16
|
+
* Delete all reaction
|
|
17
|
+
*/
|
|
18
|
+
static clear(channelId: string, messageId: string): Promise<void>;
|
|
19
|
+
}
|
|
20
|
+
interface Reaction {
|
|
21
|
+
emoji: any;
|
|
22
|
+
count: number;
|
|
23
|
+
users: User[];
|
|
24
|
+
}
|
|
25
|
+
export {};
|
|
26
|
+
//# sourceMappingURL=ReactionManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReactionManager.d.ts","sourceRoot":"","sources":["../../../src/manager/messages/ReactionManager.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,IAAI,EACJ,eAAe,EAClB,MAAM,YAAY,CAAC;AAKpB,qBAAa,eAAe;IAExB;;OAEG;WACU,GAAG,CACZ,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,MAAM,GAAG,eAAe,GAChC,OAAO,CAAC,IAAI,CAAC;IAqBhB;;OAEG;WACU,MAAM,CACf,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,GACf,OAAO,CAAC,IAAI,CAAC;IAwBhB;;OAEG;WACU,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;IA4B9E;;OAEG;WACU,KAAK,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAgB1E;AAED,UAAU,QAAQ;IACd,KAAK,EAAE,GAAG,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,IAAI,EAAE,CAAC;CACjB"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { TextChannel, Message, ThreadChannel, WebhookMessageCreateOptions } from 'discord.js';
|
|
2
|
+
import { SendableComponent } from "../builder/SendableComponentBuilder";
|
|
3
|
+
export declare class WebhookManager {
|
|
4
|
+
private readonly channel;
|
|
5
|
+
private readonly name;
|
|
6
|
+
private readonly avatarURL?;
|
|
7
|
+
private webhook;
|
|
8
|
+
constructor(channel: TextChannel | ThreadChannel, name?: string, avatarURL?: string | undefined);
|
|
9
|
+
private get textChannel();
|
|
10
|
+
/**
|
|
11
|
+
* Get or create webhook (lazy initialization)
|
|
12
|
+
*/
|
|
13
|
+
private getWebhook;
|
|
14
|
+
/**
|
|
15
|
+
* Send message/text/component !
|
|
16
|
+
*/
|
|
17
|
+
send(content: string): Promise<Message | null>;
|
|
18
|
+
send(content: SendableComponent): Promise<Message | null>;
|
|
19
|
+
send(content: WebhookMessageCreateOptions): Promise<Message | null>;
|
|
20
|
+
/**
|
|
21
|
+
* Quick success embed
|
|
22
|
+
*/
|
|
23
|
+
success(message: string): Promise<Message | null>;
|
|
24
|
+
/**
|
|
25
|
+
* Quick error embed
|
|
26
|
+
*/
|
|
27
|
+
error(message: string): Promise<Message | null>;
|
|
28
|
+
/**
|
|
29
|
+
* Delete webhook
|
|
30
|
+
*/
|
|
31
|
+
delete(reason?: string): Promise<void>;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=WebhookManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WebhookManager.d.ts","sourceRoot":"","sources":["../../../src/manager/messages/WebhookManager.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,WAAW,EAEX,OAAO,EACP,aAAa,EACb,2BAA2B,EAC9B,MAAM,YAAY,CAAC;AAIpB,OAAO,EAAC,iBAAiB,EAA2B,MAAM,qCAAqC,CAAC;AAEhG,qBAAa,cAAc;IAInB,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC;IAL/B,OAAO,CAAC,OAAO,CAAwB;gBAGlB,OAAO,EAAE,WAAW,GAAG,aAAa,EACpC,IAAI,GAAE,MAAiC,EACvC,SAAS,CAAC,EAAE,MAAM,YAAA;IAGvC,OAAO,KAAK,WAAW,GAItB;IAED;;OAEG;YACW,UAAU;IAoBxB;;OAEG;IACG,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;IAC9C,IAAI,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;IACzD,IAAI,CAAC,OAAO,EAAE,2BAA2B,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;IAgCzE;;OAEG;IACG,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;IAIvD;;OAEG;IACG,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;IAIrD;;OAEG;IACG,MAAM,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAgB/C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/test/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAA8B,MAAM,YAAY,CAAC;AAEhE,eAAO,MAAM,MAAM,iBAUjB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.client = void 0;
|
|
4
|
+
const discord_js_1 = require("discord.js");
|
|
5
|
+
exports.client = new discord_js_1.Client({ intents: [
|
|
6
|
+
discord_js_1.GatewayIntentBits.Guilds,
|
|
7
|
+
discord_js_1.GatewayIntentBits.GuildMembers,
|
|
8
|
+
discord_js_1.GatewayIntentBits.GuildMessages,
|
|
9
|
+
discord_js_1.GatewayIntentBits.MessageContent,
|
|
10
|
+
discord_js_1.GatewayIntentBits.GuildMessageReactions,
|
|
11
|
+
discord_js_1.GatewayIntentBits.DirectMessageReactions,
|
|
12
|
+
discord_js_1.GatewayIntentBits.DirectMessages
|
|
13
|
+
],
|
|
14
|
+
partials: [discord_js_1.Partials.Channel]
|
|
15
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/test/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const index_1 = require("../index");
|
|
4
|
+
const client_1 = require("./client");
|
|
5
|
+
const discord_js_1 = require("discord.js");
|
|
6
|
+
const randomActivityList_1 = require("./randomActivityList");
|
|
7
|
+
async function main() {
|
|
8
|
+
const config = {
|
|
9
|
+
defaultEmbedColor: index_1.EmbedColor.blue, // (When embed are created with EmbedManager)
|
|
10
|
+
botName: "Simple Discord Bot", // The name of the bot
|
|
11
|
+
log: {
|
|
12
|
+
logChannelId: "1162047096220827831",
|
|
13
|
+
errorChannelId: "1162047096220827831",
|
|
14
|
+
info: { console: true, discord: true },
|
|
15
|
+
error: { console: true, discord: true },
|
|
16
|
+
warn: { console: true, discord: true },
|
|
17
|
+
debug: { console: true, discord: true },
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
const bot = new index_1.Bot(client_1.client, config);
|
|
21
|
+
bot.client.on(discord_js_1.Events.ClientReady, async () => {
|
|
22
|
+
index_1.Bot.setRandomActivity(randomActivityList_1.randomActivityList, index_1.Time.minute.MIN_10.toMilliseconds());
|
|
23
|
+
});
|
|
24
|
+
// After that, you can implement what you want
|
|
25
|
+
}
|
|
26
|
+
main();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"randomActivityList.d.ts","sourceRoot":"","sources":["../../src/test/randomActivityList.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAG7C,eAAO,MAAM,kBAAkB,EAAE,iBAIhC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.randomActivityList = void 0;
|
|
4
|
+
const discord_js_1 = require("discord.js");
|
|
5
|
+
exports.randomActivityList = [
|
|
6
|
+
{ type: discord_js_1.ActivityType.Playing, message: "a normal game" },
|
|
7
|
+
{ type: discord_js_1.ActivityType.Playing, message: "a hard game" },
|
|
8
|
+
{ type: discord_js_1.ActivityType.Playing, message: "a weird game" }
|
|
9
|
+
];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FolderName.d.ts","sourceRoot":"","sources":["../../src/type/FolderName.ts"],"names":[],"mappings":"AAAA,oBAAY,UAAU;IAClB,cAAc,aAAa;IAC3B,YAAY,iBAAiB;IAC7B,KAAK,WAAW;CACnB"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Classe utilitaire pour valider tous les formats Discord avec regex
|
|
3
|
+
*/
|
|
4
|
+
export declare class DiscordRegex {
|
|
5
|
+
static readonly SPACE = "\u200B";
|
|
6
|
+
static readonly URL_REGEX: RegExp;
|
|
7
|
+
static readonly USER_REGEX: RegExp;
|
|
8
|
+
static readonly BOT_REGEX: RegExp;
|
|
9
|
+
static readonly CHANNEL_REGEX: RegExp;
|
|
10
|
+
static readonly ROLE_REGEX: RegExp;
|
|
11
|
+
/**
|
|
12
|
+
* Mention a User
|
|
13
|
+
* Mention a Role
|
|
14
|
+
*/
|
|
15
|
+
static readonly DISCORD_PING_REGEX: RegExp;
|
|
16
|
+
/**
|
|
17
|
+
* Mention a User
|
|
18
|
+
* Mention a Role
|
|
19
|
+
* Mention a Channel
|
|
20
|
+
*/
|
|
21
|
+
static readonly DISCORD_MENTION_REGEX: RegExp;
|
|
22
|
+
static readonly USER_ID: RegExp;
|
|
23
|
+
static readonly CHANNEL_ID: RegExp;
|
|
24
|
+
static readonly GUILD_ID: RegExp;
|
|
25
|
+
static readonly BOT_ID: RegExp;
|
|
26
|
+
static readonly USERNAME: RegExp;
|
|
27
|
+
static readonly USERNAME_DISCRIM: RegExp;
|
|
28
|
+
static readonly CHANNEL_MENTION: RegExp;
|
|
29
|
+
static readonly USER_MENTION: RegExp;
|
|
30
|
+
static readonly ROLE_MENTION: RegExp;
|
|
31
|
+
static readonly INVITE: RegExp;
|
|
32
|
+
static readonly EMOJI: RegExp;
|
|
33
|
+
/**
|
|
34
|
+
* Validate Discord ID Discord (18)
|
|
35
|
+
*/
|
|
36
|
+
static isDiscordId(id: string): boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Validate a bot ID (19)
|
|
39
|
+
*/
|
|
40
|
+
static isBotMention(mention: string): boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Validate a User ping
|
|
43
|
+
*/
|
|
44
|
+
static isUserMention(mention: string): boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Validate a Discord username
|
|
47
|
+
*/
|
|
48
|
+
static isUsername(username: string): boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Type guard for Discord ID
|
|
51
|
+
*/
|
|
52
|
+
static isDiscordIdType(id: string): id is string;
|
|
53
|
+
/**
|
|
54
|
+
* Any Discord URL
|
|
55
|
+
*/
|
|
56
|
+
static isDiscordUrl(url: string): boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Any discord mention
|
|
59
|
+
*/
|
|
60
|
+
static isAnyMention(text: string): boolean;
|
|
61
|
+
/**
|
|
62
|
+
* List all regex
|
|
63
|
+
*/
|
|
64
|
+
static listAll(): Record<string, RegExp | string>;
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=DiscordRegex.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DiscordRegex.d.ts","sourceRoot":"","sources":["../../src/utils/DiscordRegex.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,qBAAa,YAAY;IAErB,MAAM,CAAC,QAAQ,CAAC,KAAK,YAAY;IAGjC,MAAM,CAAC,QAAQ,CAAC,SAAS,SAAwB;IAGjD,MAAM,CAAC,QAAQ,CAAC,UAAU,SAAe;IACzC,MAAM,CAAC,QAAQ,CAAC,SAAS,SAAe;IACxC,MAAM,CAAC,QAAQ,CAAC,aAAa,SAAiD;IAC9E,MAAM,CAAC,QAAQ,CAAC,UAAU,SAAgB;IAE1C;;;OAGG;IACH,MAAM,CAAC,QAAQ,CAAC,kBAAkB,SAEhC;IAEF;;;;OAIG;IACH,MAAM,CAAC,QAAQ,CAAC,qBAAqB,SAEnC;IAGF,MAAM,CAAC,QAAQ,CAAC,OAAO,SAAiB;IACxC,MAAM,CAAC,QAAQ,CAAC,UAAU,SAAiB;IAC3C,MAAM,CAAC,QAAQ,CAAC,QAAQ,SAAiB;IACzC,MAAM,CAAC,QAAQ,CAAC,MAAM,SAAiB;IAGvC,MAAM,CAAC,QAAQ,CAAC,QAAQ,SAA0B;IAGlD,MAAM,CAAC,QAAQ,CAAC,gBAAgB,SAAgC;IAGhE,MAAM,CAAC,QAAQ,CAAC,eAAe,SAAsB;IAGrD,MAAM,CAAC,QAAQ,CAAC,YAAY,SAAwB;IAGpD,MAAM,CAAC,QAAQ,CAAC,YAAY,SAAuB;IAGnD,MAAM,CAAC,QAAQ,CAAC,MAAM,SAAoD;IAG1E,MAAM,CAAC,QAAQ,CAAC,KAAK,SAA2I;IAEhK;;OAEG;IACH,MAAM,CAAC,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;IAIvC;;OAEG;IACH,MAAM,CAAC,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO;IAI7C;;OAEG;IACH,MAAM,CAAC,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO;IAI9C;;OAEG;IACH,MAAM,CAAC,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO;IAI5C;;OAEG;IACH,MAAM,CAAC,eAAe,CAAC,EAAE,EAAE,MAAM,GAAG,EAAE,IAAI,MAAM;IAIhD;;OAEG;IACH,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAIzC;;OAEG;IACH,MAAM,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAI1C;;OAEG;IACH,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;CAsBpD"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare class Log {
|
|
2
|
+
private static getPrefix;
|
|
3
|
+
static info(message: string): void;
|
|
4
|
+
static warn(message: string): void;
|
|
5
|
+
static error(message: string): void;
|
|
6
|
+
static debug(message: string): void;
|
|
7
|
+
static table(data: Record<string, any>[]): void;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=Log.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Log.d.ts","sourceRoot":"","sources":["../../src/utils/Log.ts"],"names":[],"mappings":"AAAA,qBAAa,GAAG;IACZ,OAAO,CAAC,MAAM,CAAC,SAAS;IAMxB,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAIlC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAIlC,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAInC,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAInC,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,GAAG,IAAI;CAKlD"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare class SimpleMutex {
|
|
2
|
+
private _locked;
|
|
3
|
+
private queue;
|
|
4
|
+
constructor();
|
|
5
|
+
/**
|
|
6
|
+
* 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.
|
|
7
|
+
* @returns Une promesse résolue lorsque le mutex est verrouillé.
|
|
8
|
+
*/
|
|
9
|
+
lock(): Promise<void>;
|
|
10
|
+
/**
|
|
11
|
+
* Déverrouille le mutex. Si une file d'attente existe, débloque le prochain élément dans la file.
|
|
12
|
+
*/
|
|
13
|
+
unlock(): void;
|
|
14
|
+
get locked(): boolean;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=SimpleMutex.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SimpleMutex.d.ts","sourceRoot":"","sources":["../../src/utils/SimpleMutex.ts"],"names":[],"mappings":"AAAA,qBAAa,WAAW;IACpB,OAAO,CAAC,OAAO,CAAU;IACzB,OAAO,CAAC,KAAK,CAAoB;;IAOjC;;;OAGG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAW3B;;OAEG;IACH,MAAM,IAAI,IAAI;IAYd,IAAI,MAAM,IAAI,OAAO,CAEpB;CACJ"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare class InternetChecker {
|
|
2
|
+
private static readonly TARGET;
|
|
3
|
+
private static readonly RETRY_TIME;
|
|
4
|
+
/**
|
|
5
|
+
* Check internet connection towards 1.1.1.1 (Cloudflare DNS)
|
|
6
|
+
* @param tries Number of attempts (0 = infini)
|
|
7
|
+
*/
|
|
8
|
+
static checkConnection(tries?: number): Promise<boolean>;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=InternetChecker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InternetChecker.d.ts","sourceRoot":"","sources":["../../../src/utils/network/InternetChecker.ts"],"names":[],"mappings":"AAGA,qBAAa,eAAe;IACxB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAqB;IACnD,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAsB;IAExD;;;OAGG;WACU,eAAe,CAAC,KAAK,GAAE,MAAU,GAAG,OAAO,CAAC,OAAO,CAAC;CAmDpE"}
|