Exemplo n.º 1
0
 def sign_up(self, phone_number, code, first_name, last_name=''):
     result = self.invoke(
         SignUpRequest(phone_number=phone_number,
                       phone_code_hash=self.phone_code_hash[phone_number],
                       phone_code=code,
                       first_name=first_name,
                       last_name=last_name))
     self.session.user = result.user
     self.session.save()
Exemplo n.º 2
0
    def sign_up(self, phone_number, code, first_name, last_name=''):
        """Signs up to Telegram. Make sure you sent a code request first!"""
        result = self.invoke(SignUpRequest(phone_number=phone_number,
                                           phone_code_hash=self.phone_code_hashes[phone_number],
                                           phone_code=code,
                                           first_name=first_name,
                                           last_name=last_name))

        self.session.user = result.user
        self.session.save()