mirror of
https://github.com/tiramisulabs/seyfert.git
synced 2025-07-02 21:16:09 +00:00
fix: types and props
This commit is contained in:
parent
f061dccf3f
commit
37dfaef407
@ -140,6 +140,7 @@ export async function onMessageCreate(
|
|||||||
{
|
{
|
||||||
failed: true,
|
failed: true,
|
||||||
value: x.error,
|
value: x.error,
|
||||||
|
parseError: x.fullError,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
}),
|
}),
|
||||||
|
@ -174,6 +174,7 @@ export class BaseCommand {
|
|||||||
data[i.name] = {
|
data[i.name] = {
|
||||||
failed: true,
|
failed: true,
|
||||||
value: `${i.name} is required but returned no value`,
|
value: `${i.name} is required but returned no value`,
|
||||||
|
parseError: undefined,
|
||||||
};
|
};
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -189,6 +190,7 @@ export class BaseCommand {
|
|||||||
data[i.name] = {
|
data[i.name] = {
|
||||||
failed: true,
|
failed: true,
|
||||||
value: e instanceof Error ? e.message : typeof e === 'string' ? e : inspect(e),
|
value: e instanceof Error ? e.message : typeof e === 'string' ? e : inspect(e),
|
||||||
|
parseError: undefined,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -64,8 +64,8 @@ export type OnOptionsReturnObject = Record<
|
|||||||
| {
|
| {
|
||||||
failed: true;
|
failed: true;
|
||||||
value: string;
|
value: string;
|
||||||
parseError?: //only for text command
|
parseError: //only for text command
|
||||||
MessageCommandOptionErrors;
|
MessageCommandOptionErrors | undefined;
|
||||||
}
|
}
|
||||||
>;
|
>;
|
||||||
|
|
||||||
|
@ -200,18 +200,19 @@ export class CommandHandler extends BaseHandler {
|
|||||||
this.values.push(commandInstance);
|
this.values.push(commandInstance);
|
||||||
commandInstance.__filePath = command.path;
|
commandInstance.__filePath = command.path;
|
||||||
this.__parseCommandLocales(commandInstance);
|
this.__parseCommandLocales(commandInstance);
|
||||||
|
commandInstance.props ??= client.options.commands?.defaults?.props ?? {};
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (!(commandInstance instanceof Command)) {
|
if (!(commandInstance instanceof Command)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
commandInstance.onAfterRun ??= client.options?.commands?.defaults?.onAfterRun;
|
commandInstance.onAfterRun ??= client.options.commands?.defaults?.onAfterRun;
|
||||||
commandInstance.onBotPermissionsFail ??= client.options?.commands?.defaults?.onBotPermissionsFail;
|
commandInstance.onBotPermissionsFail ??= client.options.commands?.defaults?.onBotPermissionsFail;
|
||||||
commandInstance.onInternalError ??= client.options?.commands?.defaults?.onInternalError;
|
commandInstance.onInternalError ??= client.options.commands?.defaults?.onInternalError;
|
||||||
commandInstance.onMiddlewaresError ??= client.options?.commands?.defaults?.onMiddlewaresError;
|
commandInstance.onMiddlewaresError ??= client.options.commands?.defaults?.onMiddlewaresError;
|
||||||
commandInstance.onOptionsError ??= client.options?.commands?.defaults?.onOptionsError;
|
commandInstance.onOptionsError ??= client.options.commands?.defaults?.onOptionsError;
|
||||||
commandInstance.onPermissionsFail ??= client.options?.commands?.defaults?.onPermissionsFail;
|
commandInstance.onPermissionsFail ??= client.options.commands?.defaults?.onPermissionsFail;
|
||||||
commandInstance.onRunError ??= client.options?.commands?.defaults?.onRunError;
|
commandInstance.onRunError ??= client.options.commands?.defaults?.onRunError;
|
||||||
commandInstance.__filePath = command.path;
|
commandInstance.__filePath = command.path;
|
||||||
commandInstance.options ??= [] as NonNullable<Command['options']>;
|
commandInstance.options ??= [] as NonNullable<Command['options']>;
|
||||||
commandInstance.props ??= client.options.commands?.defaults?.props ?? {};
|
commandInstance.props ??= client.options.commands?.defaults?.props ?? {};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user