Search code examples
python-3.xtelethon

Telethon Is Not sending The Code to Sign up With New Number using send_code_request


ph = input("Enter Phone Number: ")
    async def sign_up():
        try:
            x = await bot.send_code_request(ph, force_sms=True)
            print(x)
        except Exception as e:
            print(e)
            print("Error")
            return
        print("Code Sent")

I am Trying To Request Code to Sign Up and i want this to create New account by using this method

await bot.sign_up(code =code,
    first_name= name, 
    phone = ph)

Actually My Question is:

  1. Do We need Existing Client to do this Method if not - How can i achieve this..
  2. Sign_up Method Needs Self what to do here?
  3. Is this method will really work or do i need any other methods?

Solution

  • For this i made small mistakes.. there should be alredy client and from that client you can create it