Pytdbot 0.9.7__tar.gz → 0.9.8.dev0__tar.gz

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.
Files changed (47) hide show
  1. {pytdbot-0.9.7 → pytdbot-0.9.8.dev0}/PKG-INFO +1 -1
  2. {pytdbot-0.9.7 → pytdbot-0.9.8.dev0}/Pytdbot.egg-info/PKG-INFO +1 -1
  3. {pytdbot-0.9.7 → pytdbot-0.9.8.dev0}/Pytdbot.egg-info/SOURCES.txt +1 -0
  4. {pytdbot-0.9.7 → pytdbot-0.9.8.dev0}/pytdbot/__init__.py +1 -1
  5. pytdbot-0.9.8.dev0/pytdbot/types/bound_methods/__init__.py +10 -0
  6. {pytdbot-0.9.7 → pytdbot-0.9.8.dev0}/pytdbot/types/bound_methods/message.py +18 -9
  7. pytdbot-0.9.8.dev0/pytdbot/types/bound_methods/sender_id.py +36 -0
  8. {pytdbot-0.9.7 → pytdbot-0.9.8.dev0}/pytdbot/types/td_types.py +3 -2
  9. pytdbot-0.9.7/pytdbot/types/bound_methods/__init__.py +0 -4
  10. {pytdbot-0.9.7 → pytdbot-0.9.8.dev0}/LICENSE +0 -0
  11. {pytdbot-0.9.7 → pytdbot-0.9.8.dev0}/MANIFEST.in +0 -0
  12. {pytdbot-0.9.7 → pytdbot-0.9.8.dev0}/Pytdbot.egg-info/dependency_links.txt +0 -0
  13. {pytdbot-0.9.7 → pytdbot-0.9.8.dev0}/Pytdbot.egg-info/requires.txt +0 -0
  14. {pytdbot-0.9.7 → pytdbot-0.9.8.dev0}/Pytdbot.egg-info/top_level.txt +0 -0
  15. {pytdbot-0.9.7 → pytdbot-0.9.8.dev0}/README.md +0 -0
  16. {pytdbot-0.9.7 → pytdbot-0.9.8.dev0}/pytdbot/client.py +0 -0
  17. {pytdbot-0.9.7 → pytdbot-0.9.8.dev0}/pytdbot/client_manager.py +0 -0
  18. {pytdbot-0.9.7 → pytdbot-0.9.8.dev0}/pytdbot/exception/__init__.py +0 -0
  19. {pytdbot-0.9.7 → pytdbot-0.9.8.dev0}/pytdbot/filters.py +0 -0
  20. {pytdbot-0.9.7 → pytdbot-0.9.8.dev0}/pytdbot/handlers/__init__.py +0 -0
  21. {pytdbot-0.9.7 → pytdbot-0.9.8.dev0}/pytdbot/handlers/decorators.py +0 -0
  22. {pytdbot-0.9.7 → pytdbot-0.9.8.dev0}/pytdbot/handlers/handler.py +0 -0
  23. {pytdbot-0.9.7 → pytdbot-0.9.8.dev0}/pytdbot/handlers/td_updates.py +0 -0
  24. {pytdbot-0.9.7 → pytdbot-0.9.8.dev0}/pytdbot/methods/__init__.py +0 -0
  25. {pytdbot-0.9.7 → pytdbot-0.9.8.dev0}/pytdbot/methods/methods.py +0 -0
  26. {pytdbot-0.9.7 → pytdbot-0.9.8.dev0}/pytdbot/methods/td_functions.py +0 -0
  27. {pytdbot-0.9.7 → pytdbot-0.9.8.dev0}/pytdbot/tdjson/__init__.py +0 -0
  28. {pytdbot-0.9.7 → pytdbot-0.9.8.dev0}/pytdbot/tdjson/tdjson.py +0 -0
  29. {pytdbot-0.9.7 → pytdbot-0.9.8.dev0}/pytdbot/types/__init__.py +0 -0
  30. {pytdbot-0.9.7 → pytdbot-0.9.8.dev0}/pytdbot/types/bound_methods/callback_query.py +0 -0
  31. {pytdbot-0.9.7 → pytdbot-0.9.8.dev0}/pytdbot/types/bound_methods/chatActions.py +0 -0
  32. {pytdbot-0.9.7 → pytdbot-0.9.8.dev0}/pytdbot/types/bound_methods/file.py +0 -0
  33. {pytdbot-0.9.7 → pytdbot-0.9.8.dev0}/pytdbot/types/plugins/__init__.py +0 -0
  34. {pytdbot-0.9.7 → pytdbot-0.9.8.dev0}/pytdbot/types/tdserver/__init__.py +0 -0
  35. {pytdbot-0.9.7 → pytdbot-0.9.8.dev0}/pytdbot/types/tdserver/schedule.py +0 -0
  36. {pytdbot-0.9.7 → pytdbot-0.9.8.dev0}/pytdbot/types/tdserver/stats.py +0 -0
  37. {pytdbot-0.9.7 → pytdbot-0.9.8.dev0}/pytdbot/utils/__init__.py +0 -0
  38. {pytdbot-0.9.7 → pytdbot-0.9.8.dev0}/pytdbot/utils/asyncio_utils.py +0 -0
  39. {pytdbot-0.9.7 → pytdbot-0.9.8.dev0}/pytdbot/utils/escape.py +0 -0
  40. {pytdbot-0.9.7 → pytdbot-0.9.8.dev0}/pytdbot/utils/json_utils.py +0 -0
  41. {pytdbot-0.9.7 → pytdbot-0.9.8.dev0}/pytdbot/utils/obj_encoder.py +0 -0
  42. {pytdbot-0.9.7 → pytdbot-0.9.8.dev0}/pytdbot/utils/strings.py +0 -0
  43. {pytdbot-0.9.7 → pytdbot-0.9.8.dev0}/pytdbot/utils/text_format.py +0 -0
  44. {pytdbot-0.9.7 → pytdbot-0.9.8.dev0}/pytdbot/utils/webapps.py +0 -0
  45. {pytdbot-0.9.7 → pytdbot-0.9.8.dev0}/requirements.txt +0 -0
  46. {pytdbot-0.9.7 → pytdbot-0.9.8.dev0}/setup.cfg +0 -0
  47. {pytdbot-0.9.7 → pytdbot-0.9.8.dev0}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: Pytdbot
3
- Version: 0.9.7
3
+ Version: 0.9.8.dev0
4
4
  Summary: Easy-to-use asynchronous TDLib wrapper for Python.
5
5
  Home-page: https://github.com/pytdbot/client
6
6
  Author: AYMEN Mohammed
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: Pytdbot
3
- Version: 0.9.7
3
+ Version: 0.9.8.dev0
4
4
  Summary: Easy-to-use asynchronous TDLib wrapper for Python.
5
5
  Home-page: https://github.com/pytdbot/client
6
6
  Author: AYMEN Mohammed
@@ -29,6 +29,7 @@ pytdbot/types/bound_methods/callback_query.py
29
29
  pytdbot/types/bound_methods/chatActions.py
30
30
  pytdbot/types/bound_methods/file.py
31
31
  pytdbot/types/bound_methods/message.py
32
+ pytdbot/types/bound_methods/sender_id.py
32
33
  pytdbot/types/plugins/__init__.py
33
34
  pytdbot/types/tdserver/__init__.py
34
35
  pytdbot/types/tdserver/schedule.py
@@ -13,7 +13,7 @@ __all__ = [
13
13
  "Client",
14
14
  ]
15
15
 
16
- __version__ = "0.9.7"
16
+ __version__ = "0.9.8.dev0"
17
17
  __copyright__ = "Copyright (c) 2022-2025 Pytdbot, AYMENJD"
18
18
  __license__ = "MIT License"
19
19
 
@@ -0,0 +1,10 @@
1
+ __all__ = [
2
+ "CallbackQueryBoundMethods",
3
+ "FileBoundMethods",
4
+ "MessageBoundMethods",
5
+ "MessageSenderBoundMethods",
6
+ ]
7
+ from .callback_query import CallbackQueryBoundMethods
8
+ from .file import FileBoundMethods
9
+ from .message import MessageBoundMethods
10
+ from .sender_id import MessageSenderBoundMethods
@@ -435,6 +435,7 @@ class MessageBoundMethods:
435
435
  allow_paid_broadcast: bool = False,
436
436
  message_thread_id: int = 0,
437
437
  quote: "pytdbot.types.InputTextQuote" = None,
438
+ no_reply: bool = False,
438
439
  reply_markup: Union[
439
440
  "pytdbot.types.ReplyMarkupInlineKeyboard",
440
441
  "pytdbot.types.ReplyMarkupShowKeyboard",
@@ -460,7 +461,7 @@ class MessageBoundMethods:
460
461
  allow_paid_broadcast=allow_paid_broadcast,
461
462
  message_thread_id=message_thread_id,
462
463
  quote=quote,
463
- reply_to_message_id=self.id,
464
+ reply_to_message_id=self.id if not no_reply else None,
464
465
  reply_markup=reply_markup,
465
466
  )
466
467
 
@@ -481,6 +482,7 @@ class MessageBoundMethods:
481
482
  has_spoiler: bool = False,
