mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2026-01-07 15:34:52 +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
|
forward_messages
|
||||||
copy_message
|
copy_message
|
||||||
copy_media_group
|
copy_media_group
|
||||||
send_paid_media
|
|
||||||
send_photo
|
send_photo
|
||||||
send_audio
|
send_audio
|
||||||
send_document
|
send_document
|
||||||
send_invoice
|
|
||||||
send_sticker
|
send_sticker
|
||||||
send_video
|
send_video
|
||||||
send_animation
|
send_animation
|
||||||
|
|
@ -367,19 +365,21 @@ def pyrogram_api():
|
||||||
set_chat_menu_button
|
set_chat_menu_button
|
||||||
get_chat_menu_button
|
get_chat_menu_button
|
||||||
answer_web_app_query
|
answer_web_app_query
|
||||||
answer_pre_checkout_query
|
|
||||||
answer_shipping_query
|
|
||||||
refund_star_payment
|
|
||||||
get_bot_info
|
get_bot_info
|
||||||
set_bot_info
|
set_bot_info
|
||||||
get_collectible_item_info
|
get_collectible_item_info
|
||||||
""",
|
""",
|
||||||
business="""
|
business="""
|
||||||
Telegram Business
|
Telegram Business
|
||||||
|
answer_pre_checkout_query
|
||||||
|
answer_shipping_query
|
||||||
create_invoice_link
|
create_invoice_link
|
||||||
get_business_connection
|
get_business_connection
|
||||||
get_stars_transactions
|
get_stars_transactions
|
||||||
get_stars_transactions_by_id
|
get_stars_transactions_by_id
|
||||||
|
refund_star_payment
|
||||||
|
send_invoice
|
||||||
|
send_paid_media
|
||||||
""",
|
""",
|
||||||
authorization="""
|
authorization="""
|
||||||
Authorization
|
Authorization
|
||||||
|
|
@ -503,7 +503,6 @@ def pyrogram_api():
|
||||||
Giveaway
|
Giveaway
|
||||||
GiveawayLaunched
|
GiveawayLaunched
|
||||||
GiveawayResult
|
GiveawayResult
|
||||||
MessageInvoice
|
|
||||||
MessageStory
|
MessageStory
|
||||||
WebPage
|
WebPage
|
||||||
WebPageEmpty
|
WebPageEmpty
|
||||||
|
|
@ -530,8 +529,6 @@ def pyrogram_api():
|
||||||
ReactionType
|
ReactionType
|
||||||
MessageReactionUpdated
|
MessageReactionUpdated
|
||||||
MessageReactionCountUpdated
|
MessageReactionCountUpdated
|
||||||
ExtendedMediaPreview
|
|
||||||
PaidMedia
|
|
||||||
""",
|
""",
|
||||||
stories="""
|
stories="""
|
||||||
Stories
|
Stories
|
||||||
|
|
@ -557,12 +554,6 @@ def pyrogram_api():
|
||||||
BotAllowed
|
BotAllowed
|
||||||
BotApp
|
BotApp
|
||||||
BotBusinessConnection
|
BotBusinessConnection
|
||||||
PaymentInfo
|
|
||||||
PaymentRefunded
|
|
||||||
ShippingAddress
|
|
||||||
ShippingOption
|
|
||||||
ShippingQuery
|
|
||||||
SuccessfulPayment
|
|
||||||
""",
|
""",
|
||||||
bot_keyboards="""
|
bot_keyboards="""
|
||||||
Bot keyboards
|
Bot keyboards
|
||||||
|
|
@ -602,9 +593,18 @@ def pyrogram_api():
|
||||||
""",
|
""",
|
||||||
business="""
|
business="""
|
||||||
Telegram Business
|
Telegram Business
|
||||||
|
ExtendedMediaPreview
|
||||||
InputStarsTransaction
|
InputStarsTransaction
|
||||||
|
Invoice
|
||||||
|
PaidMedia
|
||||||
|
PaymentInfo
|
||||||
|
PaymentRefunded
|
||||||
|
ShippingAddress
|
||||||
|
ShippingOption
|
||||||
|
ShippingQuery
|
||||||
StarsStatus
|
StarsStatus
|
||||||
StarsTransaction
|
StarsTransaction
|
||||||
|
SuccessfulPayment
|
||||||
""",
|
""",
|
||||||
input_media="""
|
input_media="""
|
||||||
Input Media
|
Input Media
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,6 @@
|
||||||
|
|
||||||
from .answer_callback_query import AnswerCallbackQuery
|
from .answer_callback_query import AnswerCallbackQuery
|
||||||
from .answer_inline_query import AnswerInlineQuery
|
from .answer_inline_query import AnswerInlineQuery
|
||||||
from .answer_pre_checkout_query import AnswerPreCheckoutQuery
|
|
||||||
from .answer_web_app_query import AnswerWebAppQuery
|
from .answer_web_app_query import AnswerWebAppQuery
|
||||||
from .delete_bot_commands import DeleteBotCommands
|
from .delete_bot_commands import DeleteBotCommands
|
||||||
from .get_bot_commands import GetBotCommands
|
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_collectible_item_info import GetCollectibleItemInfo
|
||||||
from .get_game_high_scores import GetGameHighScores
|
from .get_game_high_scores import GetGameHighScores
|
||||||
from .get_inline_bot_results import GetInlineBotResults
|
from .get_inline_bot_results import GetInlineBotResults
|
||||||
from .refund_stars_payment import RefundStarPayment
|
|
||||||
from .request_callback_answer import RequestCallbackAnswer
|
from .request_callback_answer import RequestCallbackAnswer
|
||||||
from .send_game import SendGame
|
from .send_game import SendGame
|
||||||
from .send_inline_bot_result import SendInlineBotResult
|
from .send_inline_bot_result import SendInlineBotResult
|
||||||
|
|
@ -59,8 +57,6 @@ class Bots(
|
||||||
SetChatMenuButton,
|
SetChatMenuButton,
|
||||||
GetChatMenuButton,
|
GetChatMenuButton,
|
||||||
AnswerWebAppQuery,
|
AnswerWebAppQuery,
|
||||||
AnswerPreCheckoutQuery,
|
|
||||||
RefundStarPayment,
|
|
||||||
GetCollectibleItemInfo
|
GetCollectibleItemInfo
|
||||||
):
|
):
|
||||||
pass
|
pass
|
||||||
|
|
|
||||||
|
|
@ -16,16 +16,24 @@
|
||||||
# You should have received a copy of the GNU Lesser General Public License
|
# You should have received a copy of the GNU Lesser General Public License
|
||||||
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
|
# 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 .create_invoice_link import CreateInvoiceLink
|
||||||
from .get_business_connection import GetBusinessConnection
|
from .get_business_connection import GetBusinessConnection
|
||||||
from .get_stars_transactions import GetStarsTransactions
|
from .get_stars_transactions import GetStarsTransactions
|
||||||
from .get_stars_transactions_by_id import GetStarsTransactionsById
|
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(
|
class TelegramBusiness(
|
||||||
|
AnswerPreCheckoutQuery,
|
||||||
CreateInvoiceLink,
|
CreateInvoiceLink,
|
||||||
GetBusinessConnection,
|
GetBusinessConnection,
|
||||||
GetStarsTransactions,
|
GetStarsTransactions,
|
||||||
GetStarsTransactionsById
|
GetStarsTransactionsById,
|
||||||
|
RefundStarPayment,
|
||||||
|
SendInvoice,
|
||||||
|
SendPaidMedia
|
||||||
):
|
):
|
||||||
pass
|
pass
|
||||||
|
|
|
||||||
|
|
@ -54,11 +54,9 @@ from .send_chat_action import SendChatAction
|
||||||
from .send_contact import SendContact
|
from .send_contact import SendContact
|
||||||
from .send_dice import SendDice
|
from .send_dice import SendDice
|
||||||
from .send_document import SendDocument
|
from .send_document import SendDocument
|
||||||
from .send_invoice import SendInvoice
|
|
||||||
from .send_location import SendLocation
|
from .send_location import SendLocation
|
||||||
from .send_media_group import SendMediaGroup
|
from .send_media_group import SendMediaGroup
|
||||||
from .send_message import SendMessage
|
from .send_message import SendMessage
|
||||||
from .send_paid_media import SendPaidMedia
|
|
||||||
from .send_photo import SendPhoto
|
from .send_photo import SendPhoto
|
||||||
from .send_poll import SendPoll
|
from .send_poll import SendPoll
|
||||||
from .send_reaction import SendReaction
|
from .send_reaction import SendReaction
|
||||||
|
|
@ -88,11 +86,9 @@ class Messages(
|
||||||
SendContact,
|
SendContact,
|
||||||
SendDocument,
|
SendDocument,
|
||||||
SendAnimation,
|
SendAnimation,
|
||||||
SendInvoice,
|
|
||||||
SendLocation,
|
SendLocation,
|
||||||
SendMediaGroup,
|
SendMediaGroup,
|
||||||
SendMessage,
|
SendMessage,
|
||||||
SendPaidMedia,
|
|
||||||
SendPhoto,
|
SendPhoto,
|
||||||
SendSticker,
|
SendSticker,
|
||||||
SendVenue,
|
SendVenue,
|
||||||
|
|
|
||||||
|
|
@ -44,19 +44,12 @@ from .menu_button import MenuButton
|
||||||
from .menu_button_commands import MenuButtonCommands
|
from .menu_button_commands import MenuButtonCommands
|
||||||
from .menu_button_default import MenuButtonDefault
|
from .menu_button_default import MenuButtonDefault
|
||||||
from .menu_button_web_app import MenuButtonWebApp
|
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_markup import ReplyKeyboardMarkup
|
||||||
from .reply_keyboard_remove import ReplyKeyboardRemove
|
from .reply_keyboard_remove import ReplyKeyboardRemove
|
||||||
from .request_peer_type_channel import RequestPeerTypeChannel
|
from .request_peer_type_channel import RequestPeerTypeChannel
|
||||||
from .request_peer_type_chat import RequestPeerTypeChat
|
from .request_peer_type_chat import RequestPeerTypeChat
|
||||||
from .request_peer_type_user import RequestPeerTypeUser
|
from .request_peer_type_user import RequestPeerTypeUser
|
||||||
from .sent_web_app_message import SentWebAppMessage
|
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
|
from .web_app_info import WebAppInfo
|
||||||
|
|
||||||
__all__ = [
|
__all__ = [
|
||||||
|
|
@ -93,12 +86,5 @@ __all__ = [
|
||||||
"MenuButtonCommands",
|
"MenuButtonCommands",
|
||||||
"MenuButtonWebApp",
|
"MenuButtonWebApp",
|
||||||
"MenuButtonDefault",
|
"MenuButtonDefault",
|
||||||
"SentWebAppMessage",
|
"SentWebAppMessage"
|
||||||
"ShippingAddress",
|
|
||||||
"ShippingOption",
|
|
||||||
"ShippingQuery",
|
|
||||||
"PaymentInfo",
|
|
||||||
"PaymentRefunded",
|
|
||||||
"PreCheckoutQuery",
|
|
||||||
"SuccessfulPayment"
|
|
||||||
]
|
]
|
||||||
|
|
|
||||||
|
|
@ -16,12 +16,32 @@
|
||||||
# You should have received a copy of the GNU Lesser General Public License
|
# You should have received a copy of the GNU Lesser General Public License
|
||||||
# along with Pyrofork. If not, see <http://www.gnu.org/licenses/>.
|
# along with Pyrofork. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
from .extended_media_preview import ExtendedMediaPreview
|
||||||
from .input_stars_transaction import InputStarsTransaction
|
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_status import StarsStatus
|
||||||
from .stars_transaction import StarsTransaction
|
from .stars_transaction import StarsTransaction
|
||||||
|
from .successful_payment import SuccessfulPayment
|
||||||
|
|
||||||
__all__ = [
|
__all__ = [
|
||||||
|
"ExtendedMediaPreview",
|
||||||
|
"Invoice",
|
||||||
"InputStarsTransaction",
|
"InputStarsTransaction",
|
||||||
|
"PaidMedia",
|
||||||
|
"PaymentInfo",
|
||||||
|
"PaymentRefunded",
|
||||||
|
"PreCheckoutQuery",
|
||||||
"StarsStatus",
|
"StarsStatus",
|
||||||
"StarsTransaction"
|
"StarsTransaction",
|
||||||
|
"ShippingAddress",
|
||||||
|
"ShippingOption",
|
||||||
|
"ShippingQuery",
|
||||||
|
"SuccessfulPayment"
|
||||||
]
|
]
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ from pyrogram import raw, types, utils
|
||||||
from ..object import Object
|
from ..object import Object
|
||||||
|
|
||||||
|
|
||||||
class MessageInvoice(Object):
|
class Invoice(Object):
|
||||||
"""Contains information about an Invoice.
|
"""Contains information about an Invoice.
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
|
|
@ -78,8 +78,8 @@ class MessageInvoice(Object):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _parse(
|
def _parse(
|
||||||
message_invoice: "raw.types.MessageMediaInvoice"
|
message_invoice: "raw.types.MessageMediaInvoice"
|
||||||
) -> "MessageInvoice":
|
) -> "Invoice":
|
||||||
return MessageInvoice(
|
return Invoice(
|
||||||
title=message_invoice.title,
|
title=message_invoice.title,
|
||||||
description=message_invoice.description,
|
description=message_invoice.description,
|
||||||
currency=message_invoice.currency,
|
currency=message_invoice.currency,
|
||||||
|
|
@ -23,7 +23,6 @@ from .available_effect import AvailableEffect
|
||||||
from .contact import Contact
|
from .contact import Contact
|
||||||
from .dice import Dice
|
from .dice import Dice
|
||||||
from .document import Document
|
from .document import Document
|
||||||
from .extended_media_preview import ExtendedMediaPreview
|
|
||||||
from .game import Game
|
from .game import Game
|
||||||
from .gifted_premium import GiftedPremium
|
from .gifted_premium import GiftedPremium
|
||||||
from .giveaway import Giveaway
|
from .giveaway import Giveaway
|
||||||
|
|
@ -36,7 +35,6 @@ from .media_area_channel_post import MediaAreaChannelPost
|
||||||
from .media_area_coordinates import MediaAreaCoordinates
|
from .media_area_coordinates import MediaAreaCoordinates
|
||||||
from .message import Message
|
from .message import Message
|
||||||
from .message_entity import MessageEntity
|
from .message_entity import MessageEntity
|
||||||
from .paid_media import PaidMedia
|
|
||||||
from .photo import Photo
|
from .photo import Photo
|
||||||
from .poll import Poll
|
from .poll import Poll
|
||||||
from .poll_option import PollOption
|
from .poll_option import PollOption
|
||||||
|
|
@ -56,7 +54,6 @@ from .web_app_data import WebAppData
|
||||||
from .web_page import WebPage
|
from .web_page import WebPage
|
||||||
from .web_page_empty import WebPageEmpty
|
from .web_page_empty import WebPageEmpty
|
||||||
from .web_page_preview import WebPagePreview
|
from .web_page_preview import WebPagePreview
|
||||||
from .message_invoice import MessageInvoice
|
|
||||||
from .message_reactions import MessageReactions
|
from .message_reactions import MessageReactions
|
||||||
from .message_reaction_updated import MessageReactionUpdated
|
from .message_reaction_updated import MessageReactionUpdated
|
||||||
from .message_reaction_count_updated import MessageReactionCountUpdated
|
from .message_reaction_count_updated import MessageReactionCountUpdated
|
||||||
|
|
@ -69,7 +66,7 @@ from .story_views import StoryViews
|
||||||
from .exported_story_link import ExportedStoryLink
|
from .exported_story_link import ExportedStoryLink
|
||||||
|
|
||||||
__all__ = [
|
__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",
|
"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*):
|
giveaway_result (:obj:`~pyrogram.types.GiveawayResult`, *optional*):
|
||||||
Message is a giveaway result, information about the giveaway result.
|
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.
|
Message is an invoice for a payment, information about the invoice.
|
||||||
|
|
||||||
story (:obj:`~pyrogram.types.MessageStory` | :obj:`~pyrogram.types.Story`, *optional*):
|
story (:obj:`~pyrogram.types.MessageStory` | :obj:`~pyrogram.types.Story`, *optional*):
|
||||||
|
|
@ -485,7 +485,7 @@ class Message(Object, Update):
|
||||||
giveaway: "types.Giveaway" = None,
|
giveaway: "types.Giveaway" = None,
|
||||||
giveaway_result: "types.GiveawayResult" = None,
|
giveaway_result: "types.GiveawayResult" = None,
|
||||||
boosts_applied: int = None,
|
boosts_applied: int = None,
|
||||||
invoice: "types.MessageInvoice" = None,
|
invoice: "types.Invoice" = None,
|
||||||
story: Union["types.MessageStory", "types.Story"] = None,
|
story: Union["types.MessageStory", "types.Story"] = None,
|
||||||
video: "types.Video" = None,
|
video: "types.Video" = None,
|
||||||
voice: "types.Voice" = None,
|
voice: "types.Voice" = None,
|
||||||
|
|
@ -1092,7 +1092,7 @@ class Message(Object, Update):
|
||||||
dice = types.Dice._parse(client, media)
|
dice = types.Dice._parse(client, media)
|
||||||
media_type = enums.MessageMediaType.DICE
|
media_type = enums.MessageMediaType.DICE
|
||||||
elif isinstance(media, raw.types.MessageMediaInvoice):
|
elif isinstance(media, raw.types.MessageMediaInvoice):
|
||||||
invoice = types.MessageInvoice._parse(media)
|
invoice = types.Invoice._parse(media)
|
||||||
media = enums.MessageMediaType.INVOICE
|
media = enums.MessageMediaType.INVOICE
|
||||||
elif isinstance(media, raw.types.MessageMediaPaidMedia):
|
elif isinstance(media, raw.types.MessageMediaPaidMedia):
|
||||||
paid_media = types.PaidMedia._parse(client, media)
|
paid_media = types.PaidMedia._parse(client, media)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue