seyfert 3.2.5-dev-16255031273.0 → 3.2.5-dev-16476410534.0
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/lib/client/base.js
CHANGED
|
@@ -311,10 +311,14 @@ class BaseClient {
|
|
|
311
311
|
const seyfertConfig = (BaseClient._seyfertCfWorkerConfig ||
|
|
312
312
|
(await this.options?.getRC?.()) ||
|
|
313
313
|
(await Promise.any(['.js', '.mjs', '.cjs', '.ts', '.mts', '.cts'].map(ext => (0, common_1.magicImport)((0, node_path_1.join)(process.cwd(), `seyfert.config${ext}`)).then(x => x.default ?? x))).catch((e) => {
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
314
|
+
const errors = e.errors.map((err) => {
|
|
315
|
+
err.message = err.message.replace(/seyfert\.config\.(js|mjs|cjs|ts|mts|cts)/g, 'seyfert.config');
|
|
316
|
+
return err;
|
|
317
|
+
});
|
|
318
|
+
const uniqueError = errors.find(er => errors.filter(err => err.message === er.message).length === 1);
|
|
319
|
+
if (uniqueError)
|
|
320
|
+
throw uniqueError;
|
|
321
|
+
throw new Error('No seyfert.config file found');
|
|
318
322
|
})));
|
|
319
323
|
const { locations, debug, ...env } = seyfertConfig;
|
|
320
324
|
const locationsFullPaths = {
|
package/lib/commands/handler.js
CHANGED
|
@@ -282,7 +282,7 @@ class CommandHandler extends common_1.BaseHandler {
|
|
|
282
282
|
//@AutoLoad
|
|
283
283
|
const options = await this.getFiles((0, node_path_1.dirname)(file.path));
|
|
284
284
|
for (const option of options) {
|
|
285
|
-
if (file.
|
|
285
|
+
if (file.path === option) {
|
|
286
286
|
continue;
|
|
287
287
|
}
|
|
288
288
|
try {
|
|
@@ -20,7 +20,7 @@ export declare class OptionResolver {
|
|
|
20
20
|
readonly options: OptionResolved[];
|
|
21
21
|
hoistedOptions: OptionResolved[];
|
|
22
22
|
private subCommand;
|
|
23
|
-
private group
|
|
23
|
+
private group?;
|
|
24
24
|
constructor(client: UsingClient, options: APIApplicationCommandInteractionDataOption[], parent?: Command | undefined, guildId?: string | undefined, resolved?: ContextOptionsResolved | undefined);
|
|
25
25
|
get fullCommandName(): string;
|
|
26
26
|
getCommand(): Command | SubCommand | undefined;
|
|
@@ -28,7 +28,7 @@ export declare class OptionResolver {
|
|
|
28
28
|
getAutocomplete(): CommandAutocompleteOption | undefined;
|
|
29
29
|
getParent(): string | undefined;
|
|
30
30
|
getSubCommand(): string | null;
|
|
31
|
-
getGroup(): string |
|
|
31
|
+
getGroup(): string | undefined;
|
|
32
32
|
get(name: string): OptionResolved | undefined;
|
|
33
33
|
getHoisted(name: string): OptionResolved | undefined;
|
|
34
34
|
getValue(name: string): AllChannels | Attachment | boolean | number | string | UserStructure | GuildMemberStructure | InteractionGuildMemberStructure | GuildRoleStructure | undefined;
|
|
@@ -13,7 +13,7 @@ class OptionResolver {
|
|
|
13
13
|
options;
|
|
14
14
|
hoistedOptions;
|
|
15
15
|
subCommand = null;
|
|
16
|
-
group
|
|
16
|
+
group;
|
|
17
17
|
constructor(client, options, parent, guildId, resolved) {
|
|
18
18
|
this.client = client;
|
|
19
19
|
this.parent = parent;
|
|
@@ -35,7 +35,7 @@ class OptionResolver {
|
|
|
35
35
|
}
|
|
36
36
|
getCommand() {
|
|
37
37
|
if (this.subCommand) {
|
|
38
|
-
return this.parent?.options?.find(x =>
|
|
38
|
+
return this.parent?.options?.find(x => this.group === x.group && x.name === this.subCommand);
|
|
39
39
|
}
|
|
40
40
|
return this.parent;
|
|
41
41
|
}
|