Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changes/unreleased/5078.FoNwUYLbXQFRebTFhR6UPn.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ pull_requests = [
{ uid = "5092", author_uids = ["Bibo-Joshi"] },
{ uid = "5095", author_uids = ["Bibo-Joshi"] },
{ uid = "5094", author_uids = ["Bibo-Joshi"] },
{ uid = "5106", author_uid = ["aelkheir"] },
]
6 changes: 3 additions & 3 deletions src/telegram/_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -11702,7 +11702,7 @@ async def repost_story(
business_connection_id: str,
from_chat_id: int,
from_story_id: int,
active_period: int,
active_period: TimePeriod,
post_to_chat_page: bool | None = None,
protect_content: ODVInput[bool] = DEFAULT_NONE,
*,
Expand All @@ -11726,8 +11726,8 @@ async def repost_story(
from_chat_id (:obj:`int`): Unique identifier of the chat which posted the story that
should be reposted
from_story_id (:obj:`int`): Unique identifier of the story that should be reposted
active_period (:obj:`int`): Period after which the story is moved to the archive, in
seconds; must be one of
active_period (:obj:`int` | :class:`datetime.timedelta`): Period after which the story
is moved to the archive, in seconds; must be one of
:tg-const:`telegram.constants.StoryLimit.SIX_HOURS`,
:tg-const:`telegram.constants.StoryLimit.TWELVE_HOURS`,
:tg-const:`telegram.constants.StoryLimit.ONE_DAY`, or
Expand Down
2 changes: 1 addition & 1 deletion src/telegram/_chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -3906,7 +3906,7 @@ async def repost_story(
self,
business_connection_id: str,
from_story_id: int,
active_period: int,
active_period: TimePeriod,
post_to_chat_page: bool | None = None,
protect_content: ODVInput[bool] = DEFAULT_NONE,
*,
Expand Down
4 changes: 2 additions & 2 deletions src/telegram/_story.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from telegram._chat import Chat
from telegram._telegramobject import TelegramObject
from telegram._utils.defaultvalue import DEFAULT_NONE
from telegram._utils.types import JSONDict, ODVInput
from telegram._utils.types import JSONDict, ODVInput, TimePeriod

if TYPE_CHECKING:
from telegram import Bot
Expand Down Expand Up @@ -82,7 +82,7 @@ def de_json(cls, data: JSONDict, bot: "Bot | None" = None) -> "Story":
async def repost(
self,
business_connection_id: str,
active_period: int,
active_period: TimePeriod,
post_to_chat_page: bool | None = None,
protect_content: ODVInput[bool] = DEFAULT_NONE,
*,
Expand Down
5 changes: 3 additions & 2 deletions src/telegram/_uniquegift.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"""This module contains classes related to unique gifs."""

import datetime as dtm
from collections.abc import Sequence
from typing import TYPE_CHECKING, Final

from telegram import constants
Expand Down Expand Up @@ -87,9 +88,9 @@ def __init__(
model_custom_emoji_id: str,
symbol_custom_emoji_id: str,
light_theme_main_color: int,
light_theme_other_colors: list[int],
light_theme_other_colors: Sequence[int],
dark_theme_main_color: int,
dark_theme_other_colors: list[int],
dark_theme_other_colors: Sequence[int],
*,
api_kwargs: JSONDict | None = None,
):
Expand Down
2 changes: 1 addition & 1 deletion src/telegram/_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -2544,7 +2544,7 @@ async def repost_story(
self,
business_connection_id: str,
from_story_id: int,
active_period: int,
active_period: TimePeriod,
post_to_chat_page: bool | None = None,
protect_content: ODVInput[bool] = DEFAULT_NONE,
*,
Expand Down
2 changes: 1 addition & 1 deletion src/telegram/ext/_extbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -5323,7 +5323,7 @@ async def repost_story(
business_connection_id: str,
from_chat_id: int,
from_story_id: int,
active_period: int,
active_period: TimePeriod,
post_to_chat_page: bool | None = None,
protect_content: ODVInput[bool] = DEFAULT_NONE,
*,
Expand Down
11 changes: 10 additions & 1 deletion tests/test_official/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,9 @@ class ParamTypeCheckingExceptions:
"InputStoryContent": {"type"}, # attributes common to all subclasses
"StoryAreaType": {"type"}, # attributes common to all subclasses
"InputProfilePhoto": {"type"}, # attributes common to all subclasses
# backwards compatibility for api 9.3 changes
# tags: deprecated NEXT.VERSION, bot api 9.3
"UniqueGiftInfo": {"last_resale_star_count"},
}


Expand Down Expand Up @@ -206,6 +209,9 @@ def ptb_ignored_params(object_name: str) -> set[str]:
"send_venue": {"latitude", "longitude", "title", "address"},
"send_contact": {"phone_number", "first_name"},
# ---->
# backwards compatibility for api 9.3 changes
# tags: deprecated NEXT.VERSION, bot api 9.3
"UniqueGift": {"gift_id"},
}


Expand All @@ -214,7 +220,10 @@ def ignored_param_requirements(object_name: str) -> set[str]:


# Arguments that are optional arguments for now for backwards compatibility
BACKWARDS_COMPAT_KWARGS: dict[str, set[str]] = {}
BACKWARDS_COMPAT_KWARGS: dict[str, set[str]] = {
# tags: deprecated NEXT.VERSION, bot api 9.3
"get_business_account_gifts": {"exclude_limited"},
}


def backwards_compat_kwargs(object_name: str) -> set[str]:
Expand Down
Loading