-
Notifications
You must be signed in to change notification settings - Fork 583
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
Unify length overflow checks for builders #2178
Conversation
I think there should be a function to do the checking
Some overflow errors (EmbedAmount) don't contain the overflow number, but we're on next anyways so we can fix the inconsistency, and then use our new function for those errors as well |
A better API might be |
saturating_sub
when calculating length overflow
In fact this is what delights me about programming; code simplification naturally leading you to find and fix API inconsistencies and paper cuts. |
My thoughts are that embeds and stickers are limited to such low numbers, that indicating to the user how much they've gone over the limit isn't very useful. Nobody is going to be trying to send 15 embeds in the same message. It makes much more sense when limiting text length, because there can be a lot more of it, and the limit is high, therefore it's useful to tell the user exactly by how much they've gone over. EDIT: Also, TIL that |
I feel different but it's not objective and not worth bikeshedding over |
Yes, and if those changes were to be made, it should be done in a separate PR. The main goal of this PR is ensuring overflow checks are always correctly performed. |
No description provided.