added error reporting

This commit is contained in:
2026-09-13 20:53:22 +08:00
parent 145e0f7365
commit b7b26796bd
4 changed files with 51 additions and 17 deletions
+16
View File
@@ -8,6 +8,22 @@ class ReadyEvent extends Event<CommandClient> {
async handle(context: CommandClient<any, any>) {
await context.deployCommands();
context.setCustomActivity('Tracking your petting!');
context.on('error', async (error: string | Error, shard?: number | undefined) => {
const _err = error as Error;
await context.createMessage('1548676420136599624', {
embed: {
color: 0xff5555,
fields: [
{ name: 'Message', value: _err.message, inline: false },
{ name: 'Cause', value: `${_err.cause ?? 'N/A'}`, inline: false },
{ name: 'Stack', value: `${_err.stack ?? 'N/A'}`, inline: false }
]
}
});
})
}
}