I'm trying to build an automated bot using WTelegramClient
that forwards messages from one Telegram group to another. The process works fine for existing accounts, but I encounter a problem when attempting to sign up with a new phone number.
The goal is to automate the signup process and then forward messages between groups. However, if there’s no existing account with the given phone number, WTelegramClient does not seem to send an SMS verification code as expected.
I read the README, and it mentions that WTelegramClient
handles account signup, but I can’t get it to work. Here’s what I’ve tried so far:
What I’ve Done:
Successfully logged in with existing accounts and forwarded messages between groups.
When I try with a new phone number (no existing Telegram account), the code just stops at the point where it should send an SMS but doesn’t trigger the actual signup flow.
What I Want:
Automate the signup process for new phone numbers using WTelegramClient
and have it send the SMS verification code when there's no existing account.
Forward messages after the account is created.
Question:
How can I automate the signup for new accounts with WTelegramClient
? Is there something I need to do manually beforehand to ensure the signup process is handled correctly?
NOTE: rewritten with chat gpt
Since 18 Feb 2023, Telegram no longer send verification code by SMS when trying to connect with 3rd-party libraries like WTelegramClient
You have to sign up normally using an official client first (which can receive a verification code by SMS).
Then you can use WTelegramClient to login and the verification code for its session will be sent via the official client.