mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Reworked request builder (#1142)
* Reworked request builder * Added more default values * Update tests * Fixed timestamp * Fixed Py3.8 support * Describe changes
This commit is contained in:
parent
924a83966d
commit
fea1b7b0a3
300 changed files with 1003 additions and 3448 deletions
|
|
@ -1,12 +1,9 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Any, Dict, List
|
||||
from typing import TYPE_CHECKING, List
|
||||
|
||||
from ..types import PassportElementError
|
||||
from .base import Request, TelegramMethod
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..client.bot import Bot
|
||||
from .base import TelegramMethod
|
||||
|
||||
|
||||
class SetPassportDataErrors(TelegramMethod[bool]):
|
||||
|
|
@ -18,13 +15,9 @@ class SetPassportDataErrors(TelegramMethod[bool]):
|
|||
"""
|
||||
|
||||
__returning__ = bool
|
||||
__api_method__ = "setPassportDataErrors"
|
||||
|
||||
user_id: int
|
||||
"""User identifier"""
|
||||
errors: List[PassportElementError]
|
||||
"""A JSON-serialized array describing the errors"""
|
||||
|
||||
def build_request(self, bot: Bot) -> Request:
|
||||
data: Dict[str, Any] = self.dict()
|
||||
|
||||
return Request(method="setPassportDataErrors", data=data)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue