readd send

This commit is contained in:
callebtc 2022-08-28 19:26:49 +02:00
parent c5f106187f
commit 5b5f0ef6a2
2 changed files with 22 additions and 3 deletions

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),
)
}
}

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
// {