Telethon 未发送代码以使用 send_code_request 注册新号码

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")

我正在尝试请求注册码 我希望使用此方法创建新帐户

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

其实我的问题是:

  1. 如果不需要,我们是否需要现有客户端来执行此方法 - 我该如何实现..
  2. Sign_up Method Needs Self 这里做什么?
  3. 这个方法真的有用吗?我还需要其他方法吗?

phone号码是国际格式? 国家代码 + phone 号码

马来西亚示例 phone:60123456789,其中 60 是国家代码,123456789 是 phone 号码。

为此我犯了一些小错误.. 应该已经有客户端,您可以从该客户端创建它