Compare commits

...
Author SHA1 Message Date
callebtc 5b5f0ef6a2 readd send 2022-08-28 19:26:49 +02:00
calleandGitHub c5f106187f Merge pull request #382 from LightningTipBot/webapp/test1
Webapp/test1
2022-08-28 15:20:42 +02:00
2 changed files with 22 additions and 3 deletions
+5 -3
View File
@@ -13,10 +13,11 @@ import (
// we can't use space in the label of buttons, because string splitting will mess everything up.
const (
MainMenuCommandWebApp = "⬇️ LNURL"
MainMenuCommandWebApp = "⤵️ Receive"
MainMenuCommandBalance = "Balance"
MainMenuCommandInvoice = "⚡️ Invoice"
MainMenuCommandHelp = "📖 Help"
MainMenuCommandSend = "⤴️ Send"
SendMenuCommandEnter = "👤 Enter"
)
@@ -24,6 +25,7 @@ var (
mainMenu = &tb.ReplyMarkup{ResizeKeyboard: true}
btnHelpMainMenu = mainMenu.Text(MainMenuCommandHelp)
btnWebAppMainMenu = mainMenu.Text(MainMenuCommandWebApp)
btnSendMainMenu = mainMenu.Text(MainMenuCommandSend)
btnBalanceMainMenu = mainMenu.Text(MainMenuCommandBalance)
btnInvoiceMainMenu = mainMenu.Text(MainMenuCommandInvoice)
@@ -36,7 +38,7 @@ func init() {
btnBalanceMainMenu = mainMenu.Text(MainMenuCommandBalance)
mainMenu.Reply(
mainMenu.Row(btnBalanceMainMenu),
mainMenu.Row(btnInvoiceMainMenu, btnWebAppMainMenu, btnHelpMainMenu),
mainMenu.Row(btnInvoiceMainMenu, btnWebAppMainMenu, btnSendMainMenu),
)
}
@@ -98,7 +100,7 @@ func (bot *TipBot) mainMenuBalanceButtonUpdate(to int64) {
bot.appendWebAppLinkToButton(&btnWebAppMainMenu, user)
mainMenu.Reply(
mainMenu.Row(btnBalanceMainMenu),
mainMenu.Row(btnInvoiceMainMenu, btnWebAppMainMenu, btnHelpMainMenu),
mainMenu.Row(btnInvoiceMainMenu, btnWebAppMainMenu, btnSendMainMenu),
)
}
}
+17
View File
@@ -245,6 +245,23 @@ func (bot TipBot) getHandler() []InterceptionWrapper {
},
},
},
{
Endpoints: []interface{}{&btnSendMainMenu},
Handler: bot.keyboardSendHandler,
Interceptor: &Interceptor{
Before: []intercept.Func{
bot.localizerInterceptor,
bot.logMessageInterceptor,
bot.requireUserInterceptor,
bot.loadReplyToInterceptor,
bot.lockInterceptor,
},
OnDefer: []intercept.Func{
bot.unlockInterceptor,
},
},
},
// previously, this was the send menu but it
// was replaced with the webapp
// {