From 34fae41208e48d328be9f45657f0acc1d0eb7c6a Mon Sep 17 00:00:00 2001 From: phxntxm Date: Wed, 19 Apr 2017 22:45:11 -0500 Subject: [PATCH] Check if we're playing something when setting the volume --- cogs/music.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cogs/music.py b/cogs/music.py index 98bf035..22e4034 100644 --- a/cogs/music.py +++ b/cogs/music.py @@ -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))