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 fileSolution:Jump to 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.
2 Replies
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.
Yeah env vars are the way to go