mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-08 21:10:29 +00:00
Completely change errors (make one class for each)
This commit is contained in:
16
telethon/errors/rpc_errors_420.py
Normal file
16
telethon/errors/rpc_errors_420.py
Normal file
@@ -0,0 +1,16 @@
|
||||
from . import FloodError
|
||||
|
||||
|
||||
class FloodWaitError(FloodError):
|
||||
def __init__(self, **kwargs):
|
||||
self.seconds = kwargs['extra']
|
||||
super(Exception, self).__init__(
|
||||
self,
|
||||
'A wait of {} seconds is required.'
|
||||
.format(self.seconds)
|
||||
)
|
||||
|
||||
|
||||
rpc_420_errors = {
|
||||
'FLOOD_WAIT_(\d+)': FloodWaitError
|
||||
}
|
Reference in New Issue
Block a user