generated from alex/base-template
Simple storage #1
Labels
No labels
dependencies
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
alex/irc-greeter-bot#1
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Let's add a simple disk storage mechanism to keep track of already greeted nicks and skip them
/pi new pr, use std Deno libs if it makes sense
Now I understand the project. Let me check the current state after the fmt fix and look at what needs to change:Let me create the storage module, tests, and update the related files:Now update
config.tsto add the optionalstorePath:Now updatemain.tsto integrate the store:Now updatedeno.jsonto add--allow-writepermissions:Now update.env.exampleand.gitignore:Now update the README to document the new feature:Now let me run all the CI checks to make sure everything passes:All checks pass — 8 tests, fmt, lint, and type-check all green. Let me do a final review of all the changes:Let me verify the final state of the key files and also rundeno checkon the test file specifically:Everything passes. Let me create the PR:PR #2 created. Let me check the CI status:PR #2 is created and open. Here's a summary of what was done:PR #2: feat: add disk storage for already-greeted nicks — closes #1
The PR adds a simple disk-backed store (
GreetedNicksStoreinsrc/storage.ts) that persists greeted nicks to a JSON file so the bot skips people it has already greeted, even after a restart.Key design decisions:
Deno.readTextFile/Deno.writeTextFile(part of the runtime, no@std/*package needed). This is the simplest fit for "simple disk storage."IRC_STORE_PATHdefaults togreeted-nicks.jsonif not set, following the existingresolve()pattern.All CI checks pass locally:
deno fmt --check,deno lint,deno check, anddeno test(8/8 passed).View action run | Model: zai/glm-5.2 (thinking: max) | Time: 9m 35s | Tokens: 558.8K | Pi SDK v0.80.6 | Action v2.25.1-develop (develop @ 9c24480)