You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
The transfer transaction currently fails for senders without an existing profile row and the wage/transfer config + formatting includes correctness issues that will surface at runtime.
Get a fresh assessment by requesting another Copilot review.
Review details
Suppressed comments (1)
src/commands/fun/economy.ts:998
This check no longer rejects negative balances, but config.economy.setBalance.invalid says the valid range is 0..2B. Allowing negative balances can also break assumptions elsewhere (e.g., affordability checks).
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
The new wage-claim persistence/concurrency behavior has correctness issues (missing uniqueness for upsert and non-atomic eligibility checks) that can lead to incorrect payouts/cooldowns.
Get a fresh assessment by requesting another Copilot review.
Review details
Suppressed comments (3)
Previously missed (1) — in code that hasn't changed since the last review.
src/commands/fun/economy.ts:1083
/economy set-balance is described as setting an exact balance and the configured error message says the valid range is 0..2B, but this validation now allows negative balances. If negative balances are not intended, restore the non-negative check (or update the command/config text to match the new behavior).
src/commands/fun/economy.ts:1494
This error response is hard-coded, lowercased, and bypasses the configurable economy messages you added for transfers. Consider using a config-driven message (e.g. config.economy.transfer.database_error) so server owners can localize/tune it and it stays consistent with other economy errors.
return void await interaction.editReply({ content: "wire transfer failed. Try again later" });
src/commands/fun/economy.ts:1062
/economy add-money is described as adding money and config.economy.limit says the amount must be bigger than 0, but the current validation allows negative amounts. Also, after profile.increment(...), using profile.balance + amount can produce an incorrect newBalance (depending on whether the instance was updated/reloaded). Enforce a positive amount and fetch the updated balance for the response.
The newly added getMemberWageConfig explicitly selects the highest-paying matching role, but handleWage never calls it and instead adds every matching role to qualifiedWages. A member with multiple configured roles will therefore receive and independently cooldown multiple salaries, changing the previous Math.max behavior and making the two implementations inconsistent. Use one selection strategy consistently (or remove the unused helper if stacking is intentional).
Prevent set-balance from allowing negative balances
src/commands/fun/economy.ts:1098
This changes set-balance to permit negative balances, contradicting the configured error message (Invalid amount range (0 to 2B).) and the previous non-negative contract. That also leaves users unable to use normal positive-only spending commands until another administrative correction; reject values below zero unless negative balances are an intentional, documented feature.
Use transfer-specific insufficient-funds messaging
src/commands/fun/economy.ts:1467
The insufficient-funds response uses the generic cantAfford text, which ends with “You don't have enough money to bet!” even though this is a transfer. This gives the recipient an incorrect explanation; add a transfer-specific insufficient-funds message and use it for this check (and the transaction-failure branch below).
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
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.
added ability to transfer money between users and made it so config can define how long till you can collect next wage