482
483
  message_thread_id: int = 0,
483
484
  quote: "pytdbot.types.InputTextQuote" = None,
485
+ no_reply: bool = False,
484
486
  reply_markup: Union[
485
487
  "pytdbot.types.ReplyMarkupInlineKeyboard",
486
488
  "pytdbot.types.ReplyMarkupShowKeyboard",
@@ -504,10 +506,10 @@ class MessageBoundMethods:
504
506
  disable_notification=disable_notification,
505
507
  protect_content=protect_content,
506
508
  allow_paid_broadcast=allow_paid_broadcast,
509
+ reply_to_message_id=self.id if not no_reply else None,
507
510
  has_spoiler=has_spoiler,
508
511
  message_thread_id=message_thread_id,
509
512
  quote=quote,
510
- reply_to_message_id=self.id,
511
513
  reply_markup=reply_markup,
512
514
  )
513
515
 
@@ -526,6 +528,7 @@ class MessageBoundMethods:
526
528
  allow_paid_broadcast: bool = False,
527
529
  message_thread_id: int = 0,
528
530
  quote: "pytdbot.types.InputTextQuote" = None,
531
+ no_reply: bool = False,
529
532
  reply_markup: Union[
530
533
  "pytdbot.types.ReplyMarkupInlineKeyboard",
531
534
  "pytdbot.types.ReplyMarkupShowKeyboard",
@@ -550,7 +553,7 @@ class MessageBoundMethods:
550
553
  allow_paid_broadcast=allow_paid_broadcast,
551
554
  message_thread_id=message_thread_id,
552
555
  quote=quote,
553
- reply_to_message_id=self.id,
556
+ reply_to_message_id=self.id if not no_reply else None,
554
557
  reply_markup=reply_markup,
555
558
  )
556
559
 
@@ -567,6 +570,7 @@ class MessageBoundMethods:
567
570
  allow_paid_broadcast: bool = False,
568
571
  message_thread_id: int = 0,
569
572
  quote: "pytdbot.types.InputTextQuote" = None,
573
+ no_reply: bool = False,
570
574
  reply_markup: Union[
571
575
  "pytdbot.types.ReplyMarkupInlineKeyboard",
572
576
  "pytdbot.types.ReplyMarkupShowKeyboard",
@@ -589,7 +593,7 @@ class MessageBoundMethods:
589
593
  allow_paid_broadcast=allow_paid_broadcast,
590
594
  message_thread_id=message_thread_id,
591
595
  quote=quote,
592
- reply_to_message_id=self.id,
596
+ reply_to_message_id=self.id if not no_reply else None,
593
597
  reply_markup=reply_markup,
594
598
  )
595
599
 
@@ -610,6 +614,7 @@ class MessageBoundMethods:
610
614
  has_spoiler: bool = False,
611
615
  message_thread_id: int = 0,
612
616
  quote: "pytdbot.types.InputTextQuote" = None,
617
+ no_reply: bool = None,
613
618
  reply_markup: Union[
614
619
  "pytdbot.types.ReplyMarkupInlineKeyboard",
615
620
  "pytdbot.types.ReplyMarkupShowKeyboard",
@@ -636,7 +641,7 @@ class MessageBoundMethods:
636
641
  has_spoiler=has_spoiler,
637
642
  message_thread_id=message_thread_id,
638
643
  quote=quote,
639
- reply_to_message_id=self.id,
644
+ reply_to_message_id=self.id if not no_reply else None,
640
645
  reply_markup=reply_markup,
641
646
  )
642
647
 
@@ -659,6 +664,7 @@ class MessageBoundMethods:
659
664
  has_spoiler: bool = False,
660
665
  message_thread_id: int = 0,
661
666
  quote: "pytdbot.types.InputTextQuote" = None,
667
+ no_reply: bool = None,
662
668
  reply_markup: Union[
663
669
  "pytdbot.types.ReplyMarkupInlineKeyboard",
664
670
  "pytdbot.types.ReplyMarkupShowKeyboard",
@@ -687,7 +693,7 @@ class MessageBoundMethods:
687
693
  has_spoiler=has_spoiler,
688
694
  message_thread_id=message_thread_id,
689
695
  quote=quote,
690
- reply_to_message_id=self.id,
696
+ reply_to_message_id=self.id if not no_reply else None,
691
697
  reply_markup=reply_markup,
692
698
  )
693
699
 
@@ -702,6 +708,7 @@ class MessageBoundMethods:
702
708
  allow_paid_broadcast: bool = False,
703
709
  message_thread_id: int = 0,
704
710
  quote: "pytdbot.types.InputTextQuote" = None,
