Pytdbot 0.10.0.dev1__py3-none-any.whl → 0.10.0.dev3__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 CHANGED
@@ -13,7 +13,7 @@ __all__ = [
13
13
  "Client",
14
14
  ]
15
15
 
16
- __version__ = "0.10.0.dev1"
16
+ __version__ = "0.10.0.dev3"
17
17
  __copyright__ = "Copyright (c) 2022-2026 Pytdbot, AYMENJD"
18
18
  __license__ = "MIT License"
19
19
 
@@ -722,6 +722,65 @@ class Updates:
722
722
 
723
723
  return decorator
724
724
 
725
+ def on_updateMessageContainsUnreadPollVotes(
726
+ self: pytdbot.Client | None = None,
727
+ filters: pytdbot.filters.Filter | None = None,
728
+ position: int | None = None,
729
+ timeout: float | None = None,
730
+ ) -> Callable:
731
+ r"""Unread votes were added or removed from a poll message
732
+
733
+ Parameters:
734
+ filters (:class:`pytdbot.filters.Filter`, *optional*):
735
+ An update filter
736
+
737
+ position (``int``, *optional*):
738
+ The function position in handlers list. Default is ``None`` (append)
739
+
740
+ timeout (``float``, *optional*):
741
+ Max execution time for the handler before it timeout. Default is ``None``
742
+
743
+ Raises:
744
+ :py:class:`TypeError`
745
+ """
746
+
747
+ def decorator(func: Callable) -> Callable:
748
+ if hasattr(func, "_handler"):
749
+ return func
750
+ elif isinstance(self, pytdbot.Client):
751
+ if iscoroutinefunction(func):
752
+ self.add_handler(
753
+ update_type="updateMessageContainsUnreadPollVotes",
754
+ func=func,
755
+ filters=filters,
756
+ position=position,
757
+ inner_object=False,
758
+ timeout=timeout,
759
+ )
760
+ else:
761
+ raise TypeError("Handler must be async")
762
+ elif isinstance(self, pytdbot.filters.Filter):
763
+ func._handler = Handler(
764
+ func=func,
765
+ update_type="updateMessageContainsUnreadPollVotes",
766
+ filter=self,
767
+ position=position,
768
+ inner_object=False,
769
+ timeout=timeout,
770
+ )
771
+ else:
772
+ func._handler = Handler(
773
+ func=func,
774
+ update_type="updateMessageContainsUnreadPollVotes",
775
+ filter=filters,
776
+ position=position,
777
+ inner_object=False,
778
+ timeout=timeout,
779
+ )
780
+ return func
781
+
782
+ return decorator
783
+
725
784
  def on_updateMessageFactCheck(
726
785
  self: pytdbot.Client | None = None,
727
786
  filters: pytdbot.filters.Filter | None = None,
@@ -9572,6 +9631,65 @@ class Updates:
9572
9631
 
9573
9632
  return decorator
9574
9633
 
9634
+ def on_updateNewGuestQuery(
9635
+ self: pytdbot.Client | None = None,
9636
+ filters: pytdbot.filters.Filter | None = None,
9637
+ position: int | None = None,
9638
+ timeout: float | None = None,
9639
+ ) -> Callable:
9640
+ r"""A new incoming guest query; for bots only
9641
+
9642
+ Parameters:
9643
+ filters (:class:`pytdbot.filters.Filter`, *optional*):
9644
+ An update filter
9645
+
9646
+ position (``int``, *optional*):
9647
+ The function position in handlers list. Default is ``None`` (append)
9648
+
9649
+ timeout (``float``, *optional*):
9650
+ Max execution time for the handler before it timeout. Default is ``None``
9651
+
9652
+ Raises:
9653
+ :py:class:`TypeError`
9654
+ """
9655
+
9656
+ def decorator(func: Callable) -> Callable:
9657
+ if hasattr(func, "_handler"):
9658
+ return func
9659
+ elif isinstance(self, pytdbot.Client):
9660
+ if iscoroutinefunction(func):
9661
+ self.add_handler(
9662
+ update_type="updateNewGuestQuery",
9663
+ func=func,
9664
+ filters=filters,
9665
+ position=position,
9666
+ inner_object=False,
9667
+ timeout=timeout,
9668
+ )
9669
+ else:
9670
+ raise TypeError("Handler must be async")
9671
+ elif isinstance(self, pytdbot.filters.Filter):
9672
+ func._handler = Handler(
9673
+ func=func,
9674
+ update_type="updateNewGuestQuery",
9675
+ filter=self,
9676
+ position=position,
9677
+ inner_object=False,
9678
+ timeout=timeout,
9679
+ )
9680
+ else:
9681
+ func._handler = Handler(
9682
+ func=func,
9683
+ update_type="updateNewGuestQuery",
9684
+ filter=filters,
9685
+ position=position,
9686
+ inner_object=False,
9687
+ timeout=timeout,
9688
+ )
9689
+ return func
9690
+
9691
+ return decorator
9692
+
9575
9693
  def on_updateNewCallbackQuery(
9576
9694
  self: pytdbot.Client | None = None,
9577
9695
  filters: pytdbot.filters.Filter | None = None,
@@ -1427,6 +1427,7 @@ class Methods(TDLibFunctions):
1427
1427
  chat_id: int,
1428
1428
  from_chat_id: int,
1429
1429
  message_id: int,
1430
+ topic_id: MessageTopic = None,
1430
1431
  in_game_share: bool = False,
1431
1432
  disable_notification: bool = False,
1432
1433
  ):
@@ -1442,6 +1443,9 @@ class Methods(TDLibFunctions):
1442
1443
  message_id (``int``):
1443
1444
  Identifier of the message to forward
1444
1445
 
1446
+ topic_id (:class:`~pytdbot.types.MessageTopic`, *optional*):
1447
+ Topic in which the message will be sent; pass null if none
1448
+
1445
1449
  in_game_share (``bool``, *optional*):
1446
1450
  True, if a game message is being shared from a launched game; applies only to game messages
1447
1451
 
@@ -1459,6 +1463,7 @@ class Methods(TDLibFunctions):
1459
1463
  message_id=message_id,
1460
1464
  in_game_share=in_game_share,
1461
1465
  ),
1466
+ topic_id=topic_id,
1462
1467
  disable_notification=disable_notification,
1463
1468
  )
1464
1469