registerNodeMessage="📖 You did not register a node yet.\n\nCurrently supported backends: `lnd` and `lnbits`\nTo register a node, type: `/node add <Type> <Node_info>`\n*LND:* `/node add lnd <Host> <Macaroon> <Cert>`\n*LNbits:* `/node add lnbits <Host> <Key>`\n\nFor security reasons, you should *only use an invoice macaroon* for LND and an *invoice key* for LNbits."
registerNodeMessage="📖 Connect your Lightning node with your wallet.\n\nCurrently supported backends: `lnd` and `lnbits`\nTo register a node, type: `/node add <type> <info>`\n\n*LND (REST):* `/node add lnd <host> <macaroon> <cert>`\n*LNbits:* `/node add lnbits <host> <key>`\n\nℹ️ Always use `https://` for the `<host>`, even if you use a Tor node. Certificates and macaroons need to be in base64 format.\n\n⚠️ For security reasons, you should *only use an invoice macaroon* for LND and an *invoice key* for LNbits."
nodeHelpMessage="⚙️ *Commands:*\n`/node add <type> <info>` ✅ Add your node.\n`/node invoice <admount>` ⤵️ Fetch an invoice from your node.\n`/node proxy <amount>` 🔀 Proxy a payment to your node (privacy feature).\n`/node help` 📖 Show help."
checkingInvoiceMessage="⏳ Checking invoice on your node..."
invoiceNotSettledMessage="❌ Invoice has not settled yet."
checkInvoiceButtonMessage="🔄 Check invoice"
@@ -49,29 +50,34 @@ func parseUserSettingInput(ctx intercept.Context, m *tb.Message) (satdress.Backe
ifsplitlen<4{
returnparams,fmt.Errorf("not enough arguments")
}
ifstrings.ToLower(splits[2])=="lnd"{
ifsplitlen<6||splitlen>7{
returnparams,fmt.Errorf("wrong format. Use <Type> <Host> <Macaroon> <Cert>")
switchstrings.ToLower(splits[2]){
case"lnd":
ifsplitlen<5||splitlen>7{
returnparams,fmt.Errorf("wrong format. Use <Type> <Host> <Macaroon> [<Cert>]")
}
host:=splits[3]
macaroon:=splits[4]
cert:=splits[5]
varpem[]byte
ifsplitlen==6{
cert:=splits[5]
pem:=parseCertificateToPem(cert)
iflen(pem)<1{
returnparams,fmt.Errorf("certificate has invalid format")
}
}
hostsplit:=strings.Split(host,".")
iflen(hostsplit)==0{
returnparams,fmt.Errorf("host has wrong format")
}
pem:=parseCertificateToPem(cert)
iflen(pem)<1{
returnparams,fmt.Errorf("certificate has invalid format")
}
returnsatdress.LNDParams{
Cert:pem,
Host:host,
Macaroon:macaroon,
CertString:string(pem),
},nil
}elseifstrings.ToLower(splits[2])=="lnbits"{
case"lnbits":
ifsplitlen<5||splitlen>6{
returnparams,fmt.Errorf("wrong format. Use <Type> <Host> <Key>")
}
@@ -87,8 +93,9 @@ func parseUserSettingInput(ctx intercept.Context, m *tb.Message) (satdress.Backe
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.