cnpryer / peef

A discord bot with uncompensated personality
MIT License
0 stars 0 forks source link

Allow reading config from file instead of CLI args #11

Open ObiWanRohan opened 3 years ago

ObiWanRohan commented 3 years ago

Currently the API Key and Guild IDs are passed to the app through CLI args. It would be more convenient for deployment and development if these values could be specified in a config or a .env file.

The viper package seems like a good way to go about it.

cnpryer commented 3 years ago

Yup I agree. This should be the direction we head in. I’m not opposed to keeping certain things as optional ways to spin up the bot (use arts if you want, otherwise expect environment variables).

I believe API_KEY is currently utilized like this. I haven’t implemented viper yet but it looks like a good idea as well. Right now I used os.Getenv().

cnpryer commented 3 years ago

I'm not sure if your branch contains the viper implementation, but I figured I'd check this out and branch to viper.