MarshalX / tgcalls

Voice chats, private incoming and outgoing calls in Telegram for Developers
https://t.me/tgcallslib
GNU Lesser General Public License v3.0
514 stars 91 forks source link

AttributeError: 'Client' object has no attribute 'send' #189

Closed huco95 closed 1 year ago

huco95 commented 1 year ago

Hi,

I am trying to make a simple call but I keep getting this error AttributeError: 'Client' object has no attribute 'send'. This is the code i am using. The text message is sent successfully but not the call. Any idea what is wrong? Thanks!

import asyncio
from pyrogram import Client

from pytgcalls import GroupCallFactory

api_id = 0
api_hash = ''
bot_token = ''
chat_id = 0

async def main():
    async with Client("Alerts", api_id=api_id, api_hash=api_hash, bot_token=bot_token) as client:
        group_call = GroupCallFactory(client).get_file_group_call("input.raw")
        await client.send_message(chat_id=chat_id, text="Hi!")
        await group_call.start(group=chat_id)

asyncio.run(main())

Trace:


Traceback (most recent call last):
  File "C:\Users\fenos\OneDrive\Documentos\Proyectos\TelgramCall\main.py", line 17, in <module>
    return loop.run_until_complete(main)
  File "C:\Users\fenos\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 649, in run_until_complete
    return future.result()
  File "C:\Users\fenos\OneDrive\Documentos\Proyectos\TelgramCall\main.py", line 15, in main
    await group_call.start(group=chat_id)
  File "C:\Users\fenos\AppData\Local\Programs\Python\Python310\lib\site-packages\pytgcalls\implementation\group_call.py", line 236, in start   
    group_call = await self.mtproto.get_and_set_group_call(group)
  File "C:\Users\fenos\AppData\Local\Programs\Python\Python310\lib\site-packages\pytgcalls\mtproto\pyrogram_bridge.py", line 142, in get_and_set_group_call
    await (self.client.send(functions.messages.GetFullChat(chat_id=self.chat_peer.chat_id)))AttributeError: 'Client' object has no attribute 'send'
MarshalX commented 1 year ago

Hi. Use dev version

Added support for Pyrogram 2.0

pip install pytgcalls==3.0.0.dev22

Examples for dev versions: https://gist.github.com/MarshalX/3c99fcae532178928d93a7aae6f0efde