From 21762e8afb7948c28da3a809998610a4a67f1a4b Mon Sep 17 00:00:00 2001 From: curly60e <55191248+curly60e@users.noreply.github.com> Date: Wed, 27 May 2020 10:49:24 -0300 Subject: [PATCH] Added Question Continue This change the timer and leave the user to decide when do the payment. --- apisnd.py | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/apisnd.py b/apisnd.py index e1485c1..5f80bf6 100644 --- a/apisnd.py +++ b/apisnd.py @@ -1,7 +1,6 @@ import os import qrcode import requests -import time as t def apisender(): qr = qrcode.QRCode( @@ -17,8 +16,10 @@ def apisender(): amountmsat = input("\nInsert the amount in MSats: ") curl = 'curl -F ' "bid={} ".format(amountmsat) + '-F ' + ' "message=' + message + sentby + '" ' + url - sh = os.popen(str(curl)).read() - shh = sh.split(',') + sh = os.popen(curl) + sh0 = sh.read() + sh1 = str(sh0) + shh = sh1.split(',') invoice = str(shh[6]) #---------------Token----------- @@ -51,9 +52,10 @@ def apisender(): qr.print_ascii() print("\033[0;37;40m") print("\nLND Invoice: " + cln + "\n") - t.sleep(30) - devAddr() - + sh.close() + continue1 = input("Continue? Y: ") + if continue1 == "Y" or continue1 == "y": + devAddr() def apisenderFile(): qr = qrcode.QRCode( @@ -67,8 +69,11 @@ def apisenderFile(): print("ATENTION: Minimum amount for sending a File is 50000 MSats") amountmsat = input("\nInsert the amount in MSats: ") curl = 'curl -F ' "bid={} ".format(amountmsat) + '-F ' + ' "file=@' + message + '" ' + url - sh = os.popen(str(curl)).read() - shh = sh.split(',') + + sh = os.popen(curl) + sh0 = sh.read() + sh1 = str(sh0) + shh = sh1.split(',') invoice = str(shh[6]) #---------------Token----------- @@ -101,9 +106,11 @@ def apisenderFile(): qr.print_ascii() print("\033[0;37;40m") print("\nLND Invoice: " + cln) - t.sleep(30) - devAddr() - + sh.close() + continue1 = input("Continue? Y: ") + if continue1 == "Y" or continue1 == "y": + devAddr() + def devAddr(): qr = qrcode.QRCode( version=1, @@ -128,5 +135,4 @@ def devAddr(): qr.print_ascii() print("\033[0;37;40m") print("LND Invoice: " + ln1) - - + response.close()