Skip to content

Releases: MarshalX/tgcalls

pytgcalls v2.1.0. New event: PARTICIPANT_LIST_UPDATED

22 Aug 18:38
1271137
Compare
Choose a tag to compare

Ways to register own callback

1:

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

group_call.on_participant_list_updated(participants_are_updated)

2:

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

3:

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})]

tgcalls v2.0.0. Wheels for Windows, smart pointers, updated tgcalls with webrtc and more

20 Aug 06:53
3a2a483
Compare
Choose a tag to compare

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 ❤️

tgcalls v1.0.0. First stable release — Telethon support, ability to implement custom MTProto bridges and more

19 Aug 19:34
fef5bc1
Compare
Choose a tag to compare

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:

pip3 install pytgcalls[pyrogram]

For Telethon:

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: #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 in the main README file. Also, we have pretty and simple 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 ❤️