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