mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2025-12-29 12:04:51 +00:00
pyrofork: Move some methods and types to business category
Signed-off-by: wulan17 <wulan17@nusantararom.org>
This commit is contained in:
parent
780ea9fd64
commit
e97f441a41
23 changed files with 53 additions and 50 deletions
|
|
@ -168,11 +168,9 @@ def pyrogram_api():
|
|||
forward_messages
|
||||
copy_message
|
||||
copy_media_group
|
||||
send_paid_media
|
||||
send_photo
|
||||
send_audio
|
||||
send_document
|
||||
send_invoice
|
||||
send_sticker
|
||||
send_video
|
||||
send_animation
|
||||
|
|
@ -367,19 +365,21 @@ def pyrogram_api():
|
|||
set_chat_menu_button
|
||||
get_chat_menu_button
|
||||
answer_web_app_query
|
||||
answer_pre_checkout_query
|
||||
answer_shipping_query
|
||||
refund_star_payment
|
||||
get_bot_info
|
||||
set_bot_info
|
||||
get_collectible_item_info
|
||||
""",
|
||||
business="""
|
||||
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
|
||||
|
|
@ -503,7 +503,6 @@ def pyrogram_api():
|
|||
Giveaway
|
||||
GiveawayLaunched
|
||||
GiveawayResult
|
||||
MessageInvoice
|
||||
MessageStory
|
||||
WebPage
|
||||
WebPageEmpty
|
||||
|
|
@ -530,8 +529,6 @@ def pyrogram_api():
|
|||
ReactionType
|
||||
MessageReactionUpdated
|
||||
MessageReactionCountUpdated
|
||||
ExtendedMediaPreview
|
||||
PaidMedia
|
||||
""",
|
||||
stories="""
|
||||
Stories
|
||||
|
|
@ -557,12 +554,6 @@ def pyrogram_api():
|
|||
BotAllowed
|
||||
BotApp
|
||||
BotBusinessConnection
|
||||
PaymentInfo
|
||||
PaymentRefunded
|
||||
ShippingAddress
|
||||
ShippingOption
|
||||
ShippingQuery
|
||||
SuccessfulPayment
|
||||
""",
|
||||
bot_keyboards="""
|
||||
Bot keyboards
|
||||
|
|
@ -602,9 +593,18 @@ def pyrogram_api():
|
|||
""",
|
||||
business="""
|
||||
Telegram Business
|
||||
ExtendedMediaPreview
|
||||
InputStarsTransaction
|
||||
Invoice
|
||||
PaidMedia
|
||||
PaymentInfo
|
||||
PaymentRefunded
|
||||
ShippingAddress
|
||||
ShippingOption
|
||||
ShippingQuery
|
||||
StarsStatus
|
||||
StarsTransaction
|
||||
SuccessfulPayment
|
||||
""",
|
||||
input_media="""
|
||||
Input Media
|
||||
|
|
|
|||
|
|
@ -19,7 +19,6 @@
|
|||
|
||||
from .answer_callback_query import AnswerCallbackQuery
|
||||
from .answer_inline_query import AnswerInlineQuery
|
||||
from .answer_pre_checkout_query import AnswerPreCheckoutQuery
|
||||
from .answer_web_app_query import AnswerWebAppQuery
|
||||
from .delete_bot_commands import DeleteBotCommands
|
||||
from .get_bot_commands import GetBotCommands
|
||||
|
|
@ -29,7 +28,6 @@ from .get_chat_menu_button import GetChatMenuButton
|
|||
from .get_collectible_item_info import GetCollectibleItemInfo
|
||||
from .get_game_high_scores import GetGameHighScores
|
||||
from .get_inline_bot_results import GetInlineBotResults
|
||||
from .refund_stars_payment import RefundStarPayment
|
||||
from .request_callback_answer import RequestCallbackAnswer
|
||||
from .send_game import SendGame
|
||||
from .send_inline_bot_result import SendInlineBotResult
|
||||
|
|
@ -59,8 +57,6 @@ class Bots(
|
|||
SetChatMenuButton,
|
||||
GetChatMenuButton,
|
||||
AnswerWebAppQuery,
|
||||
AnswerPreCheckoutQuery,
|
||||
RefundStarPayment,
|
||||
GetCollectibleItemInfo
|
||||
):
|
||||
pass
|
||||
|
|
|
|||
|
|
@ -16,16 +16,24 @@
|
|||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# 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
|
||||
GetStarsTransactionsById,
|
||||
RefundStarPayment,
|
||||
SendInvoice,
|
||||
SendPaidMedia
|
||||
):
|
||||
pass
|
||||
|
|
|
|||
|
|
@ -54,11 +54,9 @@ from .send_chat_action import SendChatAction
|
|||
from .send_contact import SendContact
|
||||
from .send_dice import SendDice
|
||||
from .send_document import SendDocument
|
||||
from .send_invoice import SendInvoice
|
||||
from .send_location import SendLocation
|
||||
from .send_media_group import SendMediaGroup
|
||||
from .send_message import SendMessage
|
||||
from .send_paid_media import SendPaidMedia
|
||||
from .send_photo import SendPhoto
|
||||
from .send_poll import SendPoll
|
||||
from .send_reaction import SendReaction
|
||||
|
|
@ -88,11 +86,9 @@ class Messages(
|
|||
SendContact,
|
||||
SendDocument,
|
||||
SendAnimation,
|
||||
SendInvoice,
|
||||
SendLocation,
|
||||
SendMediaGroup,
|
||||
SendMessage,
|
||||
SendPaidMedia,
|
||||
SendPhoto,
|
||||
SendSticker,
|
||||
SendVenue,
|
||||
|
|
|
|||
|
|
@ -44,19 +44,12 @@ from .menu_button import MenuButton
|
|||
from .menu_button_commands import MenuButtonCommands
|
||||
from .menu_button_default import MenuButtonDefault
|
||||
from .menu_button_web_app import MenuButtonWebApp
|
||||
from .payment_info import PaymentInfo
|
||||
from .payment_refunded import PaymentRefunded
|
||||
from .pre_checkout_query import PreCheckoutQuery
|
||||
from .reply_keyboard_markup import ReplyKeyboardMarkup
|
||||
from .reply_keyboard_remove import ReplyKeyboardRemove
|
||||
from .request_peer_type_channel import RequestPeerTypeChannel
|
||||
from .request_peer_type_chat import RequestPeerTypeChat
|
||||
from .request_peer_type_user import RequestPeerTypeUser
|
||||
from .sent_web_app_message import SentWebAppMessage
|
||||
from .shipping_address import ShippingAddress
|
||||
from .shipping_option import ShippingOption
|
||||
from .shipping_query import ShippingQuery
|
||||
from .successful_payment import SuccessfulPayment
|
||||
from .web_app_info import WebAppInfo
|
||||
|
||||
__all__ = [
|
||||
|
|
@ -93,12 +86,5 @@ __all__ = [
|
|||
"MenuButtonCommands",
|
||||
"MenuButtonWebApp",
|
||||
"MenuButtonDefault",
|
||||
"SentWebAppMessage",
|
||||
"ShippingAddress",
|
||||
"ShippingOption",
|
||||
"ShippingQuery",
|
||||
"PaymentInfo",
|
||||
"PaymentRefunded",
|
||||
"PreCheckoutQuery",
|
||||
"SuccessfulPayment"
|
||||
"SentWebAppMessage"
|
||||
]
|
||||
|
|
|
|||
|
|
@ -16,12 +16,32 @@
|
|||
# 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"
|
||||
"StarsTransaction",
|
||||
"ShippingAddress",
|
||||
"ShippingOption",
|
||||
"ShippingQuery",
|
||||
"SuccessfulPayment"
|
||||
]
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ from pyrogram import raw, types, utils
|
|||
from ..object import Object
|
||||
|
||||
|
||||
class MessageInvoice(Object):
|
||||
class Invoice(Object):
|
||||
"""Contains information about an Invoice.
|
||||
|
||||
Parameters:
|
||||
|
|
@ -78,8 +78,8 @@ class MessageInvoice(Object):
|
|||
@staticmethod
|
||||
def _parse(
|
||||
message_invoice: "raw.types.MessageMediaInvoice"
|
||||
) -> "MessageInvoice":
|
||||
return MessageInvoice(
|
||||
) -> "Invoice":
|
||||
return Invoice(
|
||||
title=message_invoice.title,
|
||||
description=message_invoice.description,
|
||||
currency=message_invoice.currency,
|
||||
|
|
@ -23,7 +23,6 @@ from .available_effect import AvailableEffect
|
|||
from .contact import Contact
|
||||
from .dice import Dice
|
||||
from .document import Document
|
||||
from .extended_media_preview import ExtendedMediaPreview
|
||||
from .game import Game
|
||||
from .gifted_premium import GiftedPremium
|
||||
from .giveaway import Giveaway
|
||||
|
|
@ -36,7 +35,6 @@ from .media_area_channel_post import MediaAreaChannelPost
|
|||
from .media_area_coordinates import MediaAreaCoordinates
|
||||
from .message import Message
|
||||
from .message_entity import MessageEntity
|
||||
from .paid_media import PaidMedia
|
||||
from .photo import Photo
|
||||
from .poll import Poll
|
||||
from .poll_option import PollOption
|
||||
|
|
@ -56,7 +54,6 @@ from .web_app_data import WebAppData
|
|||
from .web_page import WebPage
|
||||
from .web_page_empty import WebPageEmpty
|
||||
from .web_page_preview import WebPagePreview
|
||||
from .message_invoice import MessageInvoice
|
||||
from .message_reactions import MessageReactions
|
||||
from .message_reaction_updated import MessageReactionUpdated
|
||||
from .message_reaction_count_updated import MessageReactionCountUpdated
|
||||
|
|
@ -69,7 +66,7 @@ from .story_views import StoryViews
|
|||
from .exported_story_link import ExportedStoryLink
|
||||
|
||||
__all__ = [
|
||||
"Animation", "Audio", "AvailableEffect", "Contact", "Document", "ExtendedMediaPreview", "Game", "GiftedPremium", "Giveaway", "GiveawayLaunched", "GiveawayResult", "LabeledPrice", "Location", "MediaArea", "MediaAreaChannelPost", "MediaAreaCoordinates", "Message", "MessageEntity", "PaidMedia", "Photo", "Thumbnail",
|
||||
"Animation", "Audio", "AvailableEffect", "Contact", "Document", "Game", "GiftedPremium", "Giveaway", "GiveawayLaunched", "GiveawayResult", "LabeledPrice", "Location", "MediaArea", "MediaAreaChannelPost", "MediaAreaCoordinates", "Message", "MessageEntity", "Photo", "Thumbnail",
|
||||
"StrippedThumbnail", "Poll", "PollOption", "Sticker", "StickerSet", "Venue", "Video", "VideoNote", "Voice", "WebPage", "WebPageEmpty", "WebPagePreview", "Dice",
|
||||
"Reaction", "WebAppData", "MessageInvoice", "MessageReactions", "ReactionCount", "ReactionType", "MessageReactionUpdated", "MessageReactionCountUpdated", "MessageStory", "Story", "StoryDeleted", "StorySkipped", "StoryViews", "StoryForwardHeader", "StoriesPrivacyRules", "ExportedStoryLink"
|
||||
"Reaction", "WebAppData", "MessageReactions", "ReactionCount", "ReactionType", "MessageReactionUpdated", "MessageReactionCountUpdated", "MessageStory", "Story", "StoryDeleted", "StorySkipped", "StoryViews", "StoryForwardHeader", "StoriesPrivacyRules", "ExportedStoryLink"
|
||||
]
|
||||
|
|
|
|||
|
|
@ -226,7 +226,7 @@ class Message(Object, Update):
|
|||
giveaway_result (:obj:`~pyrogram.types.GiveawayResult`, *optional*):
|
||||
Message is a giveaway result, information about the giveaway result.
|
||||
|
||||
invoice (:obj:`~pyrogram.types.MessageInvoice`, *optional*):
|
||||
invoice (:obj:`~pyrogram.types.Invoice`, *optional*):
|
||||
Message is an invoice for a payment, information about the invoice.
|
||||
|
||||
story (:obj:`~pyrogram.types.MessageStory` | :obj:`~pyrogram.types.Story`, *optional*):
|
||||
|
|
@ -485,7 +485,7 @@ class Message(Object, Update):
|
|||
giveaway: "types.Giveaway" = None,
|
||||
giveaway_result: "types.GiveawayResult" = None,
|
||||
boosts_applied: int = None,
|
||||
invoice: "types.MessageInvoice" = None,
|
||||
invoice: "types.Invoice" = None,
|
||||
story: Union["types.MessageStory", "types.Story"] = None,
|
||||
video: "types.Video" = None,
|
||||
voice: "types.Voice" = None,
|
||||
|
|
@ -1092,7 +1092,7 @@ class Message(Object, Update):
|
|||
dice = types.Dice._parse(client, media)
|
||||
media_type = enums.MessageMediaType.DICE
|
||||
elif isinstance(media, raw.types.MessageMediaInvoice):
|
||||
invoice = types.MessageInvoice._parse(media)
|
||||
invoice = types.Invoice._parse(media)
|
||||
media = enums.MessageMediaType.INVOICE
|
||||
elif isinstance(media, raw.types.MessageMediaPaidMedia):
|
||||
paid_media = types.PaidMedia._parse(client, media)
|
||||
|
|
|
|||
Loading…
Reference in a new issue