feat(client): discord.js client + structured READY logging - #2
Merged
Conversation
Adds the gateway connection plumbing: - src/env.ts validates DISCORD_TOKEN, LOG_LEVEL, CONFIG_PATH with zod - src/logger.ts exports a pino instance with ISO timestamps - src/client.ts builds the discord.js Client with the Guilds intent (reaction intents land alongside the reaction handlers in step 5) - src/events/ready.ts logs bot tag, guild list, and verification count - src/index.ts wires bootstrap + graceful SIGINT/SIGTERM shutdown Verified end-to-end against the live bot: ready event fired and logged "Yards Bot#6673" connected to FleetYardsNet. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
src/env.ts(zod-validatedDISCORD_TOKEN/LOG_LEVEL/CONFIG_PATH).src/logger.ts(pino, ISO timestamps, configurable level).src/client.ts— minimal discord.js Client with just theGuildsintent. Reaction intents (GuildMessageReactions) and the privilegedGuildMembersintent will be added in step 5 alongside the actual reaction handlers, so this step doesn't require any Developer Portal changes yet.src/events/ready.ts— logs bot tag, connected guilds, and verification count when the gateway fires READY.src/index.tswith graceful SIGINT/SIGTERM shutdown.Implements step 3 of
docs/exec-plans/v1.md.Test plan
pnpm test— adds 4 env tests on top of the 8 config tests (12 total)pnpm lint,pnpm typecheck,pnpm buildcleanTokenInvalidFollow-ups
GuildMessageReactions+GuildMembersintent + message/channel/reaction partials, and theServer Members Intenttoggle in the Developer Portal becomes required.🤖 Generated with Claude Code