Skip to content

Commit

Permalink
show receipt
Browse files Browse the repository at this point in the history
  • Loading branch information
BennyThink committed Jan 7, 2023
1 parent c8c0482 commit d874416
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ytdlbot/ytdl_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,15 +264,16 @@ 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)])),
title=title,
description=description,
provider=PROVIDER_TOKEN,
provider_data=raw_types.DataJSON(data="{}"),
payload=payload,
payload=payload.encode(),
start_param=payload
)
return invoice

Expand All @@ -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(
Expand Down

0 comments on commit d874416

Please sign in to comment.