From d874416005248bf6c2d4dd0a4ac83ad64c05104c Mon Sep 17 00:00:00 2001 From: Benny Date: Sat, 7 Jan 2023 14:19:20 +0100 Subject: [PATCH] show receipt --- ytdlbot/ytdl_bot.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ytdlbot/ytdl_bot.py b/ytdlbot/ytdl_bot.py index f715b4b8..71cb593c 100644 --- a/ytdlbot/ytdl_bot.py +++ b/ytdlbot/ytdl_bot.py @@ -264,7 +264,7 @@ def vip_handler(client: "Client", message: "types.Message"): bm.edit_text(msg) -def generate_invoice(amount: "int", title: "str", description: "str", payload: "bytes"): +def generate_invoice(amount: "int", title: "str", description: "str", payload: "str"): invoice = raw_types.input_media_invoice.InputMediaInvoice( invoice=( raw_types.invoice.Invoice(currency="USD", prices=[raw_types.LabeledPrice(label="price", amount=amount)])), @@ -272,7 +272,8 @@ def generate_invoice(amount: "int", title: "str", description: "str", payload: " description=description, provider=PROVIDER_TOKEN, provider_data=raw_types.DataJSON(data="{}"), - payload=payload, + payload=payload.encode(), + start_param=payload ) return invoice @@ -283,7 +284,7 @@ def topup_handler(client: "Client", message: "types.Message"): chat_id = message.chat.id client.send_chat_action(chat_id, "typing") invoice = generate_invoice(100, bot_text.topup_title, bot_text.topup_description, - f"{message.chat.id}-topup".encode()) + f"{message.chat.id}-topup") app.send( functions.messages.SendMedia(