Pytdbot 0.10.1__py3-none-any.whl → 0.10.2.dev0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pytdbot/__init__.py +1 -1
- pytdbot/handlers/td_updates.py +133 -15
- pytdbot/methods/methods.py +179 -19
- pytdbot/methods/td_functions.py +431 -64
- pytdbot/types/__init__.py +113 -25
- pytdbot/types/bound_methods/callback_query.py +10 -0
- pytdbot/types/bound_methods/message.py +43 -6
- pytdbot/types/td_types.py +3439 -894
- pytdbot/utils/__init__.py +4 -0
- pytdbot/utils/common.py +14 -0
- pytdbot/utils/rich_messages.py +14 -0
- {pytdbot-0.10.1.dist-info → pytdbot-0.10.2.dev0.dist-info}/METADATA +2 -2
- {pytdbot-0.10.1.dist-info → pytdbot-0.10.2.dev0.dist-info}/RECORD +16 -15
- {pytdbot-0.10.1.dist-info → pytdbot-0.10.2.dev0.dist-info}/WHEEL +1 -1
- {pytdbot-0.10.1.dist-info → pytdbot-0.10.2.dev0.dist-info}/licenses/LICENSE +0 -0
- {pytdbot-0.10.1.dist-info → pytdbot-0.10.2.dev0.dist-info}/top_level.txt +0 -0
pytdbot/__init__.py
CHANGED
pytdbot/handlers/td_updates.py
CHANGED
|
@@ -4262,6 +4262,65 @@ class Updates:
|
|
|
4262
4262
|
|
|
4263
4263
|
return decorator
|
|
4264
4264
|
|
|
4265
|
+
def on_updateCommunity(
|
|
4266
|
+
self: pytdbot.Client | None = None,
|
|
4267
|
+
filters: pytdbot.filters.Filter | None = None,
|
|
4268
|
+
position: int | None = None,
|
|
4269
|
+
timeout: float | None = None,
|
|
4270
|
+
) -> Callable:
|
|
4271
|
+
r"""Some data of a community has changed\. This update is guaranteed to come before the community identifier is returned to the application
|
|
4272
|
+
|
|
4273
|
+
Parameters:
|
|
4274
|
+
filters (:class:`pytdbot.filters.Filter`, *optional*):
|
|
4275
|
+
An update filter
|
|
4276
|
+
|
|
4277
|
+
position (``int``, *optional*):
|
|
4278
|
+
The function position in handlers list. Default is ``None`` (append)
|
|
4279
|
+
|
|
4280
|
+
timeout (``float``, *optional*):
|
|
4281
|
+
Max execution time for the handler before it timeout. Default is ``None``
|
|
4282
|
+
|
|
4283
|
+
Raises:
|
|
4284
|
+
:py:class:`TypeError`
|
|
4285
|
+
"""
|
|
4286
|
+
|
|
4287
|
+
def decorator(func: Callable) -> Callable:
|
|
4288
|
+
if hasattr(func, "_handler"):
|
|
4289
|
+
return func
|
|
4290
|
+
elif isinstance(self, pytdbot.Client):
|
|
4291
|
+
if iscoroutinefunction(func):
|
|
4292
|
+
self.add_handler(
|
|
4293
|
+
update_type="updateCommunity",
|
|
4294
|
+
func=func,
|
|
4295
|
+
filters=filters,
|
|
4296
|
+
position=position,
|
|
4297
|
+
inner_object=False,
|
|
4298
|
+
timeout=timeout,
|
|
4299
|
+
)
|
|
4300
|
+
else:
|
|
4301
|
+
raise TypeError("Handler must be async")
|
|
4302
|
+
elif isinstance(self, pytdbot.filters.Filter):
|
|
4303
|
+
func._handler = Handler(
|
|
4304
|
+
func=func,
|
|
4305
|
+
update_type="updateCommunity",
|
|
4306
|
+
filter=self,
|
|
4307
|
+
position=position,
|
|
4308
|
+
inner_object=False,
|
|
4309
|
+
timeout=timeout,
|
|
4310
|
+
)
|
|
4311
|
+
else:
|
|
4312
|
+
func._handler = Handler(
|
|
4313
|
+
func=func,
|
|
4314
|
+
update_type="updateCommunity",
|
|
4315
|
+
filter=filters,
|
|
4316
|
+
position=position,
|
|
4317
|
+
inner_object=False,
|
|
4318
|
+
timeout=timeout,
|
|
4319
|
+
)
|
|
4320
|
+
return func
|
|
4321
|
+
|
|
4322
|
+
return decorator
|
|
4323
|
+
|
|
4265
4324
|
def on_updateUserStatus(
|
|
4266
4325
|
self: pytdbot.Client | None = None,
|
|
4267
4326
|
filters: pytdbot.filters.Filter | None = None,
|
|
@@ -6097,7 +6156,7 @@ class Updates:
|
|
|
6097
6156
|
position: int | None = None,
|
|
6098
6157
|
timeout: float | None = None,
|
|
6099
6158
|
) -> Callable:
|
|
6100
|
-
r"""The list of auctions in which
|
|
6159
|
+
r"""The list of auctions in which the current user participates has changed
|
|
6101
6160
|
|
|
6102
6161
|
Parameters:
|
|
6103
6162
|
filters (:class:`pytdbot.filters.Filter`, *optional*):
|
|
@@ -7808,7 +7867,7 @@ class Updates:
|
|
|
7808
7867
|
position: int | None = None,
|
|
7809
7868
|
timeout: float | None = None,
|
|
7810
7869
|
) -> Callable:
|
|
7811
|
-
r"""The parameters for age verification of the current user's account
|
|
7870
|
+
r"""The parameters for age verification of the current user's account have changed
|
|
7812
7871
|
|
|
7813
7872
|
Parameters:
|
|
7814
7873
|
filters (:class:`pytdbot.filters.Filter`, *optional*):
|
|
@@ -8510,13 +8569,13 @@ class Updates:
|
|
|
8510
8569
|
|
|
8511
8570
|
return decorator
|
|
8512
8571
|
|
|
8513
|
-
def
|
|
8572
|
+
def on_updateOwnedGramCount(
|
|
8514
8573
|
self: pytdbot.Client | None = None,
|
|
8515
8574
|
filters: pytdbot.filters.Filter | None = None,
|
|
8516
8575
|
position: int | None = None,
|
|
8517
8576
|
timeout: float | None = None,
|
|
8518
8577
|
) -> Callable:
|
|
8519
|
-
r"""The number of
|
|
8578
|
+
r"""The number of TON Grams owned by the current user has changed
|
|
8520
8579
|
|
|
8521
8580
|
Parameters:
|
|
8522
8581
|
filters (:class:`pytdbot.filters.Filter`, *optional*):
|
|
@@ -8538,7 +8597,7 @@ class Updates:
|
|
|
8538
8597
|
elif isinstance(self, pytdbot.Client):
|
|
8539
8598
|
if iscoroutinefunction(func):
|
|
8540
8599
|
self.add_handler(
|
|
8541
|
-
update_type="
|
|
8600
|
+
update_type="updateOwnedGramCount",
|
|
8542
8601
|
func=func,
|
|
8543
8602
|
filters=filters,
|
|
8544
8603
|
position=position,
|
|
@@ -8550,7 +8609,7 @@ class Updates:
|
|
|
8550
8609
|
elif isinstance(self, pytdbot.filters.Filter):
|
|
8551
8610
|
func._handler = Handler(
|
|
8552
8611
|
func=func,
|
|
8553
|
-
update_type="
|
|
8612
|
+
update_type="updateOwnedGramCount",
|
|
8554
8613
|
filter=self,
|
|
8555
8614
|
position=position,
|
|
8556
8615
|
inner_object=False,
|
|
@@ -8559,7 +8618,7 @@ class Updates:
|
|
|
8559
8618
|
else:
|
|
8560
8619
|
func._handler = Handler(
|
|
8561
8620
|
func=func,
|
|
8562
|
-
update_type="
|
|
8621
|
+
update_type="updateOwnedGramCount",
|
|
8563
8622
|
filter=filters,
|
|
8564
8623
|
position=position,
|
|
8565
8624
|
inner_object=False,
|
|
@@ -8687,13 +8746,13 @@ class Updates:
|
|
|
8687
8746
|
|
|
8688
8747
|
return decorator
|
|
8689
8748
|
|
|
8690
|
-
def
|
|
8749
|
+
def on_updateGramRevenueStatus(
|
|
8691
8750
|
self: pytdbot.Client | None = None,
|
|
8692
8751
|
filters: pytdbot.filters.Filter | None = None,
|
|
8693
8752
|
position: int | None = None,
|
|
8694
8753
|
timeout: float | None = None,
|
|
8695
8754
|
) -> Callable:
|
|
8696
|
-
r"""The
|
|
8755
|
+
r"""The TON Gram revenue earned by the current user has changed\. If Gram transaction screen of the chat is opened, then getTonTransactions may be called to fetch new transactions
|
|
8697
8756
|
|
|
8698
8757
|
Parameters:
|
|
8699
8758
|
filters (:class:`pytdbot.filters.Filter`, *optional*):
|
|
@@ -8715,7 +8774,7 @@ class Updates:
|
|
|
8715
8774
|
elif isinstance(self, pytdbot.Client):
|
|
8716
8775
|
if iscoroutinefunction(func):
|
|
8717
8776
|
self.add_handler(
|
|
8718
|
-
update_type="
|
|
8777
|
+
update_type="updateGramRevenueStatus",
|
|
8719
8778
|
func=func,
|
|
8720
8779
|
filters=filters,
|
|
8721
8780
|
position=position,
|
|
@@ -8727,7 +8786,7 @@ class Updates:
|
|
|
8727
8786
|
elif isinstance(self, pytdbot.filters.Filter):
|
|
8728
8787
|
func._handler = Handler(
|
|
8729
8788
|
func=func,
|
|
8730
|
-
update_type="
|
|
8789
|
+
update_type="updateGramRevenueStatus",
|
|
8731
8790
|
filter=self,
|
|
8732
8791
|
position=position,
|
|
8733
8792
|
inner_object=False,
|
|
@@ -8736,7 +8795,7 @@ class Updates:
|
|
|
8736
8795
|
else:
|
|
8737
8796
|
func._handler = Handler(
|
|
8738
8797
|
func=func,
|
|
8739
|
-
update_type="
|
|
8798
|
+
update_type="updateGramRevenueStatus",
|
|
8740
8799
|
filter=filters,
|
|
8741
8800
|
position=position,
|
|
8742
8801
|
inner_object=False,
|
|
@@ -8752,7 +8811,7 @@ class Updates:
|
|
|
8752
8811
|
position: int | None = None,
|
|
8753
8812
|
timeout: float | None = None,
|
|
8754
8813
|
) -> Callable:
|
|
8755
|
-
r"""The parameters of speech recognition without Telegram Premium subscription
|
|
8814
|
+
r"""The parameters of speech recognition without Telegram Premium subscription have changed
|
|
8756
8815
|
|
|
8757
8816
|
Parameters:
|
|
8758
8817
|
filters (:class:`pytdbot.filters.Filter`, *optional*):
|
|
@@ -9047,7 +9106,7 @@ class Updates:
|
|
|
9047
9106
|
position: int | None = None,
|
|
9048
9107
|
timeout: float | None = None,
|
|
9049
9108
|
) -> Callable:
|
|
9050
|
-
r"""The parameters of animation search through getOption\(\"animation\_search\_bot\_username\"\) bot
|
|
9109
|
+
r"""The parameters of animation search through getOption\(\"animation\_search\_bot\_username\"\) bot have changed
|
|
9051
9110
|
|
|
9052
9111
|
Parameters:
|
|
9053
9112
|
filters (:class:`pytdbot.filters.Filter`, *optional*):
|
|
@@ -9224,7 +9283,7 @@ class Updates:
|
|
|
9224
9283
|
position: int | None = None,
|
|
9225
9284
|
timeout: float | None = None,
|
|
9226
9285
|
) -> Callable:
|
|
9227
|
-
r"""Download or upload file speed for the user was limited, but it can be restored by subscription to Telegram Premium\. The notification can be postponed until a being downloaded or uploaded
|
|
9286
|
+
r"""Download or upload file speed for the user was limited, but it can be restored by subscription to Telegram Premium\. The notification can be postponed until a file being downloaded or uploaded is visible to the user\. Use getOption\(\"premium\_download\_speedup\"\) or getOption\(\"premium\_upload\_speedup\"\) to get expected speedup after subscription to Telegram Premium
|
|
9228
9287
|
|
|
9229
9288
|
Parameters:
|
|
9230
9289
|
filters (:class:`pytdbot.filters.Filter`, *optional*):
|
|
@@ -10221,6 +10280,65 @@ class Updates:
|
|
|
10221
10280
|
|
|
10222
10281
|
return decorator
|
|
10223
10282
|
|
|
10283
|
+
def on_updateUserSubscription(
|
|
10284
|
+
self: pytdbot.Client | None = None,
|
|
10285
|
+
filters: pytdbot.filters.Filter | None = None,
|
|
10286
|
+
position: int | None = None,
|
|
10287
|
+
timeout: float | None = None,
|
|
10288
|
+
) -> Callable:
|
|
10289
|
+
r"""Subscription of a user to the bot was changed; for bots only
|
|
10290
|
+
|
|
10291
|
+
Parameters:
|
|
10292
|
+
filters (:class:`pytdbot.filters.Filter`, *optional*):
|
|
10293
|
+
An update filter
|
|
10294
|
+
|
|
10295
|
+
position (``int``, *optional*):
|
|
10296
|
+
The function position in handlers list. Default is ``None`` (append)
|
|
10297
|
+
|
|
10298
|
+
timeout (``float``, *optional*):
|
|
10299
|
+
Max execution time for the handler before it timeout. Default is ``None``
|
|
10300
|
+
|
|
10301
|
+
Raises:
|
|
10302
|
+
:py:class:`TypeError`
|
|
10303
|
+
"""
|
|
10304
|
+
|
|
10305
|
+
def decorator(func: Callable) -> Callable:
|
|
10306
|
+
if hasattr(func, "_handler"):
|
|
10307
|
+
return func
|
|
10308
|
+
elif isinstance(self, pytdbot.Client):
|
|
10309
|
+
if iscoroutinefunction(func):
|
|
10310
|
+
self.add_handler(
|
|
10311
|
+
update_type="updateUserSubscription",
|
|
10312
|
+
func=func,
|
|
10313
|
+
filters=filters,
|
|
10314
|
+
position=position,
|
|
10315
|
+
inner_object=False,
|
|
10316
|
+
timeout=timeout,
|
|
10317
|
+
)
|
|
10318
|
+
else:
|
|
10319
|
+
raise TypeError("Handler must be async")
|
|
10320
|
+
elif isinstance(self, pytdbot.filters.Filter):
|
|
10321
|
+
func._handler = Handler(
|
|
10322
|
+
func=func,
|
|
10323
|
+
update_type="updateUserSubscription",
|
|
10324
|
+
filter=self,
|
|
10325
|
+
position=position,
|
|
10326
|
+
inner_object=False,
|
|
10327
|
+
timeout=timeout,
|
|
10328
|
+
)
|
|
10329
|
+
else:
|
|
10330
|
+
func._handler = Handler(
|
|
10331
|
+
func=func,
|
|
10332
|
+
update_type="updateUserSubscription",
|
|
10333
|
+
filter=filters,
|
|
10334
|
+
position=position,
|
|
10335
|
+
inner_object=False,
|
|
10336
|
+
timeout=timeout,
|
|
10337
|
+
)
|
|
10338
|
+
return func
|
|
10339
|
+
|
|
10340
|
+
return decorator
|
|
10341
|
+
|
|
10224
10342
|
def on_updatePoll(
|
|
10225
10343
|
self: pytdbot.Client | None = None,
|
|
10226
10344
|
filters: pytdbot.filters.Filter | None = None,
|