mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-04 04:00:18 +03:00
merge upstream
This commit is contained in:
commit
25d8b22a8f
|
@ -93,8 +93,11 @@ class TLObject:
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def serialize_bytes(data):
|
def serialize_bytes(data):
|
||||||
"""Write bytes by using Telegram guidelines"""
|
"""Write bytes by using Telegram guidelines"""
|
||||||
|
if not isinstance(data, bytes):
|
||||||
if isinstance(data, str):
|
if isinstance(data, str):
|
||||||
data = data.encode('utf-8')
|
data = data.encode('utf-8')
|
||||||
|
else:
|
||||||
|
raise ValueError('bytes or str expected, not', type(data))
|
||||||
|
|
||||||
r = []
|
r = []
|
||||||
if len(data) < 254:
|
if len(data) < 254:
|
||||||
|
|
|
@ -119,10 +119,10 @@ class UpdateState:
|
||||||
handler(update)
|
handler(update)
|
||||||
except StopIteration:
|
except StopIteration:
|
||||||
break
|
break
|
||||||
except Exception as e:
|
except:
|
||||||
# We don't want to crash a worker thread due to any reason
|
# We don't want to crash a worker thread due to any reason
|
||||||
self._logger.debug(
|
self._logger.exception(
|
||||||
'[ERROR] Unhandled exception on worker {}'.format(wid), e
|
'[ERROR] Unhandled exception on worker {}'.format(wid)
|
||||||
)
|
)
|
||||||
|
|
||||||
def process(self, update):
|
def process(self, update):
|
||||||
|
|
1
telethon_generator/__init__.py
Normal file
1
telethon_generator/__init__.py
Normal file
|
@ -0,0 +1 @@
|
||||||
|
|
|
@ -45,7 +45,7 @@ PHONE_NUMBER_OCCUPIED=The phone number is already in use
|
||||||
PHONE_NUMBER_UNOCCUPIED=The phone number is not yet being used
|
PHONE_NUMBER_UNOCCUPIED=The phone number is not yet being used
|
||||||
PHOTO_INVALID_DIMENSIONS=The photo dimensions are invalid
|
PHOTO_INVALID_DIMENSIONS=The photo dimensions are invalid
|
||||||
TYPE_CONSTRUCTOR_INVALID=The type constructor is invalid
|
TYPE_CONSTRUCTOR_INVALID=The type constructor is invalid
|
||||||
USERNAME_INVALID=Unacceptable username. Must match r"[a-zA-Z][\w\d]{4,31}"
|
USERNAME_INVALID=Unacceptable username. Must match r"[a-zA-Z][\w\d]{3,30}[a-zA-Z\d]"
|
||||||
USERNAME_NOT_MODIFIED=The username is not different from the current username
|
USERNAME_NOT_MODIFIED=The username is not different from the current username
|
||||||
USERNAME_NOT_OCCUPIED=The username is not in use by anyone else yet
|
USERNAME_NOT_OCCUPIED=The username is not in use by anyone else yet
|
||||||
USERNAME_OCCUPIED=The username is already taken
|
USERNAME_OCCUPIED=The username is already taken
|
||||||
|
|
Loading…
Reference in New Issue
Block a user