mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-09 13:29:47 +00:00
Move TelegramClient.list_sessions to *Session.list_session
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
import platform
|
||||
from datetime import timedelta
|
||||
from mimetypes import guess_type
|
||||
from os import listdir, path
|
||||
from threading import Event, RLock, Thread
|
||||
from time import sleep
|
||||
|
||||
@@ -364,13 +362,6 @@ class TelegramClient(TelegramBareClient):
|
||||
except UnauthorizedError:
|
||||
return None
|
||||
|
||||
@staticmethod
|
||||
def list_sessions():
|
||||
"""Lists all the sessions of the users who have ever connected
|
||||
using this client and never logged out"""
|
||||
return [path.splitext(path.basename(f))[0]
|
||||
for f in listdir('.') if f.endswith('.session')]
|
||||
|
||||
# endregion
|
||||
|
||||
# region Dialogs ("chats") requests
|
||||
|
Reference in New Issue
Block a user