mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-02-18 04:20:57 +03:00
Make phone and password kwargs in start
This commit is contained in:
parent
5c6fdf9a71
commit
77a98fed2c
|
@ -983,3 +983,4 @@ send_code_request now returns a custom type (reducing raw api).
|
|||
sign_in no longer has phone or phone_hash (these are impl details, and now it's less error prone). also mandatory code=. also no longer is a no-op if already logged in. different error for sign up required.
|
||||
send code / sign in now only expect a single phone. resend code with new phone is send code, not resend.
|
||||
sign_up code is also now a kwarg. and no longer noop if already loggedin.
|
||||
start also mandates phone= or password= as kwarg.
|
||||
|
|
|
@ -313,9 +313,9 @@ class TelegramClient:
|
|||
@forward_call(auth.start)
|
||||
def start(
|
||||
self: 'TelegramClient',
|
||||
*,
|
||||
phone: typing.Callable[[], str] = lambda: input('Please enter your phone (or bot token): '),
|
||||
password: typing.Callable[[], str] = lambda: getpass.getpass('Please enter your password: '),
|
||||
*,
|
||||
bot_token: str = None,
|
||||
code_callback: typing.Callable[[], typing.Union[str, int]] = None,
|
||||
first_name: str = 'New User',
|
||||
|
|
Loading…
Reference in New Issue
Block a user