'Joining voice call without joining group using telethon, pytgcalls

Is it possible to join a voice call in a group, without joining the group? In Telegram client you can do it, but I couldn't figure out how to do it using telethon.



Solution 1:[1]

Sure, use this. I think it's pretty easy to understand.

from telethon import TelegramClient, sync
from pytgcalls import idle
from pytgcalls import PyTgCalls
from pytgcalls import StreamType
from pytgcalls.types.input_stream import InputAudioStream
from pytgcalls.types.input_stream import InputStream



client = TelegramClient(
        'session_name',
        API_ID,
        API_HASH
    )
client.connect()
group = client.get_entity('https://t.me/group_link')
client.disconnect()
call_py = PyTgCalls(client)
call_py.start()
call_py.join_group_call(
    group.id,
    InputStream(
        InputAudioStream(
            'input.raw',
        ),
    ),
    stream_type=StreamType().local_stream,
)
idle()

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Juggernaut