Skip to content
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

validate within KordExUtils Arguments.function not run #60

Open
benjamineeckh opened this issue Sep 18, 2023 · 1 comment
Open

validate within KordExUtils Arguments.function not run #60

benjamineeckh opened this issue Sep 18, 2023 · 1 comment
Labels
bug Something isn't working waiting-for-confirmation Issue is waiting for confirmation by OP

Comments

@benjamineeckh
Copy link
Contributor

If you add a validate block to a KordExUtils Arguments.function, it won't get run. It still runs the validity check in the KordExUtils function, but will not check whether the Valid block added to the function is correct.
Example:

        val amount by availableCurrency("triedBettingNothing", "triedOverBetting") {
            name = "bet"
            description = "amount to bet"
            validate {
                val totalBet = this.value * xtimes
                val balance = balanceManager.get(this.context.user).balance
                failIf(tr("triedOverBetting", xtimes, this.value)) { true }
            }
        }

this will run perfectly fine even though it should always fail.

@ToxicMushroom ToxicMushroom added the bug Something isn't working label Sep 21, 2023
@ToxicMushroom
Copy link
Member

Should be fixed in Melijn/kord-extensions@2c59898

@ToxicMushroom ToxicMushroom added the waiting-for-confirmation Issue is waiting for confirmation by OP label Jan 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working waiting-for-confirmation Issue is waiting for confirmation by OP
Projects
None yet
Development

No branches or pull requests

2 participants