mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-29 12:53:44 +03:00
Fix get_tos usage of expiry
expires is actually a timestamp, not seconds
This commit is contained in:
parent
503d0859ec
commit
ab150bf457
|
@ -6,6 +6,7 @@ import sys
|
|||
import typing
|
||||
import warnings
|
||||
import functools
|
||||
import time
|
||||
import dataclasses
|
||||
|
||||
from .._misc import utils, helpers, password as pwd_mod
|
||||
|
@ -282,7 +283,7 @@ async def get_tos(self):
|
|||
if first_time or no_tos or tos_expired:
|
||||
result = await self(_tl.fn.help.GetTermsOfServiceUpdate())
|
||||
tos = getattr(result, 'terms_of_service', None)
|
||||
self._tos = (tos, asyncio.get_running_loop().time() + result.expires)
|
||||
self._tos = (tos, asyncio.get_running_loop().time() + result.expires.timestamp() - time.time())
|
||||
|
||||
# not stored in the client to prevent a cycle
|
||||
return _custom.TermsOfService._new(self, *self._tos)
|
||||
|
|
Loading…
Reference in New Issue
Block a user