Skip to content

Commit a40a58f

Browse files
Restructure input content types
1 parent 547a6ed commit a40a58f

42 files changed

Lines changed: 77 additions & 224 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

compiler/docs/compiler.py

Lines changed: 28 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -775,29 +775,42 @@ def get_title_list(s: str) -> list:
775775
BotCommandScopeChatAdministrators
776776
BotCommandScopeChatMember
777777
""",
778-
input_media="""
779-
Input Media
780-
InputMedia
781-
InputMediaPhoto
782-
InputMediaVideo
783-
InputMediaAudio
784-
InputMediaAnimation
785-
InputMediaDocument
786-
InputPhoneContact
787-
""",
788-
input_credentials="""
789-
Input Credentials
778+
input_content="""
779+
Input Content
780+
InputContactMessageContent
790781
InputCredentials
791782
InputCredentialsApplePay
792783
InputCredentialsGooglePay
793784
InputCredentialsNew
794785
InputCredentialsSaved
795-
""",
796-
input_invoice="""
797-
Input Invoice
798786
InputInvoice
799787
InputInvoiceMessage
788+
InputInvoiceMessageContent
800789
InputInvoiceName
790+
InputLocationMessageContent
791+
InputMedia
792+
InputMediaAnimation
793+
InputMediaAudio
794+
InputMediaDocument
795+
InputMediaPhoto
796+
InputMediaVideo
797+
InputMessageContent
798+
InputPhoneContact
799+
InputPrivacyRule
800+
InputPrivacyRuleAllowAll
801+
InputPrivacyRuleAllowBots
802+
InputPrivacyRuleAllowChats
803+
InputPrivacyRuleAllowCloseFriends
804+
InputPrivacyRuleAllowContacts
805+
InputPrivacyRuleAllowPremium
806+
InputPrivacyRuleAllowUsers
807+
InputPrivacyRuleDisallowAll
808+
InputPrivacyRuleDisallowBots
809+
InputPrivacyRuleDisallowChats
810+
InputPrivacyRuleDisallowContacts
811+
InputPrivacyRuleDisallowUsers
812+
InputTextMessageContent
813+
InputVenueMessageContent
801814
""",
802815
inline_mode="""
803816
Inline Mode
@@ -822,37 +835,12 @@ def get_title_list(s: str) -> list:
822835
InlineQueryResultVoice
823836
ChosenInlineResult
824837
""",
825-
input_message_content="""
826-
InputMessageContent
827-
InputMessageContent
828-
InputContactMessageContent
829-
InputInvoiceMessageContent
830-
InputLocationMessageContent
831-
InputTextMessageContent
832-
InputVenueMessageContent
833-
""",
834838
authorization="""
835839
Authorization
836840
ActiveSession
837841
ActiveSessions
838842
SentCode
839843
TermsOfService
840-
""",
841-
input_privacy_rule="""
842-
InputPrivacyRule
843-
InputPrivacyRule
844-
InputPrivacyRuleAllowAll
845-
InputPrivacyRuleAllowBots
846-
InputPrivacyRuleAllowChats
847-
InputPrivacyRuleAllowCloseFriends
848-
InputPrivacyRuleAllowContacts
849-
InputPrivacyRuleAllowPremium
850-
InputPrivacyRuleAllowUsers
851-
InputPrivacyRuleDisallowAll
852-
InputPrivacyRuleDisallowBots
853-
InputPrivacyRuleDisallowChats
854-
InputPrivacyRuleDisallowContacts
855-
InputPrivacyRuleDisallowUsers
856844
"""
857845
)
858846

compiler/docs/template/types.rst

Lines changed: 3 additions & 55 deletions

pyrogram/types/__init__.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,7 @@
1919
from .authorization import *
2020
from .bots_and_keyboards import *
2121
from .inline_mode import *
22-
from .input_credentials import *
23-
from .input_invoice import *
24-
from .input_media import *
25-
from .input_message_content import *
26-
from .input_privacy_rule import *
22+
from .input_content import *
2723
from .list import List
2824
from .messages_and_media import *
2925
from .object import Object

