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

Add API version configuration #601

Merged
merged 4 commits into from
Jun 24, 2022
Merged

Conversation

lukellmann
Copy link
Member

@lukellmann lukellmann commented Apr 23, 2022

This PR allows to configure which versions of Discord's APIs Kord uses.
This is achieved by changing the properties REST_VERSION, GATEWAY_VERSION or VOICE_GATEWAY_VERSION of the KordConfiguration object:

object KordConfiguration {
    var REST_VERSION: Int
    var GATEWAY_VERSION: Int
    var VOICE_GATEWAY_VERSION: Int
}

Reading the REST version from the environment variable dev.kord.rest.version is removed.

DefaultGateway.Companion.invoke now no longer uses an unversioned gateway url.

@lukellmann
Copy link
Member Author

This is a first draft of the configuration options I mentioned here.

Would be nice to get some feedback on this. Are there more things that could be configured in this way?
(@HopeBaron @DRSchlaubi @MrPowerGamerBR)

@lukellmann
Copy link
Member Author

If there are no concerns about the design of this (mutable properties in an object), I would say this is ready for review.

@lukellmann lukellmann marked this pull request as ready for review April 28, 2022 04:12
@lukellmann lukellmann requested a review from HopeBaron April 28, 2022 04:12
@HopeBaron
Copy link
Member

Looks fine 👍

@lukellmann
Copy link
Member Author

This PR removed the separately listed Gateway version, should we also only have one property for this?

@lukellmann
Copy link
Member Author

This PR removed the separately listed Gateway version, should we also only have one property for this?

I thought about this and we probably shouldn't - if you want to change the version for only one of them you should be free to do so.

@HopeBaron
Copy link
Member

Do you mean to have a fixed set of versions?

@lukellmann
Copy link
Member Author

I meant always using the same version for gateway and rest, but I think we should allow changing them independently.

@HopeBaron
Copy link
Member

Yeah it looks fine; we just need to fix the conflicts to go

@lukellmann
Copy link
Member Author

lukellmann commented Jun 24, 2022

Will do today/tomorrow now 👍

@lukellmann
Copy link
Member Author

Done

@HopeBaron HopeBaron merged commit 80a8cdf into kordlib:0.8.x Jun 24, 2022
@lukellmann lukellmann deleted the feature/config branch June 24, 2022 19:32
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