mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Remove filters factory, introduce docs translation (#978)
* Rewrite filters * Update README.rst * Fixed tests * Small optimization of the Text filter (TY to @bomzheg) * Remove dataclass slots argument in due to the only Python 3.10 has an slots argument * Fixed mypy * Update tests * Disable Python 3.11 * Fixed #1013: Empty mention should be None instead of empty string. * Added #990 to the changelog * Added #942 to the changelog * Fixed coverage * Update poetry and dependencies * Fixed mypy * Remove deprecated code * Added more tests, update pyproject.toml * Partial update docs * Added initial Docs translation files * Added more changes * Added log message when connection is established in polling process * Fixed action * Disable lint for PyPy * Added changelog for docs translation
This commit is contained in:
parent
94030903ec
commit
f4251382e8
610 changed files with 61738 additions and 1687 deletions
|
|
@ -1,7 +1,4 @@
|
|||
from textwrap import indent
|
||||
from typing import List, Optional, Set
|
||||
|
||||
from pydantic import ValidationError
|
||||
from typing import Optional
|
||||
|
||||
from aiogram.methods import TelegramMethod
|
||||
from aiogram.methods.base import TelegramType
|
||||
|
|
@ -107,17 +104,3 @@ class RestartingTelegram(TelegramServerError):
|
|||
|
||||
class TelegramEntityTooLarge(TelegramNetworkError):
|
||||
url = "https://core.telegram.org/bots/api#sending-files"
|
||||
|
||||
|
||||
class FiltersResolveError(DetailedAiogramError):
|
||||
def __init__(self, unresolved_fields: Set[str], possible_cases: List[ValidationError]) -> None:
|
||||
possible_cases_str = "\n".join(
|
||||
" - " + indent(str(e), " " * 4).lstrip() for e in possible_cases
|
||||
)
|
||||
message = f"Unknown keyword filters: {unresolved_fields}"
|
||||
if possible_cases_str:
|
||||
message += f"\n Possible cases:\n{possible_cases_str}"
|
||||
|
||||
super().__init__(message=message)
|
||||
self.unresolved_fields = unresolved_fields
|
||||
self.possible_cases = possible_cases
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue