Closed MarshalX closed 3 years ago
Read comments in base class to understand what is need to implement https://github.com/MarshalX/tgcalls/blob/add-custom-mtproto-clients-support/pytgcalls/pytgcalls/mtproto/base_bridge.py
TODO optional deps (telethon) https://setuptools.readthedocs.io/en/latest/userguide/dependency_management.html#optional-dependencies
ParticipantWrapper
renamed to GroupCallParticipantWrapper
To install pytgcalls version with Telethon support:
pip3 install -U git+https://github.com/MarshalX/tgcalls@add-custom-mtproto-clients-support#subdirectory=pytgcalls
also u need to install the last version of Telethon:
pip3 install -U telethon
some code snippet to run:
from telethon import TelegramClient
from pytgcalls import GroupCallFactory
client = TelegramClient(session_name, api_id, api_hash)
client.start()
group_call_factory = GroupCallFactory(client, GroupCallFactory.MTPROTO_CLIENT_TYPE.TELETHON)
group_call = group_call_factory.get_file_group_call('input.raw')
await group_call.start('@tgcallschat')
# and some idle here
nice
@MarshalX commented on Jul 16, 2021, 4:58 PM GMT+3:
To install pytgcalls version with Telethon support:
pip3 install -U git+https://github.com/MarshalX/tgcalls@add-custom-mtproto-clients-support#subdirectory=pytgcalls
also u need to install the last version of Telethon:
pip3 install -U telethon
some code snippet to run:
from telethon import TelegramClient from pytgcalls import GroupCallFactory client \= TelegramClient(session_name, api_id, api_hash) client.start() group_call_factory \= GroupCallFactory(client, GroupCallFactory.MTPROTO_CLIENT_TYPE.TELETHON) group_call \= group_call_factory.get_file_group_call('input.raw') await group_call.start('@tgcallschat') # and some idle here
from telethon import TelegramClient from pytgcalls import GroupCallFactory
import asyncio
async def main():
await client.start()
group_call_factory = GroupCallFactory(client, GroupCallFactory.MTPROTO_CLIENT_TYPE.TELETHON)
group_call = group_call_factory.get_file_group_call('input.raw')
await group_call.start('@tgcallschat')
if __name__ == "__main__":
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
Superb
Ability to implement custom mtproto client was added in #96
Whats need to know:
Snippet how to create factory with Telethon MTProto bridge:
there
client
is Telethon app.After that you can create file, device or raw group call instance: