Added a check in case the volume passed is higher than max
This commit is contained in:
parent
e101ba3120
commit
ceddb2b7c8
1 changed files with 3 additions and 0 deletions
|
@ -303,6 +303,9 @@ class Music:
|
||||||
"""Sets the volume of the currently playing song."""
|
"""Sets the volume of the currently playing song."""
|
||||||
|
|
||||||
state = self.get_voice_state(ctx.message.server)
|
state = self.get_voice_state(ctx.message.server)
|
||||||
|
if value > 200:
|
||||||
|
await self.bot.say("Sorry but the max volume is 200")
|
||||||
|
return
|
||||||
if state.is_playing():
|
if state.is_playing():
|
||||||
player = state.player
|
player = state.player
|
||||||
player.volume = value / 100
|
player.volume = value / 100
|
||||||
|
|
Loading…
Reference in a new issue