fix(commands/voice/volume): check active player earlier
This commit is contained in:
parent
86bf70907c
commit
9959bd3300
@ -173,6 +173,13 @@ async def volume(message):
|
|||||||
if not (args := await parser.parse_args(message, tokens)):
|
if not (args := await parser.parse_args(message, tokens)):
|
||||||
return
|
return
|
||||||
|
|
||||||
|
if not message.guild.voice_client.source:
|
||||||
|
await utils.reply(
|
||||||
|
message,
|
||||||
|
f"there is no player currently active!",
|
||||||
|
)
|
||||||
|
return
|
||||||
|
|
||||||
if args.volume:
|
if args.volume:
|
||||||
message.guild.voice_client.source.volume = float(args.volume) / 100.0
|
message.guild.voice_client.source.volume = float(args.volume) / 100.0
|
||||||
await utils.reply(
|
await utils.reply(
|
||||||
@ -180,16 +187,10 @@ async def volume(message):
|
|||||||
f"volume set to **{args.volume}%**",
|
f"volume set to **{args.volume}%**",
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
if message.guild.voice_client.source:
|
await utils.reply(
|
||||||
await utils.reply(
|
message,
|
||||||
message,
|
f"current volume is **{int(message.guild.voice_client.source.volume * 100)}%**",
|
||||||
f"current volume is **{int(message.guild.voice_client.source.volume * 100)}%**",
|
)
|
||||||
)
|
|
||||||
else:
|
|
||||||
await utils.reply(
|
|
||||||
message,
|
|
||||||
f"there is no player currently active!",
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
async def play_next(message):
|
async def play_next(message):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user