diff --git a/internal/telegram/buttons.go b/internal/telegram/buttons.go index 1584490..f16a6e3 100644 --- a/internal/telegram/buttons.go +++ b/internal/telegram/buttons.go @@ -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), ) } } diff --git a/internal/telegram/handler.go b/internal/telegram/handler.go index 94ae14f..04347f7 100644 --- a/internal/telegram/handler.go +++ b/internal/telegram/handler.go @@ -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 // {