Open
Conversation
Single-file fallback shim that bridges the old monolithic userdb to the new split collections. This is the ONLY file in the bot that references DB._legacyUserDB. Provides getUser, getUserFull, getUserCosmetics, getUserCosmeticsFull, getUserOAuth, and translateUpdate helpers. Marks old docs with sunset:true when synced. Delete this entire file when sunsetting the legacy format. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- onEveryCommand: DB.userDB → DB.users, modules.exp → progression.exp - globalLevelUp: modules.level → progression.level, modules.exp → progression.exp - boxDrops: modules.exp → progression.exp Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Updates 9 files in core/archetypes, core/structures, core/utilities: - Currency: modules.RBN/SPH/JDE/PSM/EVT → currency.* - Progression: modules.level/exp → progression.* - Profile: modules.bgID/favcolor/tagline/etc → profile.* - Donator: .donator reads → .prime?.tier ?? null - Inventory/cosmetic writes marked with TODO(sunset) for phase 2 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Updates 38 command files across economy, social, cosmetics, games, inventory, beta, infra, misc, pollux, and _botStaff categories: - Currency: modules.RBN/SPH/JDE/PSM/EVT → currency.* - Progression: modules.level/exp → progression.* - Profile: modules.bgID/favcolor/tagline/persotext/etc → profile.* - Donator: .donator → .prime?.tier - DB.userDB → DB.users - Cosmetic/inventory paths annotated with TODO(sunset) for future migration to DB.userCosmetics Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- userData.modules.level → userData.progression.level - userData.modules.bgID → userData.profile.bgID - userData.modules.favcolor → userData.profile.favcolor - userData.modules.commend → userData.counters?.commend Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sweep of all remaining modules.inventory, modules.bgInventory, modules.medalInventory, modules.stickerInventory, modules.skinInventory, and modules.flairsInventory references across archetypes and commands. Updated both JS property access and MongoDB query/update paths. Crafter._modules now constructed from new schema shape (currency + profile.inventory). Removed TODO(sunset) comments for completed items. 20 files: 3 archetypes + 17 command files. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Migrate remaining bot commands from profile.*Inventory to DB.userCosmetics: - background.js: fix profile.bgID equip write (modules.bgID was wrong) - openbooster.js: use getFull + cosmeticsDoc.removeItem for boosterpack consumption - fragment.js: fetch cosmeticsDoc via getFull, use $pull on userCosmetics - commend.js: add cosmeticsDoc fetch, fix inventory check and removeItem - vdiff.js: add cosmeticsData fetch, fix all inventory count displays - marketplace/post.js: parallel fetch + fix inventory ownership checks in AllChecks - blackjack.js: fix agent-introduced modules.skins.blackjack back to profile.skins.blackjack - use.js: add cosmeticsDoc fetch, hasItem check goes through cosmeticsDoc - streakfix.js / streakfix+.js: removeItem now via DB.userCosmetics.getFull Agent-contributed fixes (verified): - lootbox_generator.js, any.js, synthBg.js, synthMedal.js - inventory.js, decks.js, marry.js, blackjack.js (DECK fn) - Premium.js: split sticker/flair/medal writes to DB.userCosmetics Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…y access - Rename all DB.userCosmetics references to DB.userInventory - Fix craft.js to read inventory from user_inventory collection - Fix streakfix+.js removeItem arg order bug - Route all addItem/removeItem/hasItem calls through userInventory 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
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.
This pull request implements a significant refactor of user data storage and access throughout the codebase. The main change is the migration from the old monolithic
modulesobject to a more modular structure, splitting user data intoprogression,currency,profile, and a dedicateduserInventorycollection for cosmetics and inventory items. This improves data organization, scalability, and separation of concerns. The changes affect multiple core systems, including achievements, crafting, economy, premium rewards, progression, user profiles, and ventures.Key changes by theme:
Data Model Refactor:
modulesis now split intoprogression(level, exp),currency(RBN, SPH, etc.),profile(visual settings), anduserInventory(cosmetics, inventory). All database reads/writes and in-memory usages are updated accordingly. (core/archetypes/Achievements.js,core/archetypes/Crafter.js,core/archetypes/Economy.js,core/archetypes/Premium.js,core/archetypes/Progression.js,core/archetypes/UserProfileModel.js,core/archetypes/Venture.js,core/commands/_botStaff/lvup.js) [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] [23]System-Specific Updates:
progression.levelandprogression.exp. (core/archetypes/Achievements.js,core/archetypes/Progression.js,core/commands/_botStaff/lvup.js) [1] [2] [3] [4]currencyobject, and related DB updates are refactored. (core/archetypes/Economy.js,core/archetypes/Progression.js,core/archetypes/Venture.js) [1] [2] [3] [4] [5]userInventorycollection, with all related DB operations updated. (core/archetypes/Crafter.js,core/archetypes/Premium.js) [1] [2] [3] [4] [5] [6] [7] [8] [9]userInventory, and premium logic is updated to reflect the new data structure. (core/archetypes/Premium.js) [1] [2] [3] [4] [5] [6] [7]core/archetypes/UserProfileModel.js) [1] [2]This refactor is foundational and will make future development, maintenance, and feature expansion much easier and safer.