Skip to content

Commit

Permalink
pyrofork: Move some method and types to payments category
Browse files Browse the repository at this point in the history
Signed-off-by: wulan17 <wulan17@nusantararom.org>
  • Loading branch information
wulan17 committed Oct 7, 2024
1 parent fb8c7a3 commit 49c533d
Show file tree
Hide file tree
Showing 31 changed files with 90 additions and 68 deletions.
42 changes: 21 additions & 21 deletions compiler/docs/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@ def get_title_list(s: str) -> list:
send_contact
send_cached_media
send_reaction
send_paid_reaction
edit_message_text
edit_message_caption
edit_message_media
Expand Down Expand Up @@ -349,7 +348,14 @@ def get_title_list(s: str) -> list:
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="""
Expand Down Expand Up @@ -384,13 +390,7 @@ def get_title_list(s: str) -> list:
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
Expand Down Expand Up @@ -500,7 +500,6 @@ def get_title_list(s: str) -> list:
AvailableEffect
Document
Animation
LabeledPrice
Video
Voice
VideoNote
Expand All @@ -510,7 +509,6 @@ def get_title_list(s: str) -> list:
Sticker
StickerSet
Game
GiftedPremium
Giveaway
GiveawayLaunched
GiveawayResult
Expand Down Expand Up @@ -565,9 +563,21 @@ def get_title_list(s: str) -> list:
""",
payment="""
Payment
GiftCode
CheckedGiftCode
ExtendedMediaPreview
GiftCode
GiftedPremium
InputStarsTransaction
Invoice
LabeledPrice
PaidMedia
PaymentForm
PaymentInfo
PaymentRefunded
PurchasedPaidMedia
StarsStatus
StarsTransaction
SuccessfulPayment
""",
pyromod="""
Pyromod
Expand Down Expand Up @@ -605,8 +615,6 @@ def get_title_list(s: str) -> list:
MenuButtonWebApp
MenuButtonDefault
SentWebAppMessage
PreCheckoutQuery
PurchasedPaidMedia
""",
bot_commands="""
Bot commands
Expand All @@ -622,18 +630,10 @@ def get_title_list(s: str) -> list:
""",
business="""
Telegram Business
ExtendedMediaPreview
InputStarsTransaction
Invoice
PaidMedia
PaymentInfo
PaymentRefunded
PreCheckoutQuery
ShippingAddress
ShippingOption
ShippingQuery
StarsStatus
StarsTransaction
SuccessfulPayment
""",
input_media="""
Input Media
Expand Down
14 changes: 1 addition & 13 deletions pyrogram/methods/business/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,11 @@
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.

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
2 changes: 0 additions & 2 deletions pyrogram/methods/messages/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
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
Expand Down Expand Up @@ -96,7 +95,6 @@ class Messages(
SendLocation,
SendMediaGroup,
SendMessage,
SendPaidReaction,
SendPhoto,
SendSticker,
SendVenue,
Expand Down
14 changes: 14 additions & 0 deletions pyrogram/methods/payments/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
File renamed without changes.
1 change: 1 addition & 0 deletions pyrogram/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@
from .object import Object
from .update import *
from .user_and_chats import *
from .payments import *
from .pyromod import *
4 changes: 1 addition & 3 deletions pyrogram/types/bots_and_keyboards/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
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",
Expand Down Expand Up @@ -93,6 +92,5 @@
"MenuButtonCommands",
"MenuButtonWebApp",
"MenuButtonDefault",
"SentWebAppMessage",
"PurchasedPaidMedia"
"SentWebAppMessage"
]
20 changes: 1 addition & 19 deletions pyrogram/types/business/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,32 +16,14 @@
# You should have received a copy of the GNU Lesser General Public License
# along with Pyrofork. If not, see <http://www.gnu.org/licenses/>.

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"
]
10 changes: 0 additions & 10 deletions pyrogram/types/messages_and_media/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,20 @@
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
Expand Down Expand Up @@ -85,20 +80,15 @@
"ContactRegistered",
"Document",
"Game",
"GiftCode",
"CheckedGiftCode",
"GiftedPremium",
"Giveaway",
"GiveawayLaunched",
"GiveawayResult",
"LabeledPrice",
"Location",
"MediaArea",
"MediaAreaChannelPost",
"MediaAreaCoordinates",
"Message",
"MessageEntity",
"PaymentForm",
"Photo",
"Thumbnail",
"StrippedThumbnail",
Expand Down
51 changes: 51 additions & 0 deletions pyrogram/types/payments/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2022-present Mayuri-Chan <https://github.com/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 <http://www.gnu.org/licenses/>.

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"
]
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 49c533d

Please sign in to comment.