mirror of
https://github.com/TeamPGM/pyrogram.git
synced 2024-11-16 04:35:24 +00:00
parent
823192a393
commit
0d2bd64871
@ -1,5 +1,6 @@
|
||||
id message
|
||||
2FA_CONFIRM_WAIT_X A wait of {value} seconds is required because this account is active and protected by a 2FA password
|
||||
FLOOD_PREMIUM_WAIT_X A wait of {value} seconds is required
|
||||
FLOOD_TEST_PHONE_WAIT_X A wait of {value} seconds is required in the test servers
|
||||
FLOOD_WAIT_X A wait of {value} seconds is required
|
||||
PREMIUM_SUB_ACTIVE_UNTIL_X A wait of {value} seconds is required
|
||||
|
|
@ -44,7 +44,8 @@ from pyrogram.errors import CDNFileHashMismatch
|
||||
from pyrogram.errors import (
|
||||
SessionPasswordNeeded,
|
||||
VolumeLocNotFound, ChannelPrivate,
|
||||
BadRequest, AuthBytesInvalid
|
||||
BadRequest, AuthBytesInvalid,
|
||||
FloodWait, FloodPremiumWait
|
||||
)
|
||||
from pyrogram.handlers.handler import Handler
|
||||
from pyrogram.methods import Methods
|
||||
@ -863,7 +864,7 @@ class Client(Methods):
|
||||
if isinstance(e, asyncio.CancelledError):
|
||||
raise e
|
||||
|
||||
if isinstance(e, pyrogram.errors.FloodWait):
|
||||
if isinstance(e, (FloodWait, FloodPremiumWait)):
|
||||
raise e
|
||||
|
||||
return None
|
||||
@ -1097,7 +1098,7 @@ class Client(Methods):
|
||||
await cdn_session.stop()
|
||||
except pyrogram.StopTransmission:
|
||||
raise
|
||||
except pyrogram.errors.FloodWait:
|
||||
except (FloodWait, FloodPremiumWait):
|
||||
raise
|
||||
except Exception as e:
|
||||
log.exception(e)
|
||||
|
@ -28,7 +28,7 @@ from pyrogram import raw
|
||||
from pyrogram.connection import Connection
|
||||
from pyrogram.crypto import mtproto
|
||||
from pyrogram.errors import (
|
||||
RPCError, InternalServerError, AuthKeyDuplicated, FloodWait, ServiceUnavailable, BadMsgNotification,
|
||||
RPCError, InternalServerError, AuthKeyDuplicated, FloodWait, FloodPremiumWait, ServiceUnavailable, BadMsgNotification,
|
||||
SecurityCheckMismatch
|
||||
)
|
||||
from pyrogram.raw.all import layer
|
||||
@ -397,7 +397,7 @@ class Session:
|
||||
while True:
|
||||
try:
|
||||
return await self.send(query, timeout=timeout)
|
||||
except FloodWait as e:
|
||||
except (FloodWait, FloodPremiumWait) as e:
|
||||
amount = e.value
|
||||
|
||||
if amount > sleep_threshold >= 0:
|
||||
|
Loading…
Reference in New Issue
Block a user