MarshalX / tgcalls

Voice chats, private incoming and outgoing calls in Telegram for Developers
https://t.me/tgcallslib
GNU Lesser General Public License v3.0
506 stars 91 forks source link

freeze after .stop() sometimes #53

Closed dashezup closed 3 years ago

dashezup commented 3 years ago

Sometimes it fully freeze after calling .stop(), handlers and other plugins stops working, the only way to solve this is kill -9 the process and start the userbot again.

Step to reproduce:

  1. start the userbot with the following smart plugin
  2. send !join, prints "joined the VC", wait for a few seconds for joining
  3. send !leave, prints "left the VC", or freeze and can't be closed by pressing CTRL+c

if it prints "left the VC" then repeat from step 2 until reproduce this. Sometimes I reproduce this after the third attempt to !leave, sometimes fifth, could even on the first.

Version: pytgcalls==0.0.12 Code (Pyrogram Smart Plugin):

from pyrogram import Client, filters
from pyrogram.types import Message
from pytgcalls import GroupCall

group_call = GroupCall(None)

@Client.on_message(filters.outgoing
                   & filters.regex("^!join$"))
async def join_group_call(client, m: Message):
    group_call.client = client
    await group_call.start(m.chat.id)
    print("joined the VC")

@Client.on_message(filters.outgoing
                   & filters.regex("^!leave$"))
async def leave_voice_chat(client, m: Message):
    await group_call.stop()
    print("left the VC")

@Client.on_message(filters.outgoing
                   & filters.regex("^!vc$"))
async def list_voice_chat(client, m: Message):
    print(f"VC: {group_call.full_chat.id}")
MarshalX commented 3 years ago

Pls check on 0.0.13

dashezup commented 3 years ago

0.0.13 does not have this issue :+1:

I think this issue can be closed now