diff --git a/config.py b/config.py index 6765f10..62d160b 100644 --- a/config.py +++ b/config.py @@ -25,3 +25,4 @@ DURATION_LIMIT = int(getenv("DURATION_LIMIT", "60")) IMG_1 = getenv("IMG_1", "https://telegra.ph/file/d6f92c979ad96b2031cba.png") IMG_2 = getenv("IMG_2", "https://telegra.ph/file/6213d2673486beca02967.png") IMG_3 = getenv("IMG_3", "https://telegra.ph/file/f02efde766160d3ff52d6.png") +IMG_4 = getenv("IMG_4", "https://telegra.ph/file/19ef76c0a097b1a394b00.png") diff --git a/driver/utils.py b/driver/utils.py index a24f573..98930f6 100644 --- a/driver/utils.py +++ b/driver/utils.py @@ -1,6 +1,6 @@ -from driver.queues import QUEUE, clear_queue, get_queue, pop_an_item from driver.veez import call_py from pytgcalls.types import Update +from driver.queues import QUEUE, clear_queue, get_queue, pop_an_item from pytgcalls.types.input_stream import AudioPiped, AudioVideoPiped from pytgcalls.types.input_stream.quality import ( HighQualityAudio, diff --git a/program/admins.py b/program/admins.py index 1909654..6ff8459 100644 --- a/program/admins.py +++ b/program/admins.py @@ -168,8 +168,13 @@ async def unmute(client, m: Message): async def change_volume(client, m: Message): range = m.command[1] chat_id = m.chat.id - try: - await call_py.change_volume_call(chat_id, volume=int(range)) - await m.reply(f"โœ… **volume set to** `{range}`%") - except Exception as e: - await m.reply(f"๐Ÿšซ **error:**\n\n{e}") + if chat_id in QUEUE: + try: + await call_py.change_volume_call(chat_id, volume=int(range)) + await m.reply( + f"โœ… **volume set to** `{range}`%" + ) + except Exception as e: + await m.reply(f"๐Ÿšซ **error:**\n\n`{e}`") + else: + await m.reply("โŒ **nothing in streaming**") diff --git a/program/music.py b/program/music.py index 767719a..0ea7bf3 100644 --- a/program/music.py +++ b/program/music.py @@ -76,7 +76,10 @@ async def play(_, m: Message): if replied.audio.title: songname = replied.audio.title[:70] else: - songname = replied.audio.file_name[:70] + if replied.audio.file_name: + songname = replied.audio.file_name[:70] + else: + songname = "Audio" elif replied.voice: songname = "Voice Note" if chat_id in QUEUE: diff --git a/program/video.py b/program/video.py index 9aecd87..92cca52 100644 --- a/program/video.py +++ b/program/video.py @@ -89,12 +89,14 @@ async def vplay(client, m: Message): await loser.edit( "ยป __only 720, 480, 360 allowed__ \n๐Ÿ’ก **now streaming video in 720p**" ) - - if replied.video: - songname = replied.video.file_name[:70] - elif replied.document: - songname = replied.document.file_name[:70] - + try: + if replied.video: + songname = replied.video.file_name[:70] + elif replied.document: + songname = replied.document.file_name[:70] + except BaseException: + songname = "Video" + if chat_id in QUEUE: pos = add_to_queue(chat_id, songname, dl, link, "Video", Q) await loser.delete()