Skip to content

Commit b7a5c1b

Browse files
AYMENJDgithub-actions[bot]
authored andcommitted
Generate Pytdbot files
1 parent f6eac1b commit b7a5c1b

File tree

5 files changed

+2021
-99
lines changed

5 files changed

+2021
-99
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Pytdbot [![Version](https://img.shields.io/pypi/v/Pytdbot?style=flat&logo=pypi)](https://pypi.org/project/Pytdbot) [![TDLib version](https://img.shields.io/badge/TDLib-v1.8.52-blue?logo=telegram)](https://github.com/tdlib/td) [![Downloads](https://static.pepy.tech/personalized-badge/pytdbot?period=month&units=none&left_color=grey&right_color=brightgreen&left_text=Downloads)](https://pepy.tech/project/pytdbot) [![Telegram Chat](https://img.shields.io/badge/Pytdbot%20chat-blue?logo=telegram&label=Telegram)](https://t.me/pytdbotchat)
1+
# Pytdbot [![Version](https://img.shields.io/pypi/v/Pytdbot?style=flat&logo=pypi)](https://pypi.org/project/Pytdbot) [![TDLib version](https://img.shields.io/badge/TDLib-v1.8.53-blue?logo=telegram)](https://github.com/tdlib/td) [![Downloads](https://static.pepy.tech/personalized-badge/pytdbot?period=month&units=none&left_color=grey&right_color=brightgreen&left_text=Downloads)](https://pepy.tech/project/pytdbot) [![Telegram Chat](https://img.shields.io/badge/Pytdbot%20chat-blue?logo=telegram&label=Telegram)](https://t.me/pytdbotchat)
22

33
Pytdbot (Python TDLib) is an asynchronous [**TDLib**](https://github.com/tdlib/td) wrapper for **Telegram** users/bots written in **Python**.
44

pytdbot/handlers/td_updates.py

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6973,6 +6973,65 @@ def decorator(func: Callable) -> Callable:
69736973

69746974
return decorator
69756975

6976+
def on_updateAgeVerificationParameters(
6977+
self: "pytdbot.Client" = None,
6978+
filters: "pytdbot.filters.Filter" = None,
6979+
position: int = None,
6980+
timeout: float = None,
6981+
) -> Callable:
6982+
r"""The parameters for age verification of the current user's account has changed
6983+
6984+
Parameters:
6985+
filters (:class:`pytdbot.filters.Filter`, *optional*):
6986+
An update filter
6987+
6988+
position (``int``, *optional*):
6989+
The function position in handlers list. Default is ``None`` (append)
6990+
6991+
timeout (``float``, *optional*):
6992+
Max execution time for the handler before it timeout. Default is ``None``
6993+
6994+
Raises:
6995+
:py:class:`TypeError`
6996+
"""
6997+
6998+
def decorator(func: Callable) -> Callable:
6999+
if hasattr(func, "_handler"):
7000+
return func
7001+
elif isinstance(self, pytdbot.Client):
7002+
if iscoroutinefunction(func):
7003+
self.add_handler(
7004+
update_type="updateAgeVerificationParameters",
7005+
func=func,
7006+
filters=filters,
7007+
position=position,
7008+
inner_object=False,
7009+
timeout=timeout,
7010+
)
7011+
else:
7012+
raise TypeError("Handler must be async")
7013+
elif isinstance(self, pytdbot.filters.Filter):
7014+
func._handler = Handler(
7015+
func=func,
7016+
update_type="updateAgeVerificationParameters",
7017+
filter=self,
7018+
position=position,
7019+
inner_object=False,
7020+
timeout=timeout,
7021+
)
7022+
else:
7023+
func._handler = Handler(
7024+
func=func,
7025+
update_type="updateAgeVerificationParameters",
7026+
filter=filters,
7027+
position=position,
7028+
inner_object=False,
7029+
timeout=timeout,
7030+
)
7031+
return func
7032+
7033+
return decorator
7034+
69767035
def on_updateTermsOfService(
69777036
self: "pytdbot.Client" = None,
69787037
filters: "pytdbot.filters.Filter" = None,

0 commit comments

Comments
 (0)