@stelliajs/framework 1.5.2 → 1.5.4
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 +1 -2
- package/dist/client/StelliaClient.d.ts +2 -2
- package/dist/client/StelliaClient.js +14 -18
- package/dist/client/StelliaUtils.d.ts +8 -8
- package/dist/managers/AutoCompleteManager.d.ts +2 -2
- package/dist/managers/AutoCompleteManager.js +9 -2
- package/dist/managers/BaseManager.d.ts +3 -3
- package/dist/managers/ButtonManager.d.ts +2 -2
- package/dist/managers/ButtonManager.js +2 -2
- package/dist/managers/CommandManager.d.ts +2 -2
- package/dist/managers/CommandManager.js +9 -2
- package/dist/managers/ContextMenuManager.d.ts +2 -2
- package/dist/managers/ContextMenuManager.js +9 -2
- package/dist/managers/EventManager.d.ts +3 -3
- package/dist/managers/EventManager.js +9 -2
- package/dist/managers/ModalManager.d.ts +2 -2
- package/dist/managers/ModalManager.js +2 -2
- package/dist/managers/SelectMenuManager.d.ts +2 -2
- package/dist/managers/SelectMenuManager.js +4 -4
- package/dist/utils/dateFormatters.d.ts +7 -0
- package/dist/utils/dateFormatters.js +22 -0
- package/dist/utils/files.js +7 -12
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +1 -0
- package/package.json +11 -12
package/README.md
CHANGED
|
@@ -11,7 +11,6 @@ Recommended architecture for StelliaJS project.
|
|
|
11
11
|
|
|
12
12
|
```
|
|
13
13
|
.
|
|
14
|
-
├── dist // Build folder
|
|
15
14
|
├── src/
|
|
16
15
|
│ ├── commands/
|
|
17
16
|
│ │ ├── contextMenus/
|
|
@@ -41,7 +40,7 @@ Recommended architecture for StelliaJS project.
|
|
|
41
40
|
│ └── index.ts
|
|
42
41
|
├── .env
|
|
43
42
|
├── package.json
|
|
44
|
-
├──
|
|
43
|
+
├── pnpm-lock.yaml
|
|
45
44
|
├── stellia.json
|
|
46
45
|
└── tsconfig.json
|
|
47
46
|
```
|
|
@@ -11,8 +11,8 @@ export declare class StelliaClient<Ready extends boolean = boolean> extends Clie
|
|
|
11
11
|
getGuildsConfiguration: <CustomGuildsConfiguration extends GuildsConfiguration>() => Promise<CustomGuildsConfiguration>;
|
|
12
12
|
getGuildConfiguration: <CustomGuildConfiguration extends GuildConfiguration>(guildId: string) => CustomGuildConfiguration | undefined;
|
|
13
13
|
handleInteraction: (interaction: Interaction<"cached">) => Promise<void>;
|
|
14
|
-
private areManagersLoaded;
|
|
15
|
-
private static convertFilePathToProduction;
|
|
14
|
+
private readonly areManagersLoaded;
|
|
15
|
+
private static readonly convertFilePathToProduction;
|
|
16
16
|
}
|
|
17
17
|
interface StelliaOptions {
|
|
18
18
|
managers: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as fs from "node:fs";
|
|
2
|
-
import path from "path";
|
|
3
|
-
import { pathToFileURL } from "url";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { pathToFileURL } from "node:url";
|
|
4
4
|
import { Client } from "discord.js";
|
|
5
5
|
import { StelliaUtils } from "./index.js";
|
|
6
6
|
import { AutoCompleteManager, ButtonManager, CommandManager, ContextMenuManager, EventManager, ModalManager, SelectMenuManager } from "../managers/index.js";
|
|
@@ -67,24 +67,20 @@ export class StelliaClient extends Client {
|
|
|
67
67
|
return new Promise((resolve, reject) => {
|
|
68
68
|
fs.readFile(filePath, async (err, data) => {
|
|
69
69
|
if (err) {
|
|
70
|
-
return reject(
|
|
70
|
+
return reject(new Error("stellia.json file not found"));
|
|
71
71
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
return reject(new Error("Invalid environment"));
|
|
76
|
-
}
|
|
77
|
-
const environmentData = environments[chosenEnvironment];
|
|
78
|
-
const environmentPath = environmentData.production
|
|
79
|
-
? StelliaClient.convertFilePathToProduction(environmentData.file)
|
|
80
|
-
: environmentData.file;
|
|
81
|
-
const environmentAbsolutePath = pathToFileURL(path.join(srcPath, "..", environmentPath)).href;
|
|
82
|
-
const environmentFile = await import(environmentAbsolutePath);
|
|
83
|
-
resolve(environmentFile.environment);
|
|
84
|
-
}
|
|
85
|
-
catch (error) {
|
|
86
|
-
reject(error);
|
|
72
|
+
const environments = JSON.parse(data.toString()).environments;
|
|
73
|
+
if (!Object.keys(environments).includes(chosenEnvironment)) {
|
|
74
|
+
return reject(new Error("Invalid environment"));
|
|
87
75
|
}
|
|
76
|
+
const environmentData = environments[chosenEnvironment];
|
|
77
|
+
const environmentPath = environmentData.production
|
|
78
|
+
? StelliaClient.convertFilePathToProduction(environmentData.file)
|
|
79
|
+
: environmentData.file;
|
|
80
|
+
const environmentAbsolutePath = pathToFileURL(path.join(srcPath, "..", environmentPath)).href;
|
|
81
|
+
import(environmentAbsolutePath)
|
|
82
|
+
.then((environmentFile) => resolve(environmentFile.environment))
|
|
83
|
+
.catch(() => reject(new Error("Error parsing stellia.json file")));
|
|
88
84
|
});
|
|
89
85
|
});
|
|
90
86
|
};
|
|
@@ -9,13 +9,13 @@ export declare class StelliaUtils {
|
|
|
9
9
|
initializeCommands: () => Promise<void>;
|
|
10
10
|
getGuildConfiguration: <CustomGuildConfiguration extends GuildConfiguration>(guildId: string) => CustomGuildConfiguration | undefined;
|
|
11
11
|
handleInteraction: (interaction: Interaction<"cached">) => Promise<void>;
|
|
12
|
-
private handleAutoCompleteInteraction;
|
|
13
|
-
private handleButtonInteraction;
|
|
14
|
-
private handleCommandInteraction;
|
|
15
|
-
private handleContextMenuInteraction;
|
|
16
|
-
private handleModalInteraction;
|
|
17
|
-
private handleSelectMenuInteraction;
|
|
18
|
-
private handleMessageContextMenuInteraction;
|
|
19
|
-
private handleUserContextMenuInteraction;
|
|
12
|
+
private readonly handleAutoCompleteInteraction;
|
|
13
|
+
private readonly handleButtonInteraction;
|
|
14
|
+
private readonly handleCommandInteraction;
|
|
15
|
+
private readonly handleContextMenuInteraction;
|
|
16
|
+
private readonly handleModalInteraction;
|
|
17
|
+
private readonly handleSelectMenuInteraction;
|
|
18
|
+
private readonly handleMessageContextMenuInteraction;
|
|
19
|
+
private readonly handleUserContextMenuInteraction;
|
|
20
20
|
private getInteractionType;
|
|
21
21
|
}
|
|
@@ -6,7 +6,7 @@ export declare class AutoCompleteManager extends BaseManager {
|
|
|
6
6
|
private interactions;
|
|
7
7
|
constructor(client: StelliaClient, directory: string);
|
|
8
8
|
loadData(): Promise<void>;
|
|
9
|
-
getByCustomId<AutoCompleteStructure>(id: InteractionCustomId): AutoCompleteStructure |
|
|
10
|
-
getByRegex<AutoCompleteStructure>(id: InteractionCustomId): AutoCompleteStructure |
|
|
9
|
+
getByCustomId<AutoCompleteStructure>(id: InteractionCustomId): AutoCompleteStructure | null;
|
|
10
|
+
getByRegex<AutoCompleteStructure>(id: InteractionCustomId): AutoCompleteStructure | null;
|
|
11
11
|
getAll<AutoCompleteStructure>(): Collection<StructureCustomId, AutoCompleteStructure>;
|
|
12
12
|
}
|
|
@@ -12,11 +12,18 @@ export class AutoCompleteManager extends BaseManager {
|
|
|
12
12
|
this.setManagerLoaded();
|
|
13
13
|
}
|
|
14
14
|
getByCustomId(id) {
|
|
15
|
-
const autoComplete = this.interactions.get(id) ??
|
|
15
|
+
const autoComplete = this.interactions.get(id) ?? null;
|
|
16
16
|
return autoComplete;
|
|
17
17
|
}
|
|
18
18
|
getByRegex(id) {
|
|
19
|
-
|
|
19
|
+
let autoComplete = null;
|
|
20
|
+
for (const [customId, action] of this.interactions.entries()) {
|
|
21
|
+
if (customId instanceof RegExp && customId.test(id)) {
|
|
22
|
+
autoComplete = action;
|
|
23
|
+
break;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return autoComplete;
|
|
20
27
|
}
|
|
21
28
|
getAll() {
|
|
22
29
|
const autoCompletes = this.interactions;
|
|
@@ -12,8 +12,8 @@ export declare abstract class BaseManager {
|
|
|
12
12
|
constructor(client: StelliaClient, directory: string);
|
|
13
13
|
isManagerLoaded(): boolean;
|
|
14
14
|
setManagerLoaded(): void;
|
|
15
|
-
abstract loadData(): void
|
|
16
|
-
abstract getByCustomId<InteractionStructure extends AnyInteractionStructure>(id: InteractionCustomId): InteractionStructure |
|
|
17
|
-
abstract getByRegex<InteractionStructure extends AnyInteractionStructure>(id: InteractionCustomId): InteractionStructure |
|
|
15
|
+
abstract loadData(): Promise<void>;
|
|
16
|
+
abstract getByCustomId<InteractionStructure extends AnyInteractionStructure>(id: InteractionCustomId): InteractionStructure | null;
|
|
17
|
+
abstract getByRegex<InteractionStructure extends AnyInteractionStructure>(id: InteractionCustomId): InteractionStructure | null;
|
|
18
18
|
abstract getAll<InteractionStructure extends AnyInteractionStructure>(): Collection<StructureCustomId, InteractionStructure>;
|
|
19
19
|
}
|
|
@@ -7,7 +7,7 @@ export declare class ButtonManager extends BaseManager {
|
|
|
7
7
|
interactions: Collection<StructureCustomId, ButtonStructure>;
|
|
8
8
|
constructor(client: StelliaClient, directory: string);
|
|
9
9
|
loadData(): Promise<void>;
|
|
10
|
-
getByCustomId<ButtonStructure>(id: InteractionCustomId): ButtonStructure |
|
|
11
|
-
getByRegex<ButtonStructure>(id: InteractionCustomId): ButtonStructure |
|
|
10
|
+
getByCustomId<ButtonStructure>(id: InteractionCustomId): ButtonStructure | null;
|
|
11
|
+
getByRegex<ButtonStructure>(id: InteractionCustomId): ButtonStructure | null;
|
|
12
12
|
getAll<ButtonStructure>(): Collection<StructureCustomId, ButtonStructure>;
|
|
13
13
|
}
|
|
@@ -12,11 +12,11 @@ export class ButtonManager extends BaseManager {
|
|
|
12
12
|
this.setManagerLoaded();
|
|
13
13
|
}
|
|
14
14
|
getByCustomId(id) {
|
|
15
|
-
const button = this.interactions.get(id) ??
|
|
15
|
+
const button = this.interactions.get(id) ?? null;
|
|
16
16
|
return button;
|
|
17
17
|
}
|
|
18
18
|
getByRegex(id) {
|
|
19
|
-
let button;
|
|
19
|
+
let button = null;
|
|
20
20
|
for (const [customId, action] of this.interactions.entries()) {
|
|
21
21
|
if (customId instanceof RegExp && customId.test(id)) {
|
|
22
22
|
button = action;
|
|
@@ -6,7 +6,7 @@ export declare class CommandManager extends BaseManager {
|
|
|
6
6
|
private interactions;
|
|
7
7
|
constructor(client: StelliaClient, directory: string);
|
|
8
8
|
loadData(): Promise<void>;
|
|
9
|
-
getByCustomId<CommandStructure>(id: InteractionCustomId): CommandStructure |
|
|
10
|
-
getByRegex<CommandStructure>(id: InteractionCustomId): CommandStructure |
|
|
9
|
+
getByCustomId<CommandStructure>(id: InteractionCustomId): CommandStructure | null;
|
|
10
|
+
getByRegex<CommandStructure>(id: InteractionCustomId): CommandStructure | null;
|
|
11
11
|
getAll<CommandStructure>(): Collection<StructureCustomId, CommandStructure>;
|
|
12
12
|
}
|
|
@@ -12,11 +12,18 @@ export class CommandManager extends BaseManager {
|
|
|
12
12
|
this.setManagerLoaded();
|
|
13
13
|
}
|
|
14
14
|
getByCustomId(id) {
|
|
15
|
-
const command = this.interactions.get(id) ??
|
|
15
|
+
const command = this.interactions.get(id) ?? null;
|
|
16
16
|
return command;
|
|
17
17
|
}
|
|
18
18
|
getByRegex(id) {
|
|
19
|
-
|
|
19
|
+
let command = null;
|
|
20
|
+
for (const [customId, action] of this.interactions.entries()) {
|
|
21
|
+
if (customId instanceof RegExp && customId.test(id)) {
|
|
22
|
+
command = action;
|
|
23
|
+
break;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return command;
|
|
20
27
|
}
|
|
21
28
|
getAll() {
|
|
22
29
|
const commands = this.interactions;
|
|
@@ -6,7 +6,7 @@ export declare class ContextMenuManager extends BaseManager {
|
|
|
6
6
|
private interactions;
|
|
7
7
|
constructor(client: StelliaClient, directory: string);
|
|
8
8
|
loadData(): Promise<void>;
|
|
9
|
-
getByCustomId<ContextMenuStructure>(id: InteractionCustomId): ContextMenuStructure |
|
|
10
|
-
getByRegex<ContextMenuStructure>(id: InteractionCustomId): ContextMenuStructure |
|
|
9
|
+
getByCustomId<ContextMenuStructure>(id: InteractionCustomId): ContextMenuStructure | null;
|
|
10
|
+
getByRegex<ContextMenuStructure>(id: InteractionCustomId): ContextMenuStructure | null;
|
|
11
11
|
getAll<ContextMenuStructure>(): Collection<StructureCustomId, ContextMenuStructure>;
|
|
12
12
|
}
|
|
@@ -12,11 +12,18 @@ export class ContextMenuManager extends BaseManager {
|
|
|
12
12
|
this.setManagerLoaded();
|
|
13
13
|
}
|
|
14
14
|
getByCustomId(id) {
|
|
15
|
-
const contextMenu = this.interactions.get(id) ??
|
|
15
|
+
const contextMenu = this.interactions.get(id) ?? null;
|
|
16
16
|
return contextMenu;
|
|
17
17
|
}
|
|
18
18
|
getByRegex(id) {
|
|
19
|
-
|
|
19
|
+
let contextMenu = null;
|
|
20
|
+
for (const [customId, action] of this.interactions.entries()) {
|
|
21
|
+
if (customId instanceof RegExp && customId.test(id)) {
|
|
22
|
+
contextMenu = action;
|
|
23
|
+
break;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return contextMenu;
|
|
20
27
|
}
|
|
21
28
|
getAll() {
|
|
22
29
|
const contextMenus = this.interactions;
|
|
@@ -7,11 +7,11 @@ export declare class EventManager extends BaseManager {
|
|
|
7
7
|
private guildsConfiguration;
|
|
8
8
|
constructor(client: StelliaClient, directoryPath: string);
|
|
9
9
|
loadData(): Promise<void>;
|
|
10
|
-
getByCustomId<EventStructure>(id: InteractionCustomId): EventStructure |
|
|
11
|
-
getByRegex<EventStructure>(id: InteractionCustomId): EventStructure |
|
|
10
|
+
getByCustomId<EventStructure>(id: InteractionCustomId): EventStructure | null;
|
|
11
|
+
getByRegex<EventStructure>(id: InteractionCustomId): EventStructure | null;
|
|
12
12
|
getAll<EventStructure>(): Collection<StructureCustomId, EventStructure>;
|
|
13
13
|
private loadEventWithGuildConfiguration;
|
|
14
|
-
private eventHandler;
|
|
14
|
+
private readonly eventHandler;
|
|
15
15
|
private loadEventWithoutGuildConfiguration;
|
|
16
16
|
private getGuildConfiguration;
|
|
17
17
|
}
|
|
@@ -31,11 +31,18 @@ export class EventManager extends BaseManager {
|
|
|
31
31
|
this.setManagerLoaded();
|
|
32
32
|
}
|
|
33
33
|
getByCustomId(id) {
|
|
34
|
-
const event = this.interactions.get(id) ??
|
|
34
|
+
const event = this.interactions.get(id) ?? null;
|
|
35
35
|
return event;
|
|
36
36
|
}
|
|
37
37
|
getByRegex(id) {
|
|
38
|
-
|
|
38
|
+
let event = null;
|
|
39
|
+
for (const [customId, action] of this.interactions.entries()) {
|
|
40
|
+
if (customId instanceof RegExp && customId.test(id)) {
|
|
41
|
+
event = action;
|
|
42
|
+
break;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return event;
|
|
39
46
|
}
|
|
40
47
|
getAll() {
|
|
41
48
|
const events = this.interactions;
|
|
@@ -6,7 +6,7 @@ export declare class ModalManager extends BaseManager {
|
|
|
6
6
|
private interactions;
|
|
7
7
|
constructor(client: StelliaClient, directory: string);
|
|
8
8
|
loadData(): Promise<void>;
|
|
9
|
-
getByCustomId<ModalStructure>(id: InteractionCustomId): ModalStructure |
|
|
10
|
-
getByRegex<ModalStructure>(id: InteractionCustomId): ModalStructure |
|
|
9
|
+
getByCustomId<ModalStructure>(id: InteractionCustomId): ModalStructure | null;
|
|
10
|
+
getByRegex<ModalStructure>(id: InteractionCustomId): ModalStructure | null;
|
|
11
11
|
getAll<ModalStructure>(): Collection<StructureCustomId, ModalStructure>;
|
|
12
12
|
}
|
|
@@ -12,11 +12,11 @@ export class ModalManager extends BaseManager {
|
|
|
12
12
|
this.setManagerLoaded();
|
|
13
13
|
}
|
|
14
14
|
getByCustomId(id) {
|
|
15
|
-
const modal = this.interactions.get(id) ??
|
|
15
|
+
const modal = this.interactions.get(id) ?? null;
|
|
16
16
|
return modal;
|
|
17
17
|
}
|
|
18
18
|
getByRegex(id) {
|
|
19
|
-
let modal;
|
|
19
|
+
let modal = null;
|
|
20
20
|
for (const [customId, action] of this.interactions.entries()) {
|
|
21
21
|
if (customId instanceof RegExp && customId.test(id)) {
|
|
22
22
|
modal = action;
|
|
@@ -6,7 +6,7 @@ export declare class SelectMenuManager extends BaseManager {
|
|
|
6
6
|
private interactions;
|
|
7
7
|
constructor(client: StelliaClient, directory: string);
|
|
8
8
|
loadData(): Promise<void>;
|
|
9
|
-
getByCustomId<SelectMenuStructure>(id: InteractionCustomId): SelectMenuStructure |
|
|
10
|
-
getByRegex<SelectMenuStructure>(id: InteractionCustomId): SelectMenuStructure |
|
|
9
|
+
getByCustomId<SelectMenuStructure>(id: InteractionCustomId): SelectMenuStructure | null;
|
|
10
|
+
getByRegex<SelectMenuStructure>(id: InteractionCustomId): SelectMenuStructure | null;
|
|
11
11
|
getAll<SelectMenuStructure>(): Collection<StructureCustomId, SelectMenuStructure>;
|
|
12
12
|
}
|
|
@@ -12,18 +12,18 @@ export class SelectMenuManager extends BaseManager {
|
|
|
12
12
|
this.setManagerLoaded();
|
|
13
13
|
}
|
|
14
14
|
getByCustomId(id) {
|
|
15
|
-
const selectMenu = this.interactions.get(id) ??
|
|
15
|
+
const selectMenu = this.interactions.get(id) ?? null;
|
|
16
16
|
return selectMenu;
|
|
17
17
|
}
|
|
18
18
|
getByRegex(id) {
|
|
19
|
-
let
|
|
19
|
+
let selectMenu = null;
|
|
20
20
|
for (const [customId, action] of this.interactions.entries()) {
|
|
21
21
|
if (customId instanceof RegExp && customId.test(id)) {
|
|
22
|
-
|
|
22
|
+
selectMenu = action;
|
|
23
23
|
break;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
return
|
|
26
|
+
return selectMenu;
|
|
27
27
|
}
|
|
28
28
|
getAll() {
|
|
29
29
|
const selectMenus = this.interactions;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const formatTimestampToShortDateTime: (timestamp: number) => string;
|
|
2
|
+
export declare const formatTimestampToShortTime: (timestamp: number) => string;
|
|
3
|
+
export declare const formatTimestampToShortDate: (timestamp: number) => string;
|
|
4
|
+
export declare const formatTimestampToLongDateTime: (timestamp: number) => string;
|
|
5
|
+
export declare const formatTimestampToLongTime: (timestamp: number) => string;
|
|
6
|
+
export declare const formatTimestampToLongDate: (timestamp: number) => string;
|
|
7
|
+
export declare const formatTimestampToRelativeTime: (timestamp: number) => string;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { time, TimestampStyles } from "discord.js";
|
|
2
|
+
export const formatTimestampToShortDateTime = (timestamp) => {
|
|
3
|
+
return time(Math.round(timestamp / 1000), TimestampStyles.ShortDateTime);
|
|
4
|
+
};
|
|
5
|
+
export const formatTimestampToShortTime = (timestamp) => {
|
|
6
|
+
return time(Math.round(timestamp / 1000), TimestampStyles.ShortTime);
|
|
7
|
+
};
|
|
8
|
+
export const formatTimestampToShortDate = (timestamp) => {
|
|
9
|
+
return time(Math.round(timestamp / 1000), TimestampStyles.ShortDate);
|
|
10
|
+
};
|
|
11
|
+
export const formatTimestampToLongDateTime = (timestamp) => {
|
|
12
|
+
return time(Math.round(timestamp / 1000), TimestampStyles.LongDateTime);
|
|
13
|
+
};
|
|
14
|
+
export const formatTimestampToLongTime = (timestamp) => {
|
|
15
|
+
return time(Math.round(timestamp / 1000), TimestampStyles.LongTime);
|
|
16
|
+
};
|
|
17
|
+
export const formatTimestampToLongDate = (timestamp) => {
|
|
18
|
+
return time(Math.round(timestamp / 1000), TimestampStyles.LongDate);
|
|
19
|
+
};
|
|
20
|
+
export const formatTimestampToRelativeTime = (timestamp) => {
|
|
21
|
+
return time(Math.round(timestamp / 1000), TimestampStyles.RelativeTime);
|
|
22
|
+
};
|
package/dist/utils/files.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { readdirSync, statSync } from "fs";
|
|
2
|
-
import path from "path";
|
|
1
|
+
import { readdirSync, statSync } from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
3
|
import { Collection } from "discord.js";
|
|
4
4
|
export const requiredFiles = async (directoryPath) => {
|
|
5
5
|
const collection = new Collection();
|
|
@@ -12,18 +12,13 @@ export const requiredFiles = async (directoryPath) => {
|
|
|
12
12
|
return collection;
|
|
13
13
|
};
|
|
14
14
|
const loadInteraction = async (filePath) => {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
return data;
|
|
19
|
-
}
|
|
20
|
-
catch (error) {
|
|
21
|
-
throw error;
|
|
22
|
-
}
|
|
15
|
+
const module = await import(`file://${filePath}`);
|
|
16
|
+
const data = module.default;
|
|
17
|
+
return data;
|
|
23
18
|
};
|
|
24
19
|
const getAllFilesPath = (dirPath, arrayOfFiles = []) => {
|
|
25
20
|
const files = readdirSync(dirPath);
|
|
26
|
-
|
|
21
|
+
for (const file of files) {
|
|
27
22
|
if (statSync(dirPath + "/" + file).isDirectory()) {
|
|
28
23
|
arrayOfFiles = getAllFilesPath(dirPath + "/" + file, arrayOfFiles);
|
|
29
24
|
}
|
|
@@ -31,6 +26,6 @@ const getAllFilesPath = (dirPath, arrayOfFiles = []) => {
|
|
|
31
26
|
const __dirname = path.resolve();
|
|
32
27
|
arrayOfFiles.push(path.join(__dirname, dirPath, "/", file));
|
|
33
28
|
}
|
|
34
|
-
}
|
|
29
|
+
}
|
|
35
30
|
return arrayOfFiles;
|
|
36
31
|
};
|
package/dist/utils/index.d.ts
CHANGED
package/dist/utils/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stelliajs/framework",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.4",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"scripts": {
|
|
@@ -23,20 +23,19 @@
|
|
|
23
23
|
"framework"
|
|
24
24
|
],
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"discord.js": "^14.
|
|
27
|
-
"i18next": "^25.
|
|
26
|
+
"discord.js": "^14.22.1",
|
|
27
|
+
"i18next": "^25.5.2",
|
|
28
28
|
"log-symbols": "^7.0.1"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
"typescript-eslint": "^8.39.0"
|
|
31
|
+
"@eslint/js": "^9.36.0",
|
|
32
|
+
"eslint-config-prettier": "^10.1.8",
|
|
33
|
+
"eslint-import-resolver-typescript": "^4.4.4",
|
|
34
|
+
"eslint-plugin-import": "^2.32.0",
|
|
35
|
+
"prettier": "^3.6.2",
|
|
36
|
+
"tsc-alias": "^1.8.16",
|
|
37
|
+
"typescript-eslint": "^8.44.1"
|
|
39
38
|
},
|
|
40
39
|
"type": "module",
|
|
41
|
-
"packageManager": "pnpm@10.
|
|
40
|
+
"packageManager": "pnpm@10.17.1"
|
|
42
41
|
}
|