Skip to content
Open
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
5 changes: 4 additions & 1 deletion src/bot.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,7 @@ const loadEvents = () => {

loadEvents();

client.login(process.env.DISCORD_TOKEN);
client.login(process.env.DISCORD_TOKEN).catch(err => {
console.error('Failed to login:', err);
process.exit(1);
Copy link

Copilot AI Apr 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using process.exit(1) can terminate the process immediately and potentially cut off pending I/O (including log flushing). Prefer setting process.exitCode = 1 and returning (or rethrowing) so Node can exit naturally after the error is logged.

Suggested change
process.exit(1);
process.exitCode = 1;

Copilot uses AI. Check for mistakes.
});
Comment on lines +53 to +56
Copy link

Copilot AI Apr 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR metadata/title says "Fixes #4" (unknown prefix command handling), but this change only adds error handling for client.login() (bounty board item #21.4). Please update the PR title/description and/or linked issue reference so it closes the correct issue and doesn't mislead reviewers.

Copilot uses AI. Check for mistakes.
Loading