-
Notifications
You must be signed in to change notification settings - Fork 82
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
Add a getGuildOrNull function to the Kord class #714
Conversation
That's why the build fails:
|
Aaa, thank, will fix in a bit |
The alternative would be to deprecate |
That seems reasonable, personally I don't like the idea of going without the throwing function, maybe using JVM name annotations to allow both to exist could be used? |
Problem with that is that it might be binary compatible but it would still silently remove We could maybe add a temporaty function like |
Yeah that seems reasonable to me,if you're ok with that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! :)
Previously there was just a
getGuild
function that called the nullable variant below the hood, but the non-nullable variant also exists.I've created the
getGuildOrNull
function to clearly show it function returns a null, and thegetGuild
function now calls the non-nullable function, and as such will throwEntityNotFoundException
when called and the guild is null.This could be quite a breaking change for bots, as the
getGuild
function no longer returns null, it throws. This should be announced somewhere, or a release created to document.I also KDoc'd these functions :)