add paramters to signal if encryption and cashu are supported and show them in the bot

(might need to be renamed if convention says other)
This commit is contained in:
Believethehype
2023-12-03 22:05:53 +01:00
parent 26dab119c3
commit 091fe10a94
16 changed files with 120 additions and 28 deletions

View File

@@ -510,10 +510,24 @@ class Bot:
if nip89content_str is not None:
nip89content = json.loads(nip89content_str)
info = ""
cashu_accepted = False
encryption_supported = False
if nip89content.get("name"):
info += "Name: " + nip89content.get("name") + "\n"
if nip89content.get("image"):
info += nip89content.get("image") + "\n"
info += "About:\n" + nip89content.get("about") + "\n"
if nip89content.get("about"):
info += "About:\n" + nip89content.get("about") + "\n\n"
if nip89content.get("acceptsCashu"):
cashu_accepted = str(nip89content.get("acceptsCashu"))
if nip89content.get("encryptionSupported"):
encryption_supported = str(nip89content.get("encryptionSupported"))
info += "Encryption supported: " + str(encryption_supported) + "\n"
info += "Cashu accepted: " + str(cashu_accepted) + "\n\n"
if nip89content.get("nip90Params"):
params = nip89content["nip90Params"]
info += "\nParameters:\n"
for param in params: