Conversation
Tooling and infrastructure: - Add ESLint 10 flat config (typescript-eslint strict + stylistic type-checked) - Add Prettier config and format the repo - Add GitHub Actions CI (install, lint, format check, typecheck, test, build) - Add Dependabot, .editorconfig, .nvmrc, MIT LICENSE, CONTRIBUTING.md - Tighten tsconfig (noUncheckedIndexedAccess, exactOptionalPropertyTypes, verbatimModuleSyntax) with a separate tsconfig.build.json for emit Bug fixes: - Command/event loader only matched .js, so dev mode (tsx) loaded zero commands; now accepts .ts and .js - Atomic settleBet transaction closes a race that could drive balances negative across concurrent casino games - Add message/reaction/user partials so reaction roles survive cache eviction - Register slash commands via application.commands.set(), fixing silently dropped fields (channelTypes, minValue) - Harden button handlers against malformed customId payloads Code quality: - Extract env-driven config (src/config.ts) with previous IDs as defaults - Extract shared logic into src/lib (bets, game outcomes, duration, message-link parsing); remove dead code and stringly-typed options - Graceful shutdown, unhandledRejection handler, proper error replies Tests and docs: - New test/lib.test.ts and expanded db tests (50 tests total) - README rewritten: accurate command list, env-var table, setup, CI badge
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
Full modernization pass to bring the repo up to current professional standards. Runtime behavior is preserved except where noted.
Tooling & infrastructure
.nvmrc, Yarn 4 via corepack).editorconfig,.nvmrc, MIT LICENSE,CONTRIBUTING.mdtsconfig(noUncheckedIndexedAccess,exactOptionalPropertyTypes,verbatimModuleSyntax), separatetsconfig.build.jsonfor emitBug fixes
yarn devvia tsx) loaded zero commands — the loader only matched.js; it now accepts.ts/.jssettleBettransaction re-checks fundschannelTypes,minValue) — now usesapplication.commands.set()customIdJSONCode quality
src/config.ts) — previous hard-coded server IDs kept as defaults so behavior is unchanged without a.envchangesrc/lib/(bet validation, game outcomes, duration formatting, message-link parsing); dead code removed; typed option getters replace stringly-typedargsunhandledRejectionhandler, correct error replies for deferred interactionsTests & docs
test/lib.test.tscovering game-outcome matrices and validation; expanded db tests including the negative-balance raceDeliberate behavior change (flagging for your review)
soon.tseaster egg's second branch (crude "CS major" reply) was removed as part of professionalization. The main "Soon:tm:" auto-reply is preserved (and its trigger matching was verified against master's behavior, including plurals). Easy to restore if you want it back.Verification
yarn lint,yarn format:check,yarn typecheck,yarn test(50/50),yarn build— all green