Update type hints across the codebase (#1749)

* Update type hints across the codebase

* Added changelog record
This commit is contained in:
Alex Root Junior 2026-01-02 02:50:46 +02:00 committed by GitHub
parent dcff0f99c7
commit 0306695b61
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
307 changed files with 6190 additions and 6385 deletions

View file

@ -1,6 +1,6 @@
from __future__ import annotations
from typing import TYPE_CHECKING, Any, Optional
from typing import TYPE_CHECKING, Any
from ..types import MenuButtonUnion
from .base import TelegramMethod
@ -16,9 +16,9 @@ class SetChatMenuButton(TelegramMethod[bool]):
__returning__ = bool
__api_method__ = "setChatMenuButton"
chat_id: Optional[int] = None
chat_id: int | None = None
"""Unique identifier for the target private chat. If not specified, default bot's menu button will be changed"""
menu_button: Optional[MenuButtonUnion] = None
menu_button: MenuButtonUnion | None = None
"""A JSON-serialized object for the bot's new menu button. Defaults to :class:`aiogram.types.menu_button_default.MenuButtonDefault`"""
if TYPE_CHECKING:
@ -28,8 +28,8 @@ class SetChatMenuButton(TelegramMethod[bool]):
def __init__(
__pydantic__self__,
*,
chat_id: Optional[int] = None,
menu_button: Optional[MenuButtonUnion] = None,
chat_id: int | None = None,
menu_button: MenuButtonUnion | None = None,
**__pydantic_kwargs: Any,
) -> None:
# DO NOT EDIT MANUALLY!!!