Added typehints for init methods of types and methods (#1245)

* Generate init

* Fixed mypy errors

* Bump butcher

* Added changelog
This commit is contained in:
Alex Root Junior 2023-08-04 00:30:27 +03:00 committed by GitHub
parent aea876dfe0
commit 11dc7eaa31
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
257 changed files with 7275 additions and 247 deletions

View file

@ -1,6 +1,6 @@
from __future__ import annotations
from typing import Optional, Union
from typing import TYPE_CHECKING, Any, Optional, Union
from ..types import Message
from ..types.base import UNSET_PROTECT_CONTENT
@ -29,3 +29,32 @@ class ForwardMessage(TelegramMethod[Message]):
"""Sends the message `silently <https://telegram.org/blog/channels-2-0#silent-messages>`_. Users will receive a notification with no sound."""
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT
"""Protects the contents of the forwarded message from forwarding and saving"""
if TYPE_CHECKING:
# DO NOT EDIT MANUALLY!!!
# This section was auto-generated via `butcher`
def __init__(
__pydantic__self__,
*,
chat_id: Union[int, str],
from_chat_id: Union[int, str],
message_id: int,
message_thread_id: Optional[int] = None,
disable_notification: Optional[bool] = None,
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
**__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__(
chat_id=chat_id,
from_chat_id=from_chat_id,
message_id=message_id,
message_thread_id=message_thread_id,
disable_notification=disable_notification,
protect_content=protect_content,
**__pydantic_kwargs,
)