Update aiogram/utils/keyboard.py

Co-authored-by: Suren Khorenyan <surenkhorenyan@gmail.com>
This commit is contained in:
Alex Root Junior 2024-01-27 18:50:36 +02:00 committed by GitHub
parent 222d48ea09
commit 1dca31ab6d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -141,7 +141,7 @@ class KeyboardBuilder(Generic[ButtonType], ABC):
if not isinstance(size, int):
raise ValueError("Only int sizes are allowed")
if size not in range(self.min_width, self.max_width + 1):
raise ValueError(f"Row size {size} are not allowed")
raise ValueError(f"Row size {size} is not allowed, range: [{self.min_width}, {self.max_width}]")
return size
def export(self) -> List[List[ButtonType]]: