Added execute single online presence status message
This commit is contained in:
@@ -17,7 +17,7 @@ func Load() {
|
||||
GeneralOptions: GeneralOptions{
|
||||
PresenceStatusDelay: int64(getEnvInt("PRESENCE_STATUS_DELAY", 2) * 60),
|
||||
CommandReplyDelay: getEnvInt("COMMAND_REPLY_DELAY", 10),
|
||||
ExecuteSingleStatusMessage: getEnvBool("EXECUTE_SIGLE_STATUS_MESSAGE"),
|
||||
ExecuteSingleStatusMessage: getEnvBool("EXECUTE_SNIGLE_STATUS_MESSAGE"),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ func getEnvInt(key string, defaultValue int) int {
|
||||
}
|
||||
|
||||
// getEnv extracts the bool value from environment variable
|
||||
func getEnvBool(env string) bool {
|
||||
func mustGetEnvBool(env string) bool {
|
||||
envVal := mustGetEnv(env)
|
||||
value, err := strconv.ParseBool(envVal)
|
||||
|
||||
@@ -45,6 +45,18 @@ func getEnvBool(env string) bool {
|
||||
return value
|
||||
}
|
||||
|
||||
// getEnv extracts the bool value from environment variable
|
||||
func getEnvBool(env string) bool {
|
||||
envVal := getEnv(env, "false")
|
||||
value, err := strconv.ParseBool(envVal)
|
||||
|
||||
if err != nil {
|
||||
value = false
|
||||
}
|
||||
|
||||
return value
|
||||
}
|
||||
|
||||
// mustGetEnv returns value for give key from environment
|
||||
// if key is not present in environment function will panic
|
||||
func mustGetEnv(key string) string {
|
||||
|
||||
Reference in New Issue
Block a user