djs-builder 0.4.81 → 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,13 +2,14 @@ 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
|
+
|
|
12
13
|
const commandDetails: Array<{ name: string; usage: string | undefined; description: string | undefined; aliases: string[] | undefined; cooldown: number | undefined; developer: boolean | undefined; owner: boolean | undefined }> = [];
|
|
13
14
|
|
|
14
15
|
try {
|
|
@@ -63,7 +64,6 @@ export async function readCommands(client: any, prefix: { path: string }): Promi
|
|
|
63
64
|
owner: defaultCommand.owner,
|
|
64
65
|
});
|
|
65
66
|
|
|
66
|
-
logSuccess(`Loaded command: ${defaultCommand.name}`);
|
|
67
67
|
}
|
|
68
68
|
} catch (error: any) {
|
|
69
69
|
logError(`Error in file: ${filePath}`);
|
|
@@ -74,7 +74,6 @@ export async function readCommands(client: any, prefix: { path: string }): Promi
|
|
|
74
74
|
|
|
75
75
|
client.prefixCommands = commandDetails;
|
|
76
76
|
client.prefixSize = commandDetails.length;
|
|
77
|
-
logSuccess(`Successfully loaded ${commandDetails.length} commands.`);
|
|
78
77
|
} catch (error: any) {
|
|
79
78
|
logError(`Error reading directory: ${prefix.path}`);
|
|
80
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}`);
|