## Context
- Enable users to add webhooks and other settings from environmental variables for easier deployments since websites like [Render](https://render.com/) don't let you write custom commands to compose Dockerized projects.
@ -42,11 +42,34 @@ you can send whatsapp over http api but your whatsapp account have to be multi d
funcinit(){
funcinit(){
rootCmd.CompletionOptions.DisableDefaultCmd=true
rootCmd.CompletionOptions.DisableDefaultCmd=true
rootCmd.PersistentFlags().StringVarP(&config.AppPort,"port","p",config.AppPort,"change port number with --port <number> | example: --port=8080")
rootCmd.PersistentFlags().StringVarP(&config.AppPort,"port","p",config.AppPort,"change port number with --port <number> | example: --port=8080")
ifconfig.AppPort==""{
config.AppPort=os.Getenv("AppPort")
}
rootCmd.PersistentFlags().BoolVarP(&config.AppDebug,"debug","d",config.AppDebug,"hide or displaying log with --debug <true/false> | example: --debug=true")
rootCmd.PersistentFlags().BoolVarP(&config.AppDebug,"debug","d",config.AppDebug,"hide or displaying log with --debug <true/false> | example: --debug=true")
if!config.AppDebug{
debugEnv:=os.Getenv("AppDebug")
ifdebugEnv=="true"{
config.AppDebug=true
}elseifdebugEnv=="false"{
config.AppDebug=false
}
}
rootCmd.PersistentFlags().StringVarP(&config.AppOs,"os","",config.AppOs,`os name --os <string> | example: --os="Chrome"`)
rootCmd.PersistentFlags().StringVarP(&config.AppOs,"os","",config.AppOs,`os name --os <string> | example: --os="Chrome"`)
rootCmd.PersistentFlags().StringVarP(&config.WhatsappAutoReplyMessage,"autoreply","",config.WhatsappAutoReplyMessage,`auto reply when received message --autoreply <string> | example: --autoreply="Don't reply this message"`)
rootCmd.PersistentFlags().StringVarP(&config.WhatsappAutoReplyMessage,"autoreply","",config.WhatsappAutoReplyMessage,`auto reply when received message --autoreply <string> | example: --autoreply="Don't reply this message"`)