forked from Xeio/IdleCodeRedeemer
-
Notifications
You must be signed in to change notification settings - Fork 1
Feat/deleteaccount command #28
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
10 commits
Select commit
Hold shift + click to select a range
03a0a7e
feat(deleteaccount): add /deleteaccount command for GDPR-friendly sel…
BigMichi1 16e3ae6
docs: document /deleteaccount command across all reference docs
BigMichi1 8316ba6
ci: add test & coverage workflow with per-PR diff comments
BigMichi1 e597abf
ci: use bin/mise instead of oven-sh/setup-bun to set up Bun
BigMichi1 96f26b3
ci: replace romeovs/lcov-reporter-action with pento/lcov-coverage-check
BigMichi1 9c070e2
chore: add mise test and test:coverage tasks, use in CI
BigMichi1 63f8189
fix: address Copilot PR review findings
BigMichi1 e362e57
fix: resolve TypeScript 6 strict type errors
BigMichi1 eca25c7
fix: include backfill_operations in deleteaccount existence check and…
BigMichi1 5b21c5e
fix: include backfill_operations in deleteaccount existence check and…
BigMichi1 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 |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| name: Tests & Coverage | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| pull_request: | ||
| branches: | ||
| - main | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| test: | ||
| name: Test & Coverage | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| actions: read # pento/lcov-coverage-check: list workflow runs and download baseline artifact | ||
| pull-requests: write # pento/lcov-coverage-check: post/update coverage comment on PRs | ||
|
|
||
| steps: | ||
| - name: Harden the runner (Audit all outbound calls) | ||
| uses: step-security/harden-runner@a5ad31d6a139d249332a2605b85202e8c0b78450 # v2.19.1 | ||
| with: | ||
| egress-policy: audit | ||
|
|
||
| - name: Checkout code | ||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
|
|
||
| - name: Install tools (Bun + Gitleaks via mise) | ||
| run: ./bin/mise install | ||
|
|
||
| - name: Install dependencies | ||
| run: ./bin/mise run install | ||
|
|
||
| - name: Type check | ||
| run: ./bin/mise run typecheck | ||
|
|
||
| - name: Run tests with coverage | ||
| run: ./bin/mise run test:coverage | ||
|
|
||
| # Stores lcov-baseline artifact on main; retrieves it and posts a coverage | ||
| # diff comment on PRs. Falls back to summary-only on first run or fork PRs. | ||
| - name: Report coverage | ||
| uses: pento/lcov-coverage-check@972428b8d5b3fbd8230df23ca4190ecce29979cd # v3.1.0 | ||
| with: | ||
| path: "src/" | ||
| github-token: ${{ secrets.GITHUB_TOKEN }} |
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 |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| # Ideas & TODO | ||
|
|
||
| Feature ideas and potential improvements for the bot. | ||
|
|
||
| Priority is rated from an end-user perspective: | ||
| - 🔴 **High** — directly improves core daily usage; most users would benefit immediately | ||
| - 🟡 **Medium** — noticeable improvement but not critical to the main workflow | ||
| - 🟢 **Low** — nice to have, niche use case, or primarily an admin/backend concern | ||
|
|
||
| --- | ||
|
|
||
| ## Code & Redemption | ||
|
|
||
| - 🟡 **`/stats` command** — Server-wide stats: total codes found, redemption counts, registered user count, aggregate loot earned. Data already exists in DB. | ||
| - 🟡 **Loot summary in `/codes`** — Show aggregate totals (gold, rubies, equipment) across all redeemed codes. `loot_detail` JSON is already stored per row. | ||
| - 🟢 **Code source tracking** — Store which channel/message ID a code was found in. Useful for auditing and showing users where codes originated. | ||
| - 🔴 **Multi-channel scanning** — `DISCORD_CHANNEL_ID` is a single channel. Support a comma-separated list or a `/setchannels` admin command. If codes get posted in other channels, users miss them entirely. | ||
| - 🟢 **Auto-purge expired pending codes** — Pending codes that fail globally should be cleaned up automatically; right now they stay in `pending_codes` forever. | ||
| - 🔴 **Scheduled catchup** — Run catchup automatically for all autoredeem-enabled users on a configurable timer (e.g. daily) as a safety net for missed codes. Prevents silently missing free loot. | ||
|
|
||
| --- | ||
|
|
||
| ## Notifications & UX | ||
|
|
||
| - 🔴 **DM notifications for new codes** — Opt-in per user to get a DM when a code is *detected*, independent of whether autoredeem is on. Users who want to redeem manually currently have no way to know a code appeared. | ||
| - 🔴 **Notification preferences command** — Let users configure: DM on success, DM on failure, DM when a code they haven't claimed is about to expire. High value as DM spam is a common complaint with bots. | ||
| - 🔴 **Better blacksmith UX** — `/blacksmith` requires a raw hero ID. Inventory data from `getUserDetails` includes hero names — show a hero picker or list. Current UX is nearly unusable without looking up IDs externally. | ||
| - 🟢 **Paginated `/codes`** — Replace the `count` cap (currently max 20) with Discord prev/next buttons for a cleaner experience. | ||
|
|
||
| --- | ||
|
|
||
| ## Admin & Operations | ||
|
|
||
| - 🟢 **`/admin` subcommand group** — Consolidate admin actions under one command: | ||
| - View recent audit log entries | ||
| - Force-expire or remove a specific code | ||
| - Remove a specific pending code | ||
| - View registered user count | ||
| - 🟢 **Config command** — Set bot config (scan channels, log level, autoredeem default) at runtime without restarting. | ||
|
|
||
| --- | ||
|
|
||
| ## API / Game Features | ||
|
|
||
| - 🟡 **`/buy` command** — `purchaseChests()` is already implemented in `idleChampionsApi.ts`. Just needs a command wired up. Convenient to do from Discord without opening the game. | ||
| - 🔴 **`/heroes` command** — List the user's champions with levels and upgrade costs from the player data response. Directly unblocks the blacksmith UX problem above. | ||
| - 🟡 **`/export` command** — Export redeemed code history as a CSV file attachment (`AttachmentBuilder`). Useful for personal tracking. | ||
|
|
||
| --- | ||
|
|
||
| ## Quality of Life | ||
|
|
||
| - ✅ **`/deleteaccount` command** *(implemented)* — Let users remove their credentials and history from the DB (GDPR-friendly self-service). |
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
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
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.