From c6ab8aa9535e07acfacf6efa16de946578c8a60c Mon Sep 17 00:00:00 2001 From: Dhimas Bagus Prayoga Date: Sat, 3 Apr 2021 01:06:44 +0700 Subject: [PATCH] remove file raw every exit from VC And add volume method Fix duplicate to --- krypton/__main__.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/krypton/__main__.py b/krypton/__main__.py index 4ee717d..32bf94a 100644 --- a/krypton/__main__.py +++ b/krypton/__main__.py @@ -72,24 +72,35 @@ async def join(_, message): await message.reply_text('Succsessfully joined!') @app.on_message(filters.text & cmd_filter('mute')) -async def join(_, message): +async def mute(_, message): group_calls.set_is_mute(True) await message.reply_text('Succsessfully muted bot!') @app.on_message(filters.text & cmd_filter('unmute')) -async def join(_, message): +async def unmute(_, message): group_calls.set_is_mute(False) await message.reply_text('Succsessfully unmuted bot!') +@app.on_message(filters.text & cmd_filter('volume')) +async def volume(_, message): + if len(message.command) < 2: + await message.reply_text('You forgot to pass volume (1-200)') + + await group_call.set_my_volume(message.command[1]) + await message.reply_text(f'Volume changed to {message.command[1]}') + @app.on_message(filters.text & cmd_filter('stop')) -async def join(_, message): +async def stop(_, message): group_calls.stop_playout() playing = False + os.remove('input.raw') await message.reply_text('Succsessfully stopped song!') @app.on_message(filters.text & cmd_filter('leave')) async def leave(_, message): await group_calls.stop() + playing = False + os.remove('input.raw') await message.reply_text('Succsessfully leaved!') @app.on_message(filters.text & cmd_filter('kill'))