flood exception message

This commit is contained in:
Анатолий Богомолов 2024-02-08 18:00:06 +10:00
parent 94302d09e9
commit 81f97ee3d1
1 changed files with 3 additions and 2 deletions

View File

@ -18,8 +18,9 @@ class FloodException(Exception):
def __init__(self, error, *args: object): def __init__(self, error, *args: object):
self.error = error self.error = error
self.seconds = self.error.seconds if hasattr(self.error, "seconds") else -1 #type: ignore self.seconds = self.error.seconds if hasattr(self.error, "seconds") else -1 #type: ignore
self.message = f"Flood wait for {self.seconds}" if self.seconds > 0 else "Flood error"
super().__init__(*args)
super().__init__(self.message, *args)
class IgnoreException(Exception): class IgnoreException(Exception):
def __init__(self, error, *args): def __init__(self, error, *args):