JosXa / tgintegration

Integration test and automation library for Telegram Messenger bots based on Pyrogram.
https://josxa.github.io/tgintegration/
MIT License
119 stars 18 forks source link

Pyrogram.api.error doesn't exist #8

Closed StrangeTcy closed 4 years ago

StrangeTcy commented 4 years ago

Description

What I Did

I've adapted the example for my bot and tried to run it

python3 bot_tester.py

which led to en error:

Traceback (most recent call last):                                                                                                   
  File "bot_tester.py", line 1, in <module>                                                                                          
    from tgintegration import BotController                                                                                          
  File "/usr/local/lib/python3.6/dist-packages/tgintegration/__init__.py", line 3, in <module>                                       
    from tgintegration.botintegrationclient import BotIntegrationClient                                                              
  File "/usr/local/lib/python3.6/dist-packages/tgintegration/botintegrationclient.py", line 9, in <module>                           
    from .interactionclient import InteractionClient                                                                                 
  File "/usr/local/lib/python3.6/dist-packages/tgintegration/interactionclient.py", line 12, in <module>                             
    from pyrogram.api.errors import FloodWait, RpcMcgetFail                                                                          
ModuleNotFoundError: No module named 'pyrogram.api.errors'   

It would seem that in current pyrogram (v 0.17.1) there's no longer a pyrogram.api.error section, and error handling is performed by functions in pyrogram.errors

StrangeTcy commented 4 years ago

Well, apparently you can install tgintegration v 0.2.4 from pypi, and you can also clone the repository and run python setup.py install and get v 0.4.0. ETA: tgintegration v 0.4.0 depends on pyrogram_async, which seems to try importing from a module that doesn't exist: https://github.com/pyrogram/pyrogram/issues/410

JosXa commented 4 years ago

It should depend on asyncio-dev instead. I have kind of given up on the idea of making the library work with both synchronous and asynchronous Pyrogram, so I'm probably going to drop the sync support to reduce complexity. Would that work for everyone? https://t.me/TgIntegration

JosXa commented 4 years ago

https://github.com/JosXa/tgintegration/releases/tag/v1.0 Enjoy :)