xernerx 3.2.0 → 3.2.2
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.
|
@@ -118,7 +118,7 @@ function inCooldown(user, client, command, action) {
|
|
|
118
118
|
}, client.handlerOptions.context.cooldown);
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
|
-
if (client.settings
|
|
121
|
+
if (client.settings?.cooldown?.default) {
|
|
122
122
|
if (cooldowns.has(user.id)) {
|
|
123
123
|
const usr = cooldowns.get(user.id);
|
|
124
124
|
usr.timeRemaining = usr.endsAt - Date.now();
|
|
@@ -7,8 +7,21 @@ export default class Extensions {
|
|
|
7
7
|
async load(extensions, logging = false) {
|
|
8
8
|
const exts = [];
|
|
9
9
|
extensions.map(extension => {
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
try {
|
|
11
|
+
try {
|
|
12
|
+
this.client.extensions[extension.name] = new extension(this.client, logging);
|
|
13
|
+
}
|
|
14
|
+
catch {
|
|
15
|
+
extension = extension.default;
|
|
16
|
+
this.client.extensions[extension.name] = new extension(this.client, logging);
|
|
17
|
+
}
|
|
18
|
+
finally {
|
|
19
|
+
exts.push(extension?.name || extension?.default?.name);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
catch (error) {
|
|
23
|
+
console.error(Style.log(`Xernerx | An error occurred loading the extension ${extension?.name || extension?.default?.name}, error:<${error}>`, { color: Style.BackgroundColor.Red }));
|
|
24
|
+
}
|
|
12
25
|
});
|
|
13
26
|
if (logging)
|
|
14
27
|
console.info(Style.log(`Xernerx | Loaded ${exts.length} extensions: ${exts.join(', ')}`, { color: Style.TextColor.Cyan }));
|