Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
"djs-core": "index.js"
},
"repository": {
"url": "https://github.com/Cleboost/djs-core"
"url": "https://github.com/djs-core/djs-core"
},
"bugs": {
"url": "https://github/com/Cleboost/djs-core/issues"
"url": "https://github.com/djs-core/djs-core/issues"
},
"scripts": {
"dev": "tsup --config tsup-dev.config.ts",
Expand Down
12 changes: 3 additions & 9 deletions src/class/BotClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,21 +163,15 @@ export default class BotClient extends Client {
console.log(subCommandList);
process.exit(1);
});
this.logger.success("Bot is ready");
this.logger.success("Bot is logged as " + this.user?.username);
});

process.on("unhandledRejection", (reason: unknown) => {
const errorRegex =
/DiscordAPIError\[\d+\]: Invalid Form Body\s+data\.components\[\d+\]\.components\[\d+\]\.style\[BASE_TYPE_REQUIRED\]: This field is required/;
if (errorRegex.test(reason as string)) {
return this.logger.error("A component is missing style");
}
this.logger.error(`Unhandled Rejection: ${reason}`);
return this.logger.error(`Unhandled Rejection: ${reason}`);
});

process.on("uncaughtException", (error: Error) => {
this.logger.error(`Uncaught Exception: ${error.message}`);
// Vous pouvez également notifier un canal Discord ou un administrateur ici
return this.logger.error(`Uncaught Exception: ${error.message}`);
});
}
}