Skip to content

Commit

Permalink
Update 3 files
Browse files Browse the repository at this point in the history
  • Loading branch information
SantiiRepair committed Aug 5, 2023
1 parent bca1d41 commit cda4efc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
5 changes: 2 additions & 3 deletions tlg_bot/kreacher/plugins/leave.py
Original file line number Diff line number Diff line change
Expand Up @@ -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("<i>Goodbye master, just call me if you need me. \n\nVoice Chat left successfully.</i>", parse_mode="HTML")
except Exception as e:
Expand Down
3 changes: 1 addition & 2 deletions tlg_bot/kreacher/plugins/new.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions tlg_bot/kreacher/plugins/play_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,11 @@ async def play_video(event):

else:
await msg.edit("🔄 <i>Starting Live Video Stream...</i>", 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"▶️ <i>Started [Video Streaming]({url})!</i>",
Expand Down

0 comments on commit cda4efc

Please sign in to comment.