mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-26 19:33:45 +03:00
Fix accept TOS must be called after sign up (#824)
This commit is contained in:
parent
997f2b62ce
commit
fe3172b2c9
|
@ -503,10 +503,8 @@ class TelegramClient(TelegramBareClient):
|
|||
t = self.parse_mode.unparse(self._tos.text, self._tos.entities)
|
||||
else:
|
||||
t = self._tos.text
|
||||
sys.stderr.write("By signing up you agree to Telegram's TOS:"
|
||||
"\n{}\n".format(t))
|
||||
sys.stderr.write("{}\n".format(t))
|
||||
sys.stderr.flush()
|
||||
self(AcceptTermsOfServiceRequest(self._tos.id))
|
||||
|
||||
result = self(SignUpRequest(
|
||||
phone_number=self._phone,
|
||||
|
@ -516,6 +514,9 @@ class TelegramClient(TelegramBareClient):
|
|||
last_name=last_name
|
||||
))
|
||||
|
||||
if self._tos:
|
||||
self(AcceptTermsOfServiceRequest(self._tos.id))
|
||||
|
||||
self._self_input_peer = utils.get_input_peer(
|
||||
result.user, allow_self=False
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue
Block a user