-
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
Change field visibility and single-expression return syntax #335
Change field visibility and single-expression return syntax #335
Conversation
…ed the toRequest functions to single expression-styled returns
Hello! Thanks for your contribution |
Created a new commit. How would you feel about having the two remaining fields as nullable and default initialized. When applying "logic" to them one would still have to specify the fields and assign them empty strings as: string("", "") {
name = foo()
description = bar()
} while that could be changed to e.g string { // name: String? = null
name = foo()
} Whilst still allowing the previous string(name, description) |
Thanks for your question. what would be an appropriate representation of null in a parameter that is required? an empty string? some default string? |
I can see how that's be problematic. Anyhow, I pushed another commit, please review if it's suitable for a merge :) |
@NoakPalander sorry for the delay on the merge. can you make type public but make it a val instead? |
Thank you for your contribution! Hit us on Discord if you haven't! |
* Add a cache aware rest entity supplier (#338) * add a cahe aware rest supplier/strategy * abstract the new flow creation for storeAndEmit * apply suggestions * Reduce the number of iterations rename storeAndEmit to storeOnEach * update changelog * Fix master gateway average ping conversion (#337) * Change field visibility and single-expression return syntax (#335) * changed the visibility for the name, descript.. and type field, changed the toRequest functions to single expression-styled returns * remade .name and .description to public upon request, kept .type protected * remade .type into read only (val) * Implement select menus (#339) * Add select menu json representation * Add select menu builders * add serialization tests for select menu interactions * Add core implementation of select menus * Update ButtonComponent docs * Make SelectMenu min/max values a range * Fix getGuildBanOrNull recursion (#341) Fixes the self call in getGuildBanOrNull by delegating the call to the supplier instead * Make UpdateMessageInteractionResponseCreateBuilder fields nullable (#340) Makes the fields in the builder and request nullable where appropriate for updating a message * improve readme * api dump * add breaking changes to changelog * mention the type visibility change [ci skip] Co-authored-by: Bart Arys <[email protected]> Co-authored-by: Noak Palander <[email protected]>
dev.kord.rest.builder.interaction.OptionsBuilder.name, .description, .type
frompublic
toprotected
due to them serving no purpose as public from an API standpoint. E.gThe reason for them not being private is due to
BaseCommandOptionBuilder.toRequest
andBaseChoiceBuilder.toRequest
requiring access to these fields when returning anApplicationCommandOption
object.Reduces some redundancy, e.g return type and unnecessary
return
keyword