K
Kord2mo ago
Sorry

Where do you store the bot API keys?

Normally i use BuildKonfig to generate the classes from local.properties but that doesn't work for JVM. My current janky solution is to have a config.json with the API key, have it inside .gitignore but not sure if that's gonna work once i generate the jar file
Solution:
It does work, you just need to have the config.json in the correct directory at runtime, however i reccomend using something like environment variables, you can use something like envconf
GitHub
stdx.kt/envconf at main · DRSchlaubi/stdx.kt
Kotlin Standard Library Extensions. Contribute to DRSchlaubi/stdx.kt development by creating an account on GitHub.
Jump to solution
2 Replies
Solution
SchlaubiBus
SchlaubiBus2mo ago
It does work, you just need to have the config.json in the correct directory at runtime, however i reccomend using something like environment variables, you can use something like envconf
GitHub
stdx.kt/envconf at main · DRSchlaubi/stdx.kt
Kotlin Standard Library Extensions. Contribute to DRSchlaubi/stdx.kt development by creating an account on GitHub.
g
g2mo ago
Yeah env vars are the way to go

Did you find this page helpful?