pyrofork: fix PreCheckoutQuery not defined in class ShippingQuery

Signed-off-by: wulan17 <wulan17@nusantararom.org>
This commit is contained in:
wulan17 2024-09-07 16:40:12 +07:00
parent d70927e5a2
commit 930da9b858
No known key found for this signature in database
GPG key ID: 318CD6CD3A6AC0A5

View file

@ -64,7 +64,7 @@ class ShippingQuery(Object, Update):
client: "pyrogram.Client",
shipping_query: "raw.types.updateBotShippingQuery",
users: dict
) -> "PreCheckoutQuery":
) -> "types.PreCheckoutQuery":
# Try to decode pre-checkout query payload into string. If that fails, fallback to bytes instead of decoding by
# ignoring/replacing errors, this way, button clicks will still work.
try:
@ -72,7 +72,7 @@ class ShippingQuery(Object, Update):
except (UnicodeDecodeError, AttributeError):
payload = shipping_query.payload
return PreCheckoutQuery(
return types.PreCheckoutQuery(
id=str(shipping_query.query_id),
from_user=types.User._parse(client, users[shipping_query.user_id]),
invoice_payload=payload,