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

feat: snowflake extension #887

Closed
wants to merge 1 commit into from
Closed

feat: snowflake extension #887

wants to merge 1 commit into from

Conversation

tozydev
Copy link

@tozydev tozydev commented Oct 26, 2023

It would be nice to have an extension to create Snowflake instances.

Without extension:

kord.createGuildApplicationCommands(Snowflake(123456789)) {
        TODO()
}

With extension:

kord.createGuildApplicationCommands(123456789.snowflake()) {
        TODO()
}

@lukellmann
Copy link
Member

Hm, is there really that much value in having an extension function for this?

@tozydev
Copy link
Author

tozydev commented Oct 26, 2023

Hm, is there really that much value in having an extension function for this?

It will be very convenient in some cases. For example, to get raw data from config or database, just call the extension instead of calling the constructor, the code will be more readable or something like that.

@lukellmann
Copy link
Member

if it's about the postfix notation, you could also do someExpression.let(::Snowflake)

@tozydev tozydev closed this Oct 26, 2023
@tozydev tozydev deleted the feat/snowflake-extension branch October 26, 2023 08:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants