Add /lnurlhelp and list the note commands in the advanced help
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5.1
parent
1ed809f56c
commit
e36d522764
@@ -19,3 +19,4 @@ note - Create an LNURLcash note: /note 1000 [memo]
|
||||
notes - List your notes, or create a batch: /notes 100 x 10
|
||||
redeem - Redeem a received note: /redeem lnurlw://...
|
||||
lnurlmints - Show the LNURLcash mints and pick a default
|
||||
lnurlhelp - Help for LNURLcash notes
|
||||
|
||||
@@ -85,6 +85,17 @@ func (bot TipBot) register(h InterceptionWrapper) {
|
||||
func (bot TipBot) getHandler() []InterceptionWrapper {
|
||||
return []InterceptionWrapper{
|
||||
// LNURLcash notes (docs/lnurlcash)
|
||||
{
|
||||
Endpoints: []interface{}{"/lnurlhelp", "/notehelp"},
|
||||
Handler: bot.lnurlHelpHandler,
|
||||
Interceptor: &Interceptor{
|
||||
Before: []intercept.Func{
|
||||
bot.localizerInterceptor,
|
||||
bot.logMessageInterceptor,
|
||||
bot.loadUserInterceptor,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
Endpoints: []interface{}{"/note"},
|
||||
Handler: bot.noteHandler,
|
||||
|
||||
@@ -85,3 +85,13 @@ func (bot *TipBot) setMintHandler(ctx intercept.Context) (intercept.Context, err
|
||||
bot.tryEditMessage(ctx.Callback().Message, text, kb)
|
||||
return ctx, nil
|
||||
}
|
||||
|
||||
// lnurlHelpHandler sends the LNURLcash notes help, privately.
|
||||
func (bot *TipBot) lnurlHelpHandler(ctx intercept.Context) (intercept.Context, error) {
|
||||
m := ctx.Message()
|
||||
if !m.Private() {
|
||||
bot.tryDeleteMessage(m)
|
||||
}
|
||||
bot.trySendMessage(ctx.Sender(), TranslateUser(ctx, "noteHelpMessage"), tb.NoPreview)
|
||||
return ctx, nil
|
||||
}
|
||||
|
||||
@@ -125,6 +125,7 @@ advancedMessage = """%s
|
||||
*/link* 🔗 Link your wallet to [BlueWallet](https://bluewallet.io/) or [Zeus](https://zeusln.app/)
|
||||
*/lnurl* ⚡️ Lnurl receive or pay: `/lnurl` or `/lnurl <lnurl> [memo]`
|
||||
*/nostr* 💜 Connect to Nostr: `/nostr`
|
||||
*/lnurlhelp* 🎫 LNURLcash notes: `/lnurlhelp` (create, share and redeem bearer notes)
|
||||
*/faucet* 🚰 Create a faucet: `/faucet <capacity> <per_user>`
|
||||
*/tipjar* 🍯 Create a tipjar: `/tipjar <capacity> <per_user>`
|
||||
*/group* 🎟 Group chat features: `/group`
|
||||
@@ -413,7 +414,8 @@ generateDalleGeneratingMessage = """Your images are being generated. Please wai
|
||||
# LNURLCASH
|
||||
lnurlcashDisabledMessage = """🚫 LNURLcash notes are not enabled on this bot."""
|
||||
lnurlcashStartPrivateFirstMessage = """👋 Start a private chat with me first, then try again."""
|
||||
noteHelpMessage = """🎫 *LNURLcash notes*\n\nA note is a bearer link worth a fixed number of sats. Whoever scans it first gets the sats.\n\n`/note <amount> [memo]` creates one note.\n`/notes` lists your notes and batches.\n`/notes <amount> x <count> [memo]` creates a batch.\n`/redeem <note>` adds a received note to your balance (or just paste it).\n`/lnurlmints` shows the mints and sets your default."""
|
||||
noteHelpMessage = """🎫 *LNURLcash notes*\n\nA note is a bearer link worth a fixed number of sats. Whoever scans it first gets the sats.\n\n`/note <amount> [memo]` creates one note.\n`/notes` lists your notes and batches.\n`/notes <amount> x <count> [memo]` creates a batch.\n`/redeem <note>` adds a received note to your balance (or just paste it).\n`/lnurlmints` shows the mints and sets your default.
|
||||
`/lnurlhelp` shows this help."""
|
||||
notesHelpMessage = """📖 Usage: `/notes` or `/notes <amount> x <count> [memo]`"""
|
||||
redeemHelpMessage = """📖 Usage: `/redeem <note>` — or paste the note or send a photo of its QR code in private chat."""
|
||||
noteConfirmMessage = """🎫 *Create %d note(s)?*\n\n💸 Value: %s sat each\n🏦 Mint fee: %s sat\n💰 Total: %s sat\n🏭 Mint: %s"""
|
||||
|
||||
@@ -121,6 +121,7 @@ advancedMessage = """%s
|
||||
*/link* 🔗 Koppel uw wallet aan [BlueWallet](https://bluewallet.io/) of [Zeus](https://zeusln.app/)
|
||||
*/lnurl* ⚡️ Lnurl ontvangen of betalen: `/lnurl` of `/lnurl <lnurl> [memo]`
|
||||
*/nostr* 💜 Connect to Nostr: `/nostr`
|
||||
*/lnurlhelp* 🎫 LNURLcash-notes: `/lnurlhelp` (notes aan toonder maken, delen en inwisselen)
|
||||
*/faucet* 🚰 Maak een kraan: `/faucet <capacity> <per_user>`
|
||||
*/tipjar* 🍯 Maak een tipjar: `/tipjar <capacity> <per_user>`
|
||||
*/group* 🎟 Create group tickets: `/group add <mygroup> [<ticket_price>]`
|
||||
@@ -320,7 +321,8 @@ inlineReceiveCancelledMessage = """🚫 Ontvangen geannuleerd."""
|
||||
# LNURLCASH
|
||||
lnurlcashDisabledMessage = """🚫 LNURLcash-notes zijn op deze bot niet ingeschakeld."""
|
||||
lnurlcashStartPrivateFirstMessage = """👋 Start eerst een privéchat met mij en probeer het dan opnieuw."""
|
||||
noteHelpMessage = """🎫 *LNURLcash-notes*\n\nEen note is een link aan toonder ter waarde van een vast aantal sats. Wie hem het eerst scant, krijgt de sats.\n\n`/note <bedrag> [memo]` maakt één note.\n`/notes` toont je notes en batches.\n`/notes <bedrag> x <aantal> [memo]` maakt een batch.\n`/redeem <note>` voegt een ontvangen note toe aan je saldo (of plak hem gewoon).\n`/lnurlmints` toont de mints en kiest je standaard."""
|
||||
noteHelpMessage = """🎫 *LNURLcash-notes*\n\nEen note is een link aan toonder ter waarde van een vast aantal sats. Wie hem het eerst scant, krijgt de sats.\n\n`/note <bedrag> [memo]` maakt één note.\n`/notes` toont je notes en batches.\n`/notes <bedrag> x <aantal> [memo]` maakt een batch.\n`/redeem <note>` voegt een ontvangen note toe aan je saldo (of plak hem gewoon).\n`/lnurlmints` toont de mints en kiest je standaard.
|
||||
`/lnurlhelp` toont deze uitleg."""
|
||||
notesHelpMessage = """📖 Gebruik: `/notes` of `/notes <bedrag> x <aantal> [memo]`"""
|
||||
redeemHelpMessage = """📖 Gebruik: `/redeem <note>` — of plak de note of stuur een foto van de QR-code in een privéchat."""
|
||||
noteConfirmMessage = """🎫 *%d note(s) maken?*\n\n💸 Waarde: %s sat per stuk\n🏦 Mintkosten: %s sat\n💰 Totaal: %s sat\n🏭 Mint: %s"""
|
||||
|
||||
Reference in New Issue
Block a user