ResendCodeRequest

Only users can use this method. See code examples.

---functions---
auth.resendCode#3ef1a9bf phone_number:string phone_code_hash:string = auth.SentCode

Returns

auth.SentCode

This type can only be an instance of:

SentCode

Parameters

phone_numberstring
phone_code_hashstring

Known RPC errors

This request can cause 2 known errors:

PhoneNumberInvalidErrorThe phone number is invalid.
SendCodeUnavailableError.

You can import these from telethon.errors.

Example

Please refer to the documentation of client.send_code_request() to learn about the parameters and see several code examples on how to use it.

The method above is the recommended way to do it. If you need more control over the parameters or want to learn how it is implemented, open the details by clicking on the "Details" text.

from telethon.sync import TelegramClient
from telethon import functions, types

with TelegramClient(name, api_id, api_hash) as client:
    result = client(functions.auth.ResendCodeRequest(
        phone_number='some string here',
        phone_code_hash='some string here'
    ))
    print(result.stringify())