mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Added typehints for init methods of types and methods (#1245)
* Generate init * Fixed mypy errors * Bump butcher * Added changelog
This commit is contained in:
parent
aea876dfe0
commit
11dc7eaa31
257 changed files with 7275 additions and 247 deletions
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import List, Optional
|
||||
from typing import TYPE_CHECKING, Any, List, Optional
|
||||
|
||||
from ..types import InputFile
|
||||
from .base import TelegramMethod
|
||||
|
|
@ -40,3 +40,34 @@ class SetWebhook(TelegramMethod[bool]):
|
|||
"""Pass :code:`True` to drop all pending updates"""
|
||||
secret_token: Optional[str] = None
|
||||
"""A secret token to be sent in a header 'X-Telegram-Bot-Api-Secret-Token' in every webhook request, 1-256 characters. Only characters :code:`A-Z`, :code:`a-z`, :code:`0-9`, :code:`_` and :code:`-` are allowed. The header is useful to ensure that the request comes from a webhook set by you."""
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This section was auto-generated via `butcher`
|
||||
|
||||
def __init__(
|
||||
__pydantic__self__,
|
||||
*,
|
||||
url: str,
|
||||
certificate: Optional[InputFile] = None,
|
||||
ip_address: Optional[str] = None,
|
||||
max_connections: Optional[int] = None,
|
||||
allowed_updates: Optional[List[str]] = None,
|
||||
drop_pending_updates: Optional[bool] = None,
|
||||
secret_token: Optional[str] = None,
|
||||
**__pydantic_kwargs: Any,
|
||||
) -> None:
|
||||
# DO NOT EDIT MANUALLY!!!
|
||||
# This method was auto-generated via `butcher`
|
||||
# Is needed only for type checking and IDE support without any additional plugins
|
||||
|
||||
super().__init__(
|
||||
url=url,
|
||||
certificate=certificate,
|
||||
ip_address=ip_address,
|
||||
max_connections=max_connections,
|
||||
allowed_updates=allowed_updates,
|
||||
drop_pending_updates=drop_pending_updates,
|
||||
secret_token=secret_token,
|
||||
**__pydantic_kwargs,
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue