mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-02-18 12:30:59 +03:00
Avoid more cyclic imports on the session file
This commit is contained in:
parent
f4182376f1
commit
3c686fecdf
|
@ -2,12 +2,13 @@ import json
|
||||||
import os
|
import os
|
||||||
import platform
|
import platform
|
||||||
import sqlite3
|
import sqlite3
|
||||||
|
import struct
|
||||||
import time
|
import time
|
||||||
from base64 import b64decode
|
from base64 import b64decode
|
||||||
from os.path import isfile as file_exists
|
from os.path import isfile as file_exists
|
||||||
from threading import Lock
|
from threading import Lock
|
||||||
|
|
||||||
from .. import utils, helpers
|
from .. import utils
|
||||||
from ..tl import TLObject
|
from ..tl import TLObject
|
||||||
from ..tl.types import (
|
from ..tl.types import (
|
||||||
PeerUser, PeerChat, PeerChannel,
|
PeerUser, PeerChat, PeerChannel,
|
||||||
|
@ -62,7 +63,7 @@ class Session:
|
||||||
self.save_entities = True
|
self.save_entities = True
|
||||||
self.flood_sleep_threshold = 60
|
self.flood_sleep_threshold = 60
|
||||||
|
|
||||||
self.id = helpers.generate_random_long(signed=True)
|
self.id = struct.unpack('q', os.urandom(8))[0]
|
||||||
self._sequence = 0
|
self._sequence = 0
|
||||||
self.time_offset = 0
|
self.time_offset = 0
|
||||||
self._last_msg_id = 0 # Long
|
self._last_msg_id = 0 # Long
|
||||||
|
|
Loading…
Reference in New Issue
Block a user