I want the user to be able to change the volume of my discord music bot. I have tried doing it, but it does not seem to work. I already defined vc as "something" outside, and then used it to play music in try and except. I wonder if that is causing the problem.
elif contents.startswith("volume"):
volume = contents
volume = volume.strip("volume ")
volume = int(volume)
if volume <= 100:
volume = volume / 10
vc.source = discord.PCMVolumeTransformer(vc.source)
vc.source.volume = volume
else:
message.channel.send("Please give me a number between 0 and 100!")