Tgcalls

Latest version: v2.0.0

Safety actively analyzes 626740 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

2.1.0

Ways to register own callback

1:
python
async def participants_are_updated(group_call, participants):
print(f'Updated participant list: {participants}')

group_call.on_participant_list_updated(participants_are_updated)


2:
python
group_call.on_participant_list_updated
async def participants_are_updated(group_call, participants):
print(f'Updated participant list: {participants}')


3:
python
async def participants_are_updated(group_call, participants):
print(f'Updated participant list: {participants}')

group_call.add_handler(participants_are_updated, GroupCallAction.PARTICIPANT_LIST_UPDATED)


Output

Telethon:

Updated participant list: [<GroupCallParticipantWrapper>({'peer': <telethon.tl.types.PeerChannel object at 0x10eb4a5b0>, 'date': datetime.datetime(2021, 8, 22, 15, 35, 51, tzinfo=datetime.timezone.utc), 'source': 1382476690, 'muted': True, 'left': False, 'can_self_unmute': True, 'just_joined': False, 'versioned': False, 'min': False, 'muted_by_you': False, 'volume_by_admin': True, 'is_self': False, 'video_joined': False, 'active_date': None, 'volume': None, 'about': '🧑🏻\u200d💻DEV. More info inside...', 'raise_hand_rating': None})]


Pyrogram:

Updated participant list: [<GroupCallParticipantWrapper>({'peer': pyrogram.raw.types.PeerChannel(channel_id=1359572958), 'date': 1629646551, 'source': 1382476690, 'muted': True, 'left': False, 'can_self_unmute': True, 'just_joined': False, 'versioned': False, 'min': False, 'muted_by_you': False, 'volume_by_admin': True, 'is_self': False, 'video_joined': None, 'active_date': None, 'volume': None, 'about': '🧑🏻\u200d💻DEV. More info inside...', 'raise_hand_rating': None})]

2.0.0

Introduce

You are able to install library on Windows without WSL now. The dependencies have been updated to the latest versions. The updated Telegram tgcalls now has the ability to work with group video calls. Wait for the next major update. A lot of work has been done in this update to improve communication between Python and C++ tgcalls via binding. Fixed all problems with pointers. C++ native instances are now fully deconstructed correctly.

Major

- There is no `RuntimeError` now. New exceptions: `PytgcallsError`, `CallBeforeStartError`, `NotConnectedError`, `GroupCallNotFoundError`;
- `set_is_mute` method is async now. You need to call it with `await` statement;
- `isGroupCallStarted` native method was renamed to `isGroupCallNativeCreated`.

Minor

- `print_available_playout_devices` and `print_available_recording_devices` methods of `GroupCall` now deprecated and **will be removed** soon;
- add `get_playout_devices` and `get_recording_devices` methods to get information about system audio devices (names and guids);
- add ability to change outgoing audio bitrate (`outgoing_audio_bitrate_kbit` argument in constructor of `GroupCallFactory`);
- add new native methods to implement right flow with stopping and destroying instances (`stopAudioDeviceModule`, `startAudioDeviceModule`);
- switch to smart-holder version of pybind11;
- migrate to smart pointers in main parts of Python binding.

Patch

- Improve debug logging messages;
- rework waiting from sleeps to asyncio events;
- fix invalid reconnects by adding `pre_update_processing` to `join_group_call` with setting ssrc before handling of updates;
- fix displaying of mute status in group call for another participants;
- fix group call deconstruction from Python;
- fix issue with memory de-allocation;
- fix issues with pointers.

Happy coding ❤️

1.0.0

Introduce

**Now pytgcalls supports both the most popular MTProto clients! Pyrogram and Telethon ✨**

Starting from 1.0.0 you are able to implement your own MTProto bridges as easy as you wish!

New installing options

Starting from installing the library, you need to choose with which client you will work.

For Pyrogram:
bash
pip3 install pytgcalls[pyrogram]

For Telethon:
bash
pip3 install pytgcalls[telethon]


Of course, you can manually install requires, but please pay your attention to minimal required version of these libs.

New way to create `GroupCall` instances

Now we have one class called `GroupCallFactory` to create `GroupCall` instances of any types. You can find examples of new way in this discussion: https://github.com/MarshalX/tgcalls/discussions/101

FAQ

Q: Will previous code base work with new version of library?
A: Everything is individual. I made backward compatibility for the old code, which will notify the user about outdated ways of creating instances, but this will not save you from dirty hacks that could be used in your code.

Q: How to use this library with Telethon?
A: We already have a [code snippet](https://github.com/MarshalX/tgcalls/blob/main/README.md#telethons-snippet) in the main README file. Also, we have pretty and simple [examples](https://github.com/MarshalX/tgcalls/tree/main/examples) what works with Telethon too!

Q: What was done in this version?
A: In this version was optimized requests to MTProto, reworked system of connection, reconnection and disconnection. Now you can stop connection at any time and so on. Was added working with _default_join_as_ value. Was fixed several bugs.

Happy coding ❤️

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.