Merge pull request #32 from curly60e/curly60e-patch-23

Bug fix invoice request
This commit is contained in:
curly60e 2020-06-05 21:45:32 -03:00 committed by GitHub
commit 692ce4e8c8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -24,6 +24,19 @@ def apisender():
sh = os.popen(curl)
sh0 = sh.read()
while True:
if 'Bid too low' in sh0:
print("ATENTION: Per byte bid cannot be below 50 millisatoshis per byte.\n")
url = 'https://api.blockstream.space/order'
message = input("\nInsert your Message: ")
print("ATENTION: Minimum amount for sending a text is 5000 MSats")
amountmsat = input("\nInsert the amount in MSats: ")
curl = 'curl -F ' "bid={} ".format(amountmsat) + '-F ' + ' "message=' + message + sentby + '" ' + url
sh = os.popen(curl)
sh0 = sh.read()
elif 'lightning_invoice' in sh0:
break
sh1 = str(sh0)
shh = sh1.split(',')
invoice = str(shh[6])
@ -76,10 +89,22 @@ def apisenderFile():
message = input("\nInsert the path to the File: ")
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
curl = 'curl -F ' "bid={} ".format(amountmsat) + '-F ' + ' "file=@' + message + '" ' + url
sh = os.popen(curl)
sh0 = sh.read()
while True:
if 'Bid too low' in sh0:
print("ATENTION: Per byte bid cannot be below 50 millisatoshis per byte.\n")
url = 'https://api.blockstream.space/order'
message = input("\nInsert the path to the File: ")
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(curl)
sh0 = sh.read()
elif 'lightning_invoice' in sh0:
break
sh1 = str(sh0)
shh = sh1.split(',')
invoice = str(shh[6])
@ -158,5 +183,3 @@ def donate():
menuB = (input("\033[1;32;40mSelect option: \033[0;37;40m"))
if menuB == "A" or menuB == "a":
devAddr()