Implementation for setting max volume (#336)
* Added support for creating a max volume * Fixed db function calls * Fixed issue with max volume always adjusting volume
This commit is contained in:
committed by
GitHub
parent
0650e7279f
commit
a50a067641
@ -137,9 +137,13 @@ class MumbleBot:
|
||||
# ====== Volume ======
|
||||
self.volume_helper = util.VolumeHelper()
|
||||
|
||||
max_vol = var.config.getfloat('bot', 'max_volume')
|
||||
if var.db.has_option('bot', 'max_volume'):
|
||||
max_vol = var.db.getfloat('bot', 'max_volume')
|
||||
_volume = var.config.getfloat('bot', 'volume')
|
||||
if var.db.has_option('bot', 'volume'):
|
||||
_volume = var.db.getfloat('bot', 'volume')
|
||||
_volume = min(_volume, max_vol)
|
||||
self.volume_helper.set_volume(_volume)
|
||||
|
||||
self.is_ducking = False
|
||||
|
Reference in New Issue
Block a user