djs-builder 0.4.82 → 0.4.83
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.
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { logSuccess, logError, logInfo } from '../functions/logger';
|
|
2
2
|
import { EventsOptions } from '../types/starter';
|
|
3
3
|
import { loadEvents } from './events';
|
|
4
|
-
import { botData } from './login';
|
|
5
4
|
export async function eventsLoader(client: any, eventsOptions: EventsOptions) {
|
|
6
5
|
|
|
7
6
|
client.eventSize = 0;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { logSuccess, logError
|
|
1
|
+
import { logSuccess, logError } from '../functions/logger';
|
|
2
2
|
import { readdir, stat } from 'fs/promises';
|
|
3
3
|
import { resolve, join, extname } from 'path';
|
|
4
4
|
import { EventsOptions, Event } from '../types/utils';
|
|
@@ -2,27 +2,13 @@ import { Collection } from 'discord.js';
|
|
|
2
2
|
import { promises as fsPromises } from 'fs';
|
|
3
3
|
import { join, resolve } from 'path';
|
|
4
4
|
import { Command } from '../types/utils';
|
|
5
|
-
import { logSuccess, logError,
|
|
5
|
+
import { logSuccess, logError, logWarning } from '../functions/logger';
|
|
6
6
|
|
|
7
7
|
export const commands = new Collection<string, Command>();
|
|
8
8
|
export const aliases = new Collection<string, string>();
|
|
9
9
|
export const commandNames = new Set<string>();
|
|
10
10
|
|
|
11
11
|
export async function readCommands(client: any, prefix: { path: string }): Promise<void> {
|
|
12
|
-
|
|
13
|
-
console.log('Before clearing:');
|
|
14
|
-
console.log('Commands:', commands.size);
|
|
15
|
-
console.log('Aliases:', aliases.size);
|
|
16
|
-
console.log('Command names:', commandNames.size);
|
|
17
|
-
|
|
18
|
-
commands.clear();
|
|
19
|
-
aliases.clear();
|
|
20
|
-
commandNames.clear();
|
|
21
|
-
|
|
22
|
-
console.log('After clearing:');
|
|
23
|
-
console.log('Commands:', commands.size);
|
|
24
|
-
console.log('Aliases:', aliases.size);
|
|
25
|
-
console.log('Command names:', commandNames.size);
|
|
26
12
|
|
|
27
13
|
const commandDetails: Array<{ name: string; usage: string | undefined; description: string | undefined; aliases: string[] | undefined; cooldown: number | undefined; developer: boolean | undefined; owner: boolean | undefined }> = [];
|
|
28
14
|
|
|
@@ -78,7 +64,6 @@ console.log('Command names:', commandNames.size);
|
|
|
78
64
|
owner: defaultCommand.owner,
|
|
79
65
|
});
|
|
80
66
|
|
|
81
|
-
logSuccess(`Loaded command: ${defaultCommand.name}`);
|
|
82
67
|
}
|
|
83
68
|
} catch (error: any) {
|
|
84
69
|
logError(`Error in file: ${filePath}`);
|
|
@@ -89,7 +74,6 @@ console.log('Command names:', commandNames.size);
|
|
|
89
74
|
|
|
90
75
|
client.prefixCommands = commandDetails;
|
|
91
76
|
client.prefixSize = commandDetails.length;
|
|
92
|
-
logSuccess(`Successfully loaded ${commandDetails.length} commands.`);
|
|
93
77
|
} catch (error: any) {
|
|
94
78
|
logError(`Error reading directory: ${prefix.path}`);
|
|
95
79
|
logError(error.message);
|
|
@@ -4,11 +4,20 @@ import { botData } from './login';
|
|
|
4
4
|
|
|
5
5
|
export async function prefixLoader(client: any): Promise<boolean> {
|
|
6
6
|
const currentCommandNames = new Set(commands.keys());
|
|
7
|
+
console.log('Before clearing:');
|
|
8
|
+
console.log('Commands size:', commands.size);
|
|
9
|
+
console.log('Aliases size:', aliases.size);
|
|
10
|
+
console.log('Command names size:', commandNames.size);
|
|
11
|
+
|
|
7
12
|
|
|
8
13
|
commands.clear();
|
|
9
14
|
aliases.clear();
|
|
10
15
|
commandNames.clear();
|
|
11
16
|
|
|
17
|
+
console.log('After clearing:');
|
|
18
|
+
console.log('Commands size:', commands.size);
|
|
19
|
+
console.log('Aliases size:', aliases.size);
|
|
20
|
+
console.log('Command names size:', commandNames.size);
|
|
12
21
|
const prefixPath = botData.get('prefixPath') as string;
|
|
13
22
|
|
|
14
23
|
logInfo(`Reloading prefix commands from ${prefixPath}`);
|