Return custom User from sign_in/sign_up

This commit is contained in:
Lonami Exo 2022-02-17 11:15:11 +01:00
parent 1029c38d7e
commit 5c6fdf9a71
4 changed files with 6 additions and 3 deletions

View File

@ -297,7 +297,7 @@ async def _update_session_state(self, user, save=True):
)
self._phone_code_hash = None
return user
return _custom.User._new(self, user)
async def _replace_session_state(self, *, save=True, **changes):

View File

@ -15,4 +15,6 @@ from ._custom import (
InlineResults,
QRLogin,
ParticipantPermissions,
Chat,
User,
)

View File

@ -12,3 +12,5 @@ from .inlineresult import InlineResult
from .inlineresults import InlineResults
from .qrlogin import QRLogin
from .participantpermissions import ParticipantPermissions
from .chat import Chat
from .user import User

View File

@ -11,7 +11,7 @@ from .inputfile import InputFile
from .inputmessage import InputMessage
from .button import build_reply_markup
from ..._misc import utils, helpers, tlobject, markdown, html
from ... import _tl, _misc
from ..._sessions.types import Entity
if TYPE_CHECKING:
@ -181,7 +181,6 @@ class User:
self._user = user
self._full = None
raise RuntimeError('self._i_need_to_include_participant_info')
return self