pytgcalls / pytgcalls

Async client API for the Telegram Calls
http://pytgcalls.github.io/
GNU Lesser General Public License v3.0
283 stars 163 forks source link

pytgcalls.exceptions.NoActiveGroupCall: No active group call #174

Closed magnusso closed 1 year ago

magnusso commented 1 year ago

Describe the bug Simplest possible example generates exception. Please give some hint of what is going wrong. In the Telegram group, what should one do to facilitate the streaming? I've tried starting a group call, it had no effect. Further, can Pytcalls proactively start a group call? The plan is to send the video stream from a surveillance camera when motion is detected.

To Reproduce

import os
import time
from telethon import TelegramClient
from pytgcalls import idle
from pytgcalls import PyTgCalls
from pytgcalls.types import AudioPiped

app = TelegramClient('py-tgcalls',api_id=xxxxxxxxxx ,api_hash='yyyyyyyyyyyyyyyyyyy')
call_py = PyTgCalls(app)
call_py.start()
call_py.join_group_call(-zzzzzzzzzzzzzzzzzzzz, AudioPiped('http://docs.evostream.com/sample_content/assets/sintel1m720p.mp4'))
idle()

Expected behavior Some progress, instead of the error.

Log

`Traceback (most recent call last):
  File "/home/pi/tt2.py", line 12, in <module>
    call_py.join_group_call(-611527117, AudioPiped('http://docs.evostream.com/sample_content/assets/sintel1m720p.mp4'))
  File "/usr/local/lib/python3.9/dist-packages/pytgcalls/sync.py", line 35, in async_to_sync_wrap
    return loop.run_until_complete(coroutine)
  File "/usr/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
    return future.result()
  File "/usr/local/lib/python3.9/dist-packages/pytgcalls/methods/groups/join_group_call.py", line 292, in join_group_call
    raise NoActiveGroupCall()
pytgcalls.exceptions.NoActiveGroupCall: No active group call
magnusso commented 1 year ago

There just a few participants. Just to get the setup clear: how is supposed to start the group all? Using what role, does pytgcalls join the call? Can pytgcalls initiate a call, how? I would like pytgcalls to a group in case of a line crossing event. The line crossing event originates from a surveillance camera feed.

Laky-64 commented 1 year ago

In this case you need to use Pyrogram or Telethon raw methods to initiate a group call

basevich commented 1 year ago

Had the same issue and solved it by authorizing as a user (phone number) instead of a bot (token)