diff --git a/tlg_bot/kreacher/plugins/leave.py b/tlg_bot/kreacher/plugins/leave.py index 2ef24de..5a189e8 100644 --- a/tlg_bot/kreacher/plugins/leave.py +++ b/tlg_bot/kreacher/plugins/leave.py @@ -7,10 +7,9 @@ async def leave_handler(event): try: chat = await event.get_chat() - proto = VOICE_CHATS[chat.id] - if proto is None: + if chat.id not in VOICE_CHATS: raise Exception("Streaming is not active") - await proto.leave_current_group_call() + await VOICE_CHATS[chat.id].leave_current_group_call() VOICE_CHATS.pop(chat.id) await event.reply("Goodbye master, just call me if you need me. \n\nVoice Chat left successfully.", parse_mode="HTML") except Exception as e: diff --git a/tlg_bot/kreacher/plugins/new.py b/tlg_bot/kreacher/plugins/new.py index 5a22d79..f62a2a7 100644 --- a/tlg_bot/kreacher/plugins/new.py +++ b/tlg_bot/kreacher/plugins/new.py @@ -7,8 +7,7 @@ async def new_handler(event): try: chat = await event.get_chat() - proto = VOICE_CHATS[chat.id] - if proto is not None: + if chat.id not in VOICE_CHATS: raise Exception("Streaming is active") await ins.start(chat.id) VOICE_CHATS[chat.id] = ins diff --git a/tlg_bot/kreacher/plugins/play_video.py b/tlg_bot/kreacher/plugins/play_video.py index 3010d87..1a449b5 100644 --- a/tlg_bot/kreacher/plugins/play_video.py +++ b/tlg_bot/kreacher/plugins/play_video.py @@ -58,12 +58,11 @@ async def play_video(event): else: await msg.edit("🔄 Starting Live Video Stream...", parse_mode="HTML") - link = url thumb = "https://telegra.ph/file/3e14128ad5c9ec47801bd.jpg" try: await sleep(2) - await ins.start_video(link, with_audio=True, repeat=False) + await ins.start_video(url, with_audio=True, repeat=False) await msg.delete() await event.reply( f"▶️ Started [Video Streaming]({url})!",