diff --git a/compiler/docs/compiler.py b/compiler/docs/compiler.py index 0c9464e2..db13de79 100644 --- a/compiler/docs/compiler.py +++ b/compiler/docs/compiler.py @@ -183,7 +183,6 @@ def pyrogram_api(): send_contact send_cached_media send_reaction - send_paid_reaction edit_message_text edit_message_caption edit_message_media @@ -349,7 +348,14 @@ def pyrogram_api(): Payments apply_gift_code check_gift_code + create_invoice_link get_payment_form + get_stars_transactions + get_stars_transactions_by_id + refund_star_payment + send_invoice + send_paid_media + send_paid_reaction send_payment_form """, password=""" @@ -384,13 +390,7 @@ def pyrogram_api(): Telegram Business answer_pre_checkout_query answer_shipping_query - create_invoice_link get_business_connection - get_stars_transactions - get_stars_transactions_by_id - refund_star_payment - send_invoice - send_paid_media """, authorization=""" Authorization @@ -500,7 +500,6 @@ def pyrogram_api(): AvailableEffect Document Animation - LabeledPrice Video Voice VideoNote @@ -510,7 +509,6 @@ def pyrogram_api(): Sticker StickerSet Game - GiftedPremium Giveaway GiveawayLaunched GiveawayResult @@ -565,9 +563,21 @@ def pyrogram_api(): """, payment=""" Payment - GiftCode CheckedGiftCode + ExtendedMediaPreview + GiftCode + GiftedPremium + InputStarsTransaction + Invoice + LabeledPrice + PaidMedia PaymentForm + PaymentInfo + PaymentRefunded + PurchasedPaidMedia + StarsStatus + StarsTransaction + SuccessfulPayment """, pyromod=""" Pyromod @@ -605,8 +615,6 @@ def pyrogram_api(): MenuButtonWebApp MenuButtonDefault SentWebAppMessage - PreCheckoutQuery - PurchasedPaidMedia """, bot_commands=""" Bot commands @@ -622,18 +630,10 @@ def pyrogram_api(): """, business=""" Telegram Business - ExtendedMediaPreview - InputStarsTransaction - Invoice - PaidMedia - PaymentInfo - PaymentRefunded + PreCheckoutQuery ShippingAddress ShippingOption ShippingQuery - StarsStatus - StarsTransaction - SuccessfulPayment """, input_media=""" Input Media diff --git a/pyrogram/methods/business/__init__.py b/pyrogram/methods/business/__init__.py index 1ef2ad91..f018dfed 100644 --- a/pyrogram/methods/business/__init__.py +++ b/pyrogram/methods/business/__init__.py @@ -17,23 +17,11 @@ # along with Pyrogram. If not, see . from .answer_pre_checkout_query import AnswerPreCheckoutQuery -from .create_invoice_link import CreateInvoiceLink from .get_business_connection import GetBusinessConnection -from .get_stars_transactions import GetStarsTransactions -from .get_stars_transactions_by_id import GetStarsTransactionsById -from .refund_stars_payment import RefundStarPayment -from .send_invoice import SendInvoice -from .send_paid_media import SendPaidMedia class TelegramBusiness( AnswerPreCheckoutQuery, - CreateInvoiceLink, - GetBusinessConnection, - GetStarsTransactions, - GetStarsTransactionsById, - RefundStarPayment, - SendInvoice, - SendPaidMedia + GetBusinessConnection ): pass diff --git a/pyrogram/methods/messages/__init__.py b/pyrogram/methods/messages/__init__.py index ff616c00..dc2ccd98 100644 --- a/pyrogram/methods/messages/__init__.py +++ b/pyrogram/methods/messages/__init__.py @@ -60,7 +60,6 @@ from .send_document import SendDocument from .send_location import SendLocation from .send_media_group import SendMediaGroup from .send_message import SendMessage -from .send_paid_reaction import SendPaidReaction from .send_photo import SendPhoto from .send_poll import SendPoll from .send_reaction import SendReaction @@ -96,7 +95,6 @@ class Messages( SendLocation, SendMediaGroup, SendMessage, - SendPaidReaction, SendPhoto, SendSticker, SendVenue, diff --git a/pyrogram/methods/payments/__init__.py b/pyrogram/methods/payments/__init__.py index 806f2d37..aa38ad56 100644 --- a/pyrogram/methods/payments/__init__.py +++ b/pyrogram/methods/payments/__init__.py @@ -19,13 +19,27 @@ from .apply_gift_code import ApplyGiftCode from .check_giftcode import CheckGiftCode +from .create_invoice_link import CreateInvoiceLink from .get_payment_form import GetPaymentForm +from .get_stars_transactions import GetStarsTransactions +from .get_stars_transactions_by_id import GetStarsTransactionsById +from .refund_stars_payment import RefundStarPayment +from .send_invoice import SendInvoice +from .send_paid_media import SendPaidMedia +from .send_paid_reaction import SendPaidReaction from .send_payment_form import SendPaymentForm class Payments( ApplyGiftCode, CheckGiftCode, + CreateInvoiceLink, GetPaymentForm, + GetStarsTransactions, + GetStarsTransactionsById, + RefundStarPayment, + SendPaidReaction, + SendPaidMedia, + SendInvoice, SendPaymentForm ): pass diff --git a/pyrogram/methods/business/create_invoice_link.py b/pyrogram/methods/payments/create_invoice_link.py similarity index 100% rename from pyrogram/methods/business/create_invoice_link.py rename to pyrogram/methods/payments/create_invoice_link.py diff --git a/pyrogram/methods/business/get_stars_transactions.py b/pyrogram/methods/payments/get_stars_transactions.py similarity index 100% rename from pyrogram/methods/business/get_stars_transactions.py rename to pyrogram/methods/payments/get_stars_transactions.py diff --git a/pyrogram/methods/business/get_stars_transactions_by_id.py b/pyrogram/methods/payments/get_stars_transactions_by_id.py similarity index 100% rename from pyrogram/methods/business/get_stars_transactions_by_id.py rename to pyrogram/methods/payments/get_stars_transactions_by_id.py diff --git a/pyrogram/methods/business/refund_stars_payment.py b/pyrogram/methods/payments/refund_stars_payment.py similarity index 100% rename from pyrogram/methods/business/refund_stars_payment.py rename to pyrogram/methods/payments/refund_stars_payment.py diff --git a/pyrogram/methods/business/send_invoice.py b/pyrogram/methods/payments/send_invoice.py similarity index 100% rename from pyrogram/methods/business/send_invoice.py rename to pyrogram/methods/payments/send_invoice.py diff --git a/pyrogram/methods/business/send_paid_media.py b/pyrogram/methods/payments/send_paid_media.py similarity index 100% rename from pyrogram/methods/business/send_paid_media.py rename to pyrogram/methods/payments/send_paid_media.py diff --git a/pyrogram/methods/messages/send_paid_reaction.py b/pyrogram/methods/payments/send_paid_reaction.py similarity index 100% rename from pyrogram/methods/messages/send_paid_reaction.py rename to pyrogram/methods/payments/send_paid_reaction.py diff --git a/pyrogram/types/__init__.py b/pyrogram/types/__init__.py index 3f66b9d0..82460332 100644 --- a/pyrogram/types/__init__.py +++ b/pyrogram/types/__init__.py @@ -28,4 +28,5 @@ from .messages_and_media import * from .object import Object from .update import * from .user_and_chats import * +from .payments import * from .pyromod import * diff --git a/pyrogram/types/bots_and_keyboards/__init__.py b/pyrogram/types/bots_and_keyboards/__init__.py index 964d8b1f..c8228b58 100644 --- a/pyrogram/types/bots_and_keyboards/__init__.py +++ b/pyrogram/types/bots_and_keyboards/__init__.py @@ -54,7 +54,6 @@ from .requested_chats import RequestedChats from .requested_user import RequestedUser from .sent_web_app_message import SentWebAppMessage from .web_app_info import WebAppInfo -from .purchased_paid_media import PurchasedPaidMedia __all__ = [ "BotAllowed", @@ -93,6 +92,5 @@ __all__ = [ "MenuButtonCommands", "MenuButtonWebApp", "MenuButtonDefault", - "SentWebAppMessage", - "PurchasedPaidMedia" + "SentWebAppMessage" ] diff --git a/pyrogram/types/business/__init__.py b/pyrogram/types/business/__init__.py index e50bebee..12e54154 100644 --- a/pyrogram/types/business/__init__.py +++ b/pyrogram/types/business/__init__.py @@ -16,32 +16,14 @@ # You should have received a copy of the GNU Lesser General Public License # along with Pyrofork. If not, see . -from .extended_media_preview import ExtendedMediaPreview -from .input_stars_transaction import InputStarsTransaction -from .invoice import Invoice -from .paid_media import PaidMedia -from .payment_info import PaymentInfo -from .payment_refunded import PaymentRefunded from .pre_checkout_query import PreCheckoutQuery from .shipping_address import ShippingAddress from .shipping_option import ShippingOption from .shipping_query import ShippingQuery -from .stars_status import StarsStatus -from .stars_transaction import StarsTransaction -from .successful_payment import SuccessfulPayment __all__ = [ - "ExtendedMediaPreview", - "Invoice", - "InputStarsTransaction", - "PaidMedia", - "PaymentInfo", - "PaymentRefunded", "PreCheckoutQuery", - "StarsStatus", - "StarsTransaction", "ShippingAddress", "ShippingOption", - "ShippingQuery", - "SuccessfulPayment" + "ShippingQuery" ] diff --git a/pyrogram/types/messages_and_media/__init__.py b/pyrogram/types/messages_and_media/__init__.py index 24c46fe8..acf61e5e 100644 --- a/pyrogram/types/messages_and_media/__init__.py +++ b/pyrogram/types/messages_and_media/__init__.py @@ -22,25 +22,20 @@ from .audio import Audio from .available_effect import AvailableEffect from .chat_theme import ChatTheme from .chat_wallpaper import ChatWallpaper -from .checked_gift_code import CheckedGiftCode from .contact import Contact from .contact_registered import ContactRegistered from .dice import Dice from .document import Document from .game import Game -from .gift_code import GiftCode -from .gifted_premium import GiftedPremium from .giveaway import Giveaway from .giveaway_launched import GiveawayLaunched from .giveaway_result import GiveawayResult -from .labeled_price import LabeledPrice from .location import Location from .media_area import MediaArea from .media_area_channel_post import MediaAreaChannelPost from .media_area_coordinates import MediaAreaCoordinates from .message import Message from .message_entity import MessageEntity -from .payment_form import PaymentForm from .photo import Photo from .poll import Poll from .poll_option import PollOption @@ -85,20 +80,15 @@ __all__ = [ "ContactRegistered", "Document", "Game", - "GiftCode", - "CheckedGiftCode", - "GiftedPremium", "Giveaway", "GiveawayLaunched", "GiveawayResult", - "LabeledPrice", "Location", "MediaArea", "MediaAreaChannelPost", "MediaAreaCoordinates", "Message", "MessageEntity", - "PaymentForm", "Photo", "Thumbnail", "StrippedThumbnail", diff --git a/pyrogram/types/payments/__init__.py b/pyrogram/types/payments/__init__.py new file mode 100644 index 00000000..7c6dd85f --- /dev/null +++ b/pyrogram/types/payments/__init__.py @@ -0,0 +1,52 @@ +# Pyrofork - Telegram MTProto API Client Library for Python +# Copyright (C) 2017-present Dan +# Copyright (C) 2022-present Mayuri-Chan +# +# This file is part of Pyrofork. +# +# Pyrofork is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# Pyrofork is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with Pyrofork. If not, see . + +from .extended_media_preview import ExtendedMediaPreview +from .checked_gift_code import CheckedGiftCode +from .gift_code import GiftCode +from .gifted_premium import GiftedPremium +from .input_stars_transaction import InputStarsTransaction +from .invoice import Invoice +from .labeled_price import LabeledPrice +from .paid_media import PaidMedia +from .payment_form import PaymentForm +from .payment_info import PaymentInfo +from .payment_refunded import PaymentRefunded +from .purchased_paid_media import PurchasedPaidMedia +from .stars_status import StarsStatus +from .stars_transaction import StarsTransaction +from .successful_payment import SuccessfulPayment + +__all__ = [ + "ExtendedMediaPreview", + "CheckedGiftCode", + "GiftCode", + "GiftedPremium", + "InputStarsTransaction", + "Invoice", + "LabeledPrice", + "PaidMedia", + "PaymentForm", + "PaymentInfo", + "PaymentRefunded", + "PurchasedPaidMedia", + "StarsStatus", + "StarsTransaction", + "SuccessfulPayment" +] diff --git a/pyrogram/types/messages_and_media/checked_gift_code.py b/pyrogram/types/payments/checked_gift_code.py similarity index 100% rename from pyrogram/types/messages_and_media/checked_gift_code.py rename to pyrogram/types/payments/checked_gift_code.py diff --git a/pyrogram/types/business/extended_media_preview.py b/pyrogram/types/payments/extended_media_preview.py similarity index 100% rename from pyrogram/types/business/extended_media_preview.py rename to pyrogram/types/payments/extended_media_preview.py diff --git a/pyrogram/types/messages_and_media/gift_code.py b/pyrogram/types/payments/gift_code.py similarity index 100% rename from pyrogram/types/messages_and_media/gift_code.py rename to pyrogram/types/payments/gift_code.py diff --git a/pyrogram/types/messages_and_media/gifted_premium.py b/pyrogram/types/payments/gifted_premium.py similarity index 100% rename from pyrogram/types/messages_and_media/gifted_premium.py rename to pyrogram/types/payments/gifted_premium.py diff --git a/pyrogram/types/business/input_stars_transaction.py b/pyrogram/types/payments/input_stars_transaction.py similarity index 100% rename from pyrogram/types/business/input_stars_transaction.py rename to pyrogram/types/payments/input_stars_transaction.py diff --git a/pyrogram/types/business/invoice.py b/pyrogram/types/payments/invoice.py similarity index 100% rename from pyrogram/types/business/invoice.py rename to pyrogram/types/payments/invoice.py diff --git a/pyrogram/types/messages_and_media/labeled_price.py b/pyrogram/types/payments/labeled_price.py similarity index 100% rename from pyrogram/types/messages_and_media/labeled_price.py rename to pyrogram/types/payments/labeled_price.py diff --git a/pyrogram/types/business/paid_media.py b/pyrogram/types/payments/paid_media.py similarity index 100% rename from pyrogram/types/business/paid_media.py rename to pyrogram/types/payments/paid_media.py diff --git a/pyrogram/types/messages_and_media/payment_form.py b/pyrogram/types/payments/payment_form.py similarity index 100% rename from pyrogram/types/messages_and_media/payment_form.py rename to pyrogram/types/payments/payment_form.py diff --git a/pyrogram/types/business/payment_info.py b/pyrogram/types/payments/payment_info.py similarity index 100% rename from pyrogram/types/business/payment_info.py rename to pyrogram/types/payments/payment_info.py diff --git a/pyrogram/types/business/payment_refunded.py b/pyrogram/types/payments/payment_refunded.py similarity index 100% rename from pyrogram/types/business/payment_refunded.py rename to pyrogram/types/payments/payment_refunded.py diff --git a/pyrogram/types/bots_and_keyboards/purchased_paid_media.py b/pyrogram/types/payments/purchased_paid_media.py similarity index 100% rename from pyrogram/types/bots_and_keyboards/purchased_paid_media.py rename to pyrogram/types/payments/purchased_paid_media.py diff --git a/pyrogram/types/business/stars_status.py b/pyrogram/types/payments/stars_status.py similarity index 100% rename from pyrogram/types/business/stars_status.py rename to pyrogram/types/payments/stars_status.py diff --git a/pyrogram/types/business/stars_transaction.py b/pyrogram/types/payments/stars_transaction.py similarity index 100% rename from pyrogram/types/business/stars_transaction.py rename to pyrogram/types/payments/stars_transaction.py diff --git a/pyrogram/types/business/successful_payment.py b/pyrogram/types/payments/successful_payment.py similarity index 100% rename from pyrogram/types/business/successful_payment.py rename to pyrogram/types/payments/successful_payment.py