pylakey/aiotdlib

But how can I register new users without manually entering the registration code?

hwmbing11 opened this issue · 2 comments

This project is great. Thank the author

But how can I register new users without manually entering the registration code?
And first_name and last_name
It is to pass the verification code to aiotdlib by passing parameters

You can inherit aiotdlib.Client class and override its methods with your logic.

Something like this:

import aiotdlib


class CustomClient(aiotdlib.Client):
    async def __auth_get_code(self) -> str:
        # TODO: Make http request or read code from file
        pass

    async def __auth_get_first_name(self) -> str:
        # TODO: Make http request or read first_name from file
        pass

    async def __auth_get_last_name(self) -> str:
        # TODO: Make http request or read last_name from file
        pass

    async def __auth_get_password(self) -> str:
        # TODO: Make http request or read password from file
        pass

Thank you very much for your reply