mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-02-03 13:14:31 +03:00
Add lru_cache decorator to .get_entity()
This commit is contained in:
parent
83f9cafabf
commit
a76c31ede2
|
@ -1,6 +1,7 @@
|
||||||
import os
|
import os
|
||||||
import threading
|
import threading
|
||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
|
from functools import lru_cache
|
||||||
from mimetypes import guess_type
|
from mimetypes import guess_type
|
||||||
from threading import Thread
|
from threading import Thread
|
||||||
|
|
||||||
|
@ -850,6 +851,7 @@ class TelegramClient(TelegramBareClient):
|
||||||
|
|
||||||
# region Small utilities to make users' life easier
|
# region Small utilities to make users' life easier
|
||||||
|
|
||||||
|
@lru_cache()
|
||||||
def get_entity(self, entity):
|
def get_entity(self, entity):
|
||||||
"""Turns an entity into a valid Telegram user or chat.
|
"""Turns an entity into a valid Telegram user or chat.
|
||||||
If "entity" is a string, and starts with '+', or if
|
If "entity" is a string, and starts with '+', or if
|
||||||
|
|
Loading…
Reference in New Issue
Block a user