Skip to content
This repository has been archived by the owner on Mar 2, 2021. It is now read-only.

Not working in common(not super) groups #2

Closed
L3Nya opened this issue Feb 23, 2021 · 2 comments
Closed

Not working in common(not super) groups #2

L3Nya opened this issue Feb 23, 2021 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@L3Nya
Copy link

L3Nya commented Feb 23, 2021

Starting group call not working in not super groups

Reproduce steps:

  1. try to start group call in common(not super) group
    await GroupCall(...).start(505051194)
  2. get pyrogram error about invalid argument

Fix:
Check GroupCall.chat_peer type in GroupCall.get_group_call method.
If it is raw.types.InputPeerChannel, then use functions.channels.GetFullChannel(channel=self.chat_peer)
else use functions.messages.GetFullChat(chat_id=self.chat_peer.chat_id).

It can also be InputPeerUser and InputPeerSelf, but imo this shouldn't be handled by this library.

@SpEcHiDe
Copy link

😅
https://t.me/tgcallschat/1457

@MarshalX MarshalX added the bug Something isn't working label Feb 23, 2021
@MarshalX MarshalX self-assigned this Feb 23, 2021
@L3Nya
Copy link
Author

L3Nya commented Feb 23, 2021

I have this in pytgcalls/group_call.py.

async def get_group_call(self, group: Union[str, int]):
    self.chat_peer = await self.client.resolve_peer(group)
    if isinstance(self.chat_peer, raw.types.InputPeerChannel):
        self.group_call = (await (self.client.send(functions.channels.GetFullChannel(
            channel=self.chat_peer
        )))).full_chat.call
    elif isinstance(self.chat_peer, raw.types.InputPeerChat):
        self.group_call = (await (self.client.send(functions.messages.GetFullChat(
            chat_id=self.chat_peer.chat_id
        )))).full_chat.call
    else:
        raise RuntimeError('Chat should be group/supergroup')
     return self.group_call

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants