Skip to content

API 7.3 Chat Backgrounds and new params #4247

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
May 11, 2024
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
10 changes: 10 additions & 0 deletions docs/source/telegram.at-tree.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,16 @@ Available Types
telegram.callbackquery
telegram.chat
telegram.chatadministratorrights
telegram.chatbackground
telegram.backgroundtype
telegram.backgroundtypefill
telegram.backgroundtypewallpaper
telegram.backgroundtypepattern
telegram.backgroundtypechattheme
telegram.backgroundfill
telegram.backgroundfillsolid
telegram.backgroundfillgradient
telegram.backgroundfillfreeformgradient
telegram.chatboost
telegram.chatboostadded
telegram.chatboostremoved
Expand Down
8 changes: 8 additions & 0 deletions docs/source/telegram.backgroundfill.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
BackgroundFill
==============

.. versionadded:: NEXT.VERSION

.. autoclass:: telegram.BackgroundFill
:members:
:show-inheritance:
8 changes: 8 additions & 0 deletions docs/source/telegram.backgroundfillfreeformgradient.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
BackgroundFillFreeformGradient
==============================

.. versionadded:: NEXT.VERSION

.. autoclass:: telegram.BackgroundFillFreeformGradient
:members:
:show-inheritance:
8 changes: 8 additions & 0 deletions docs/source/telegram.backgroundfillgradient.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
BackgroundFillGradient
======================

.. versionadded:: NEXT.VERSION

.. autoclass:: telegram.BackgroundFillGradient
:members:
:show-inheritance:
8 changes: 8 additions & 0 deletions docs/source/telegram.backgroundfillsolid.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
BackgroundFillSolid
===================

.. versionadded:: NEXT.VERSION

.. autoclass:: telegram.BackgroundFillSolid
:members:
:show-inheritance:
8 changes: 8 additions & 0 deletions docs/source/telegram.backgroundtype.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
BackgroundType
==============

.. versionadded:: NEXT.VERSION

.. autoclass:: telegram.BackgroundType
:members:
:show-inheritance:
8 changes: 8 additions & 0 deletions docs/source/telegram.backgroundtypechattheme.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
BackgroundTypeChatTheme
=======================

.. versionadded:: NEXT.VERSION

.. autoclass:: telegram.BackgroundTypeChatTheme
:members:
:show-inheritance:
8 changes: 8 additions & 0 deletions docs/source/telegram.backgroundtypefill.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
BackgroundTypeFill
==================

.. versionadded:: NEXT.VERSION

.. autoclass:: telegram.BackgroundTypeFill
:members:
:show-inheritance:
8 changes: 8 additions & 0 deletions docs/source/telegram.backgroundtypepattern.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
BackgroundTypePattern
=====================

.. versionadded:: NEXT.VERSION

.. autoclass:: telegram.BackgroundTypePattern
:members:
:show-inheritance:
8 changes: 8 additions & 0 deletions docs/source/telegram.backgroundtypewallpaper.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
BackgroundTypeWallpaper
=======================

.. versionadded:: NEXT.VERSION

.. autoclass:: telegram.BackgroundTypeWallpaper
:members:
:show-inheritance:
8 changes: 8 additions & 0 deletions docs/source/telegram.chatbackground.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
ChatBackground
==============

.. versionadded:: NEXT.VERSION

.. autoclass:: telegram.ChatBackground
:members:
:show-inheritance:
22 changes: 22 additions & 0 deletions telegram/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@
__all__ = (
"Animation",
"Audio",
"BackgroundFill",
"BackgroundFillFreeformGradient",
"BackgroundFillGradient",
"BackgroundFillSolid",
"BackgroundType",
"BackgroundTypeChatTheme",
"BackgroundTypeFill",
"BackgroundTypePattern",
"BackgroundTypeWallpaper",
"Birthdate",
"Bot",
"BotCommand",
Expand All @@ -46,6 +55,7 @@
"CallbackQuery",
"Chat",
"ChatAdministratorRights",
"ChatBackground",
"ChatBoost",
"ChatBoostAdded",
"ChatBoostRemoved",
Expand Down Expand Up @@ -259,6 +269,18 @@
from ._callbackquery import CallbackQuery
from ._chat import Chat
from ._chatadministratorrights import ChatAdministratorRights
from ._chatbackground import (
BackgroundFill,
BackgroundFillFreeformGradient,
BackgroundFillGradient,
BackgroundFillSolid,
BackgroundType,
BackgroundTypeChatTheme,
BackgroundTypeFill,
BackgroundTypePattern,
BackgroundTypeWallpaper,
ChatBackground,
)
from ._chatboost import (
ChatBoost,
ChatBoostAdded,
Expand Down
11 changes: 11 additions & 0 deletions telegram/_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -2720,6 +2720,7 @@ async def edit_message_live_location(
horizontal_accuracy: Optional[float] = None,
heading: Optional[int] = None,
proximity_alert_radius: Optional[int] = None,
live_period: Optional[int] = None,
*,
location: Optional[Location] = None,
read_timeout: ODVInput[float] = DEFAULT_NONE,
Expand Down Expand Up @@ -2758,6 +2759,15 @@ async def edit_message_live_location(
if specified.
reply_markup (:class:`telegram.InlineKeyboardMarkup`, optional): An object for a new
inline keyboard.
live_period (:obj:`int`, optional): New period in seconds during which the location
can be updated, starting from the message send date. If
:tg-const:`telegram.constants.LocationLimit.LIVE_PERIOD_FOREVER` is specified,
then the location can be updated forever. Otherwise, the new value must not exceed
the current live_period by more than a day, and the live location expiration date
must remain within the next 90 days. If not specified, then `live_period`
remains unchanged

.. versionadded:: NEXT.VERSION.

Keyword Args:
location (:class:`telegram.Location`, optional): The location to send.
Expand Down Expand Up @@ -2790,6 +2800,7 @@ async def edit_message_live_location(
"horizontal_accuracy": horizontal_accuracy,
"heading": heading,
"proximity_alert_radius": proximity_alert_radius,
"live_period": live_period,
}

return await self._send_message(
Expand Down
3 changes: 3 additions & 0 deletions telegram/_callbackquery.py
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,7 @@ async def edit_message_live_location(
horizontal_accuracy: Optional[float] = None,
heading: Optional[int] = None,
proximity_alert_radius: Optional[int] = None,
live_period: Optional[int] = None,
*,
location: Optional[Location] = None,
read_timeout: ODVInput[float] = DEFAULT_NONE,
Expand Down Expand Up @@ -509,6 +510,7 @@ async def edit_message_live_location(
horizontal_accuracy=horizontal_accuracy,
heading=heading,
proximity_alert_radius=proximity_alert_radius,
live_period=live_period,
chat_id=None,
message_id=None,
)
Expand All @@ -525,6 +527,7 @@ async def edit_message_live_location(
horizontal_accuracy=horizontal_accuracy,
heading=heading,
proximity_alert_radius=proximity_alert_radius,
live_period=live_period,
)

async def stop_message_live_location(
Expand Down
Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy