1
0
Fork 0
mirror of synced 2024-05-20 20:42:27 +12:00

Check if we're playing something when setting the volume

This commit is contained in:
phxntxm 2017-04-19 22:45:11 -05:00
parent 40b4977a32
commit 34fae41208

View file

@ -369,11 +369,11 @@ class Music:
if value is None or not state.playing:
volume = source.volume
await ctx.send("Current volume is {}".format(volume))
return
if value > 200:
elif value > 200:
await ctx.send("Sorry but the max volume is 200")
return
if state.playing:
elif source is None:
await ctx.send("Not playing anything right now, please set volume after playing something")
elif state.playing:
source.volume = value / 100
await ctx.send('Set the volume to {:.0%}'.format(source.volume))