Made volume range check inclusive
This commit is contained in:
parent
95dbd75e19
commit
26098d7a88
|
@ -55,7 +55,7 @@ func (c *VolumeCommand) Execute(user *gumble.User, args ...string) (string, bool
|
||||||
return "", true, errors.New(viper.GetString("commands.volume.messages.parsing_error"))
|
return "", true, errors.New(viper.GetString("commands.volume.messages.parsing_error"))
|
||||||
}
|
}
|
||||||
|
|
||||||
if newVolume < viper.GetFloat64("volume.lowest") || newVolume > viper.GetFloat64("volume.highest") {
|
if newVolume <= viper.GetFloat64("volume.lowest") || newVolume >= viper.GetFloat64("volume.highest") {
|
||||||
return "", true, fmt.Errorf(viper.GetString("commands.volume.messages.out_of_range_error"),
|
return "", true, fmt.Errorf(viper.GetString("commands.volume.messages.out_of_range_error"),
|
||||||
viper.GetFloat64("volume.lowest"), viper.GetFloat64("volume.highest"))
|
viper.GetFloat64("volume.lowest"), viper.GetFloat64("volume.highest"))
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue