Repository navigation
V3 - Tidy up and rewrite #729
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
77 commits
Select commit
Hold shift + click to select a range
888ba83
Normalise formatting to 2-space indentation
BrentOates 8d8b0ee
Add tests, typed lint, strictNullChecks and env validation
BrentOates 908ffaf
Add command/event framework, loader and dispatcher; port commands and…
BrentOates 3b7b95d
Add framework, dispatcher and loader tests
BrentOates 27189f0
Add audit, member, birthday, scheduler and retention services
BrentOates 1405404
Fix post-merge audit return type and ignore .claude in lint
BrentOates ea486f7
Add umzug migrations: baseline, UserProfile unique index, access trac…
BrentOates 402a0cb
Add transactional guild purge, trim services, drop underscore
BrentOates 88b9f42
Rework moderation commands and message events
BrentOates 594a27c
Add BirthdayService and DataCheckService, rework birthday commands, p…
BrentOates 9847a00
Add OnboardingService and WelcomeImage; rework welcome, newroles, deb…
BrentOates 7a28666
Improve /about output
BrentOates c876fcf
Remove legacy files; move domain services to src/services and Command…
BrentOates 3a987a8
Normalise wording and style, fix about embed, drop redundant @types/v…
BrentOates 04b7689
Rewrite README for v3
BrentOates 9a00cfb
Replace Sequelize schema and umzug with Drizzle schema and a sync SQL…
BrentOates 24d7263
Update tests, service seam and README for Drizzle; prune stale overrides
BrentOates ab9c918
Switch to ESM and native TypeScript execution; static registry; croner
BrentOates cc070b0
Run node directly in Docker and gate publish on tests
BrentOates b4f9d70
Rename NovaClient to DingirClient and reorganise commands and db dire…
BrentOates 0cc6f43
Introduce App composition root and pass dependencies explicitly
BrentOates 9bc7be7
Add UserError and throw it for command validation failures
BrentOates bd2136e
Consolidate test fakes into typed factories
BrentOates 2d80583
Defer command replies before loading server config
BrentOates c7fa062
Cache server configs per app and invalidate on writes
BrentOates dd2e7ad
Register slash commands only when their hash changes and add a deploy…
BrentOates 6565550
Install process-level crash and signal handlers with bounded shutdown
BrentOates f1ad314
Replace console logger with pino structured logging and add LOG_LEVEL
BrentOates dbd18ae
Enable strict TypeScript options and disallow explicit any
BrentOates 9ae0697
Add coverage thresholds and run them in CI
BrentOates e99794c
Upgrade to TypeScript 7
BrentOates ccc4f7d
Replace ESLint with oxlint (type-aware via oxlint-tsgolint)
BrentOates 6f71571
Add oxfmt config and format/check scripts
BrentOates e2c8d46
Format with oxfmt
BrentOates 6c6dcd9
Update dependency overrides for audit
BrentOates 433cd53
Run format, lint, typecheck and coverage in CI; update README tooling…
BrentOates e45d2a3
Refresh README for the v3 toolchain
BrentOates 7fefd8d
Disable install scripts so native deps use prebuilt binaries
BrentOates d7e278e
Draw a thin avatar ring with a translucent backdrop on welcome cards
BrentOates 6436af6
Skip onboarding for bots while still auditing their join
BrentOates cff4834
Only report birthday cleared when one was actually set
BrentOates 1d3fc37
Force-fetch partial cached members and show unknown join time
BrentOates 1a5fd2d
Avoid a duplicate audit when onboarding immediately on join
BrentOates e26ba60
Fix README boolean setting tables to match the real subcommands
BrentOates 155d371
Restore CI job name required by branch protection
BrentOates c117cbc
Validate and bound welcome message length after {member} expansion
BrentOates 5442f25
Onboard members completing screening when the old state is unknown
BrentOates e4406f8
Scope the command registration hash by application id
BrentOates b7bb39d
Backfill NULL activity scores and drop unusable UserProfiles rows
BrentOates 07d880a
Correct README and add 2.x upgrade notes
BrentOates 8a2d9a6
Persist onboarding completion and gate unknown-state onboarding on it
BrentOates 624ebe8
Create the new birthday calendar before removing the old one
BrentOates 37028bc
Defer routes that call Discord before replying
BrentOates 77f669d
Clear stale commands when the registration scope changes
BrentOates f22f275
Snapshot profiles before fetching members in the data check
BrentOates 01e6d44
Document onboarding tracking, scope cleanup and calendar recreation
BrentOates fcdf9e1
Add screeningPendingAt column and service functions
BrentOates 8660f34
Require recorded pending state before onboarding from unknown member …
BrentOates 27639d1
Document recorded screening state for onboarding
BrentOates 676d317
Only remove the old birthday calendar once the new one is populated
BrentOates 8c8fa2f
Keep the calendar path when deleting the message fails
BrentOates b5eda77
Stop the data check recreating purged server configs
BrentOates 210f9ae
Update supported versions in SECURITY.md
BrentOates 2949364
Validate JOB_SCHEDULE by parsing it with croner
BrentOates d06e501
Require Read Message History to create the birthday calendar
BrentOates 38572ad
Treat a member join as a new screening cycle
BrentOates 466ddf0
Specify and consolidate onboarding state handling
BrentOates 20e3bc9
Specify birthday calendar lifecycle and harden its failure handling
BrentOates adecc28
Specify command registration and make scope switching robust
BrentOates 525c1e8
Specify data retention and close its races
BrentOates 639645a
Keep welcome previews within Discord's message limit
BrentOates 95237e4
Report member-list gateway rate limits to the admin
BrentOates 2036557
Cap the welcome image download while reading it
BrentOates 59d7834
Split large birthday announcements across messages
BrentOates cee635a
Fix README upgrade notes and examples
BrentOates 0b04df2
Fix welcome preview truncation edge cases
BrentOates 5ca9732
Correct unchanged command list in upgrade notes
BrentOates File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,10 @@ | ||
| node_modules | ||
| npm-debug.log | ||
| dist | ||
| data | ||
| tests | ||
| coverage | ||
| .env | ||
| .git | ||
| .github | ||
| docs | ||
| .claude | ||
| docs |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| root = true | ||
|
|
||
| [*] | ||
| charset = utf-8 | ||
| end_of_line = lf | ||
| indent_style = space | ||
| indent_size = 2 | ||
| insert_final_newline = true | ||
| trim_trailing_whitespace = true |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,23 @@ | ||
| # Required: bot token and application (client) ID from the Discord developer portal | ||
| TOKEN= | ||
| CLIENT_ID= | ||
| JOB_SCHEDULE=0 9 * * * | ||
|
|
||
| # Cron schedule (5 or 6 fields) for cleanup, birthday notifications and calendars | ||
| JOB_SCHEDULE=0 9 * * * | ||
|
|
||
| # IANA time zone used for scheduling and birthday calculations | ||
| BOT_TIMEZONE=Europe/London | ||
|
|
||
| # SQLite database file (directory is created if missing); use :memory: for throwaway runs | ||
| DB_PATH=data/dingir.sqlite | ||
|
|
||
| # Data for unreachable guilds is only purged after at least this many failed checks... | ||
| PURGE_MIN_FAILURES=3 | ||
| # ...spanning at least this many days | ||
| PURGE_GRACE_DAYS=7 | ||
|
|
||
| # Log verbosity: fatal, error, warn, info, debug or trace | ||
| LOG_LEVEL=info | ||
|
|
||
| # Optional: register slash commands to this guild only (instant updates during development) | ||
| # DEV_GUILD_ID= |
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,2 @@ | ||
| registry=https://registry.npmjs.org/ | ||
| registry=https://registry.npmjs.org/ | ||
| ignore-scripts=true | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| { | ||
| "$schema": "./node_modules/oxfmt/configuration_schema.json", | ||
| "printWidth": 100, | ||
| "tabWidth": 2, | ||
| "useTabs": false, | ||
| "semi": true, | ||
| "singleQuote": true, | ||
| "trailingComma": "all", | ||
| "endOfLine": "lf", | ||
| "ignorePatterns": ["package-lock.json", "coverage", "data", "src/resources/**", ".claude"] | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| { | ||
| "$schema": "./node_modules/oxlint/configuration_schema.json", | ||
| "plugins": ["typescript", "unicorn", "import", "node", "oxc"], | ||
| "categories": { "correctness": "error" }, | ||
| "env": { "node": true, "es2024": true }, | ||
| "rules": { | ||
| "typescript/no-floating-promises": "error", | ||
| "typescript/no-misused-promises": "error", | ||
| "typescript/no-explicit-any": "error", | ||
| "typescript/consistent-type-imports": "error", | ||
| "eqeqeq": ["error", "always", { "null": "ignore" }], | ||
| "curly": ["error", "all"], | ||
| "no-console": "error" | ||
| }, | ||
| "overrides": [ | ||
| { | ||
| "files": ["tests/**/*.ts"], | ||
| "rules": { "typescript/no-floating-promises": "off" } | ||
| }, | ||
| { | ||
| "files": ["src/scripts/**/*.ts"], | ||
| "rules": { "no-console": "off" } | ||
| } | ||
| ], | ||
| "ignorePatterns": ["node_modules", "coverage", "data", ".claude"] | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,17 +1,9 @@ | ||
| # Stage 1 - Build | ||
|
|
||
| FROM node:24-trixie-slim AS build | ||
| FROM node:24-trixie-slim | ||
| WORKDIR /usr/src/app | ||
| COPY package*.json ./ | ||
| RUN npm ci | ||
| COPY . . | ||
| RUN npm run build | ||
|
|
||
| # Stage 2 - Dist Only | ||
|
|
||
| FROM node:24-trixie-slim AS dist | ||
| WORKDIR /usr/src/app | ||
| COPY package*.json ./ | ||
| COPY package*.json .npmrc ./ | ||
| RUN npm ci --omit=dev | ||
| COPY --from=build /usr/src/app/dist dist | ||
| ENTRYPOINT ["npm", "start"] | ||
| COPY src ./src | ||
| RUN mkdir -p data && chown node:node data | ||
| USER node | ||
| VOLUME /usr/src/app/data | ||
| CMD ["node", "src/index.ts"] |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.