Reworked bot-wide defaults (#1392)

* Reworked defaults

* Added changelog and partial docs
This commit is contained in:
Alex Root Junior 2024-01-27 17:19:45 +02:00 committed by GitHub
parent 1281bf551a
commit 24f59da70d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
140 changed files with 608 additions and 530 deletions

View file

@ -4,6 +4,7 @@ from typing import TYPE_CHECKING, Any, Optional, Union
from pydantic import Field
from ..client.default import Default
from ..types import (
ForceReply,
InlineKeyboardMarkup,
@ -12,7 +13,6 @@ from ..types import (
ReplyKeyboardRemove,
ReplyParameters,
)
from ..types.base import UNSET_PROTECT_CONTENT
from .base import TelegramMethod
@ -34,7 +34,7 @@ class SendDice(TelegramMethod[Message]):
"""Emoji on which the dice throw animation is based. Currently, must be one of '🎲', '🎯', '🏀', '', '🎳', or '🎰'. Dice can have values 1-6 for '🎲', '🎯' and '🎳', values 1-5 for '🏀' and '', and values 1-64 for '🎰'. Defaults to '🎲'"""
disable_notification: Optional[bool] = None
"""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
protect_content: Optional[Union[bool, Default]] = Default("protect_content")
"""Protects the contents of the sent message from forwarding"""
reply_parameters: Optional[ReplyParameters] = None
"""Description of the message to reply to"""
@ -66,7 +66,7 @@ class SendDice(TelegramMethod[Message]):
message_thread_id: Optional[int] = None,
emoji: Optional[str] = None,
disable_notification: Optional[bool] = None,
protect_content: Optional[bool] = UNSET_PROTECT_CONTENT,
protect_content: Optional[Union[bool, Default]] = Default("protect_content"),
reply_parameters: Optional[ReplyParameters] = None,
reply_markup: Optional[
Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]