pylakey / aiotdlib

Python asyncio Telegram client based on TDLib https://github.com/tdlib/td
MIT License
103 stars 16 forks source link

How use in windows? #51

Closed t1622742583 closed 4 months ago

t1622742583 commented 2 years ago

my code:

async def main():
    client = Client(
        api_id=API_ID,
        api_hash=API_HASH,
        library_path='./lib',
        phone_number=PHONE_NUMBER
    )

    async with client:
        me = await client.api.get_me()
        logging.info(f"Successfully logged in as {me.json()}")
if __name__ == '__main__':
    logging.basicConfig(level=logging.INFO)
    asyncio.run(main())

error: FileNotFoundError: Could not find module 'D:\Desktop\tg_use_wls\lib' (or one of its dependencies). Try using the full path with constructor syntax.

pylakey commented 2 years ago

You should provide path to tdlib binary, not to directory containing it. For example

client = Client(..., library_path="./lib/tdlib.dll")
arynyklas commented 1 year ago

You should provide path to tdlib binary, not to directory containing it. For example

client = Client(..., library_path="./lib/tdlib.dll")

I don't have tdlib.dll at my td installer dir.

pylakey commented 4 months ago

You have to build a binary yourself. This library provides binaries only for MacOS and Linux.

Please follow build instructions for Windows by TDLib: https://tdlib.github.io/td/build.html?language=Python