711
+ no_reply: bool = None,
705
712
  reply_markup: Union[
706
713
  "pytdbot.types.ReplyMarkupInlineKeyboard",
707
714
  "pytdbot.types.ReplyMarkupShowKeyboard",
@@ -722,7 +729,7 @@ class MessageBoundMethods:
722
729
  allow_paid_broadcast=allow_paid_broadcast,
723
730
  message_thread_id=message_thread_id,
724
731
  quote=quote,
725
- reply_to_message_id=self.id,
732
+ reply_to_message_id=self.id if not no_reply else None,
726
733
  reply_markup=reply_markup,
727
734
  )
728
735
 
@@ -739,6 +746,7 @@ class MessageBoundMethods:
739
746
  allow_paid_broadcast: bool = False,
740
747
  message_thread_id: int = 0,
741
748
  quote: "pytdbot.types.InputTextQuote" = None,
749
+ no_reply: bool = None,
742
750
  reply_markup: Union[
743
751
  "pytdbot.types.ReplyMarkupInlineKeyboard",
744
752
  "pytdbot.types.ReplyMarkupShowKeyboard",
@@ -761,7 +769,7 @@ class MessageBoundMethods:
761
769
  allow_paid_broadcast=allow_paid_broadcast,
762
770
  message_thread_id=message_thread_id,
763
771
  quote=quote,
764
- reply_to_message_id=self.id,
772
+ reply_to_message_id=self.id if not no_reply else None,
765
773
  reply_markup=reply_markup,
766
774
  )
767
775
 
@@ -777,6 +785,7 @@ class MessageBoundMethods:
777
785
  allow_paid_broadcast: bool = False,
778
786
  message_thread_id: int = 0,
779
787
  quote: "pytdbot.types.InputTextQuote" = None,
788
+ no_reply: bool = None,
780
789
  reply_markup: Union[
781
790
  "pytdbot.types.ReplyMarkupInlineKeyboard",
782
791
  "pytdbot.types.ReplyMarkupShowKeyboard",
@@ -798,7 +807,7 @@ class MessageBoundMethods:
798
807
  allow_paid_broadcast=allow_paid_broadcast,
799
808
  message_thread_id=message_thread_id,
800
809
  quote=quote,
801
- reply_to_message_id=self.id,
810
+ reply_to_message_id=self.id if not no_reply else None,
802
811
  reply_markup=reply_markup,
803
812
  )
804
813
 
@@ -0,0 +1,36 @@
1
+ from typing import Union
2
+ from functools import lru_cache
3
+
4
+ import pytdbot
5
+
6
+
7
+ class MessageSenderBoundMethods:
8
+ def __init__(self):
9
+ self._client: pytdbot.Client
10
+
11
+ @property
12
+ @lru_cache(1)
13
+ def from_id(self) -> Union[int, None]:
14
+ """Returns the message sender's ID. ``None`` if not found"""
15
+
16
+ if isinstance(self, pytdbot.types.MessageSenderUser):
17
+ return self.user_id
18
+
19
+ if isinstance(self, pytdbot.types.MessageSenderChat):
20
+ return self.chat_id
21
+
22
+ return None
23
+
24
+ @property
25
+ @lru_cache(1)
26
+ def is_user(self) -> bool:
27
+ """Returns ``True`` if the message sender is a user"""
28
+
29
+ return isinstance(self, pytdbot.types.MessageSenderUser)
30
+
31
+ @property
32
+ @lru_cache(1)
33
+ def is_chat(self) -> bool:
34
+ """Returns ``True`` if the message sender is a chat"""
35
+
36
+ return isinstance(self, pytdbot.types.MessageSenderChat)
@@ -1,9 +1,10 @@
1
1
  from typing import Union, Literal, List
2
2
  from base64 import b64decode
3
3
  from .bound_methods import (
4
- MessageBoundMethods,
5
4
  CallbackQueryBoundMethods,
5
+ MessageSenderBoundMethods,
6
6
  FileBoundMethods,
7
+ MessageBoundMethods,
7
8
  )
8
9
  import pytdbot
9
10
 
@@ -302,7 +303,7 @@ class SecretChatState:
302
303
  pass
303
304
 
304
305
 
305
- class MessageSender:
306
+ class MessageSender(MessageSenderBoundMethods):
306
307
  r"""Contains information about the sender of a message"""
307
308
 
308
309
  pass
@@ -1,4 +0,0 @@
1
- __all__ = ["MessageBoundMethods", "FileBoundMethods", "CallbackQueryBoundMethods"]
2
- from .message import MessageBoundMethods
3
- from .file import FileBoundMethods
4
- from .callback_query import CallbackQueryBoundMethods
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes