Exemple #1
0
async def send_phone(client: Client, phone: str) -> (AuthState, str):
    """
    :return str:
            Type of the current sent code.
            Can be *"app"* (code sent via Telegram), *"sms"* (code sent via SMS), *"call"* (code sent via voice call) or
            *"flash_call"* (code is in the last 5 digits of the caller's phone number).
    """

    sent_code = await client.send_code(phone)
    client.phone_number = phone
    client.session.sent_code = sent_code
    return AuthState.WAIT_FOR_CODE, sent_code.type