@@ -778,6 +778,65 @@ def decorator(func: Callable) -> Callable:
778
778
779
779
return decorator
780
780
781
+ def on_updateMessageSuggestedPostInfo (
782
+ self : "pytdbot.Client" = None ,
783
+ filters : "pytdbot.filters.Filter" = None ,
784
+ position : int = None ,
785
+ timeout : float = None ,
786
+ ) -> Callable :
787
+ r"""Information about suggested post of a message was changed
788
+
789
+ Parameters:
790
+ filters (:class:`pytdbot.filters.Filter`, *optional*):
791
+ An update filter
792
+
793
+ position (``int``, *optional*):
794
+ The function position in handlers list. Default is ``None`` (append)
795
+
796
+ timeout (``float``, *optional*):
797
+ Max execution time for the handler before it timeout. Default is ``None``
798
+
799
+ Raises:
800
+ :py:class:`TypeError`
801
+ """
802
+
803
+ def decorator (func : Callable ) -> Callable :
804
+ if hasattr (func , "_handler" ):
805
+ return func
806
+ elif isinstance (self , pytdbot .Client ):
807
+ if iscoroutinefunction (func ):
808
+ self .add_handler (
809
+ update_type = "updateMessageSuggestedPostInfo" ,
810
+ func = func ,
811
+ filters = filters ,
812
+ position = position ,
813
+ inner_object = False ,
814
+ timeout = timeout ,
815
+ )
816
+ else :
817
+ raise TypeError ("Handler must be async" )
818
+ elif isinstance (self , pytdbot .filters .Filter ):
819
+ func ._handler = Handler (
820
+ func = func ,
821
+ update_type = "updateMessageSuggestedPostInfo" ,
822
+ filter = self ,
823
+ position = position ,
824
+ inner_object = False ,
825
+ timeout = timeout ,
826
+ )
827
+ else :
828
+ func ._handler = Handler (
829
+ func = func ,
830
+ update_type = "updateMessageSuggestedPostInfo" ,
831
+ filter = filters ,
832
+ position = position ,
833
+ inner_object = False ,
834
+ timeout = timeout ,
835
+ )
836
+ return func
837
+
838
+ return decorator
839
+
781
840
def on_updateMessageLiveLocationViewed (
782
841
self : "pytdbot.Client" = None ,
783
842
filters : "pytdbot.filters.Filter" = None ,
@@ -7563,6 +7622,65 @@ def decorator(func: Callable) -> Callable:
7563
7622
7564
7623
return decorator
7565
7624
7625
+ def on_updateOwnedTonCount (
7626
+ self : "pytdbot.Client" = None ,
7627
+ filters : "pytdbot.filters.Filter" = None ,
7628
+ position : int = None ,
7629
+ timeout : float = None ,
7630
+ ) -> Callable :
7631
+ r"""The number of Toncoins owned by the current user has changed
7632
+
7633
+ Parameters:
7634
+ filters (:class:`pytdbot.filters.Filter`, *optional*):
7635
+ An update filter
7636
+
7637
+ position (``int``, *optional*):
7638
+ The function position in handlers list. Default is ``None`` (append)
7639
+
7640
+ timeout (``float``, *optional*):
7641
+ Max execution time for the handler before it timeout. Default is ``None``
7642
+
7643
+ Raises:
7644
+ :py:class:`TypeError`
7645
+ """
7646
+
7647
+ def decorator (func : Callable ) -> Callable :
7648
+ if hasattr (func , "_handler" ):
7649
+ return func
7650
+ elif isinstance (self , pytdbot .Client ):
7651
+ if iscoroutinefunction (func ):
7652
+ self .add_handler (
7653
+ update_type = "updateOwnedTonCount" ,
7654
+ func = func ,
7655
+ filters = filters ,
7656
+ position = position ,
7657
+ inner_object = False ,
7658
+ timeout = timeout ,
7659
+ )
7660
+ else :
7661
+ raise TypeError ("Handler must be async" )
7662
+ elif isinstance (self , pytdbot .filters .Filter ):
7663
+ func ._handler = Handler (
7664
+ func = func ,
7665
+ update_type = "updateOwnedTonCount" ,
7666
+ filter = self ,
7667
+ position = position ,
7668
+ inner_object = False ,
7669
+ timeout = timeout ,
7670
+ )
7671
+ else :
7672
+ func ._handler = Handler (
7673
+ func = func ,
7674
+ update_type = "updateOwnedTonCount" ,
7675
+ filter = filters ,
7676
+ position = position ,
7677
+ inner_object = False ,
7678
+ timeout = timeout ,
7679
+ )
7680
+ return func
7681
+
7682
+ return decorator
7683
+
7566
7684
def on_updateChatRevenueAmount (
7567
7685
self : "pytdbot.Client" = None ,
7568
7686
filters : "pytdbot.filters.Filter" = None ,
0 commit comments