pyrogram/types/input_privacy_rule/__init__.py renamed to pyrogram/types/input_content/__init__.py

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,25 @@
1616
# You should have received a copy of the GNU Lesser General Public License
1717
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
1818

19+
from .input_contact_message_content import InputContactMessageContent
20+
from .input_credentials import InputCredentials
21+
from .input_credentials_apple_pay import InputCredentialsApplePay
22+
from .input_credentials_google_pay import InputCredentialsGooglePay
23+
from .input_credentials_new import InputCredentialsNew
24+
from .input_credentials_saved import InputCredentialsSaved
25+
from .input_invoice import InputInvoice
26+
from .input_invoice_message import InputInvoiceMessage
27+
from .input_invoice_message_content import InputInvoiceMessageContent
28+
from .input_invoice_name import InputInvoiceName
29+
from .input_location_message_content import InputLocationMessageContent
30+
from .input_media import InputMedia
31+
from .input_media_animation import InputMediaAnimation
32+
from .input_media_audio import InputMediaAudio
33+
from .input_media_document import InputMediaDocument
34+
from .input_media_photo import InputMediaPhoto
35+
from .input_media_video import InputMediaVideo
36+
from .input_message_content import InputMessageContent
37+
from .input_phone_contact import InputPhoneContact
1938
from .input_privacy_rule import InputPrivacyRule
2039
from .input_privacy_rule_allow_all import InputPrivacyRuleAllowAll
2140
from .input_privacy_rule_allow_bots import InputPrivacyRuleAllowBots
@@ -29,8 +48,29 @@
2948
from .input_privacy_rule_disallow_chats import InputPrivacyRuleDisallowChats
3049
from .input_privacy_rule_disallow_contacts import InputPrivacyRuleDisallowContacts
3150
from .input_privacy_rule_disallow_users import InputPrivacyRuleDisallowUsers
51+
from .input_text_message_content import InputTextMessageContent
52+
from .input_venue_message_content import InputVenueMessageContent
3253

3354
__all__ = [
55+
"InputContactMessageContent",
56+
"InputCredentials",
57+
"InputCredentialsApplePay",
58+
"InputCredentialsGooglePay",
59+
"InputCredentialsNew",
60+
"InputCredentialsSaved",
61+
"InputInvoice",
62+
"InputInvoiceMessage",
63+
"InputInvoiceMessageContent",
64+
"InputInvoiceName",
65+
"InputLocationMessageContent",
66+
"InputMedia",
67+
"InputMediaAnimation",
68+
"InputMediaAudio",
69+
"InputMediaDocument",
70+
"InputMediaPhoto",
71+
"InputMediaVideo",
72+
"InputMessageContent",
73+
"InputPhoneContact",
3474
"InputPrivacyRule",
3575
"InputPrivacyRuleAllowAll",
3676
"InputPrivacyRuleAllowBots",
@@ -43,5 +83,7 @@
4383
"InputPrivacyRuleDisallowBots",
4484
"InputPrivacyRuleDisallowChats",
4585
"InputPrivacyRuleDisallowContacts",
46-
"InputPrivacyRuleDisallowUsers"
86+
"InputPrivacyRuleDisallowUsers",
87+
"InputTextMessageContent",
88+
"InputVenueMessageContent"
4789
]

pyrogram/types/input_message_content/input_contact_message_content.py renamed to pyrogram/types/input_content/input_contact_message_content.py

File renamed without changes.
File renamed without changes.

pyrogram/types/input_credentials/input_credentials_apple_pay.py renamed to pyrogram/types/input_content/input_credentials_apple_pay.py

File renamed without changes.

pyrogram/types/input_credentials/input_credentials_google_pay.py renamed to pyrogram/types/input_content/input_credentials_google_pay.py

File renamed without changes.

pyrogram/types/input_credentials/input_credentials_new.py renamed to pyrogram/types/input_content/input_credentials_new.py

File renamed without changes.

pyrogram/types/input_credentials/input_credentials_saved.py renamed to pyrogram/types/input_content/input_credentials_saved.py

File renamed without changes.

0 commit comments

Comments
 (0)