не выкидываем в главное меню

This commit is contained in:
Artem Tsyrulnikov
2026-01-19 14:21:47 +03:00
parent 72856aaf77
commit 03b490c181
2 changed files with 25 additions and 3 deletions

View File

@@ -6,6 +6,7 @@ import (
"github.com/NicoNex/echotron/v3"
"github.com/TelegramExchange/tgex-backend/tg_bot/bot"
"github.com/rs/zerolog/log"
)
type Login struct{}
@@ -31,12 +32,21 @@ func (s *Login) Enter(b *bot.Bot, mode bot.RenderMode) {
kb := Keyboard(Row(URLButton("Войти на сайт", loginURL)))
b.SendNew(fmt.Sprintf(msgHelloLogin, usernameDisplay), kb)
_, err = b.SendMessage(fmt.Sprintf(msgHelloLogin, usernameDisplay), b.ChatID, &echotron.MessageOptions{
ReplyMarkup: kb,
ParseMode: echotron.HTML,
})
if err != nil {
log.Err(err)
return
}
b.SetState(&MainMenu{}, bot.NewMessage)
}
func (s *Login) HandleCallback(b *bot.Bot, u *echotron.Update) {}
func (s *Login) HandleMessage(b *bot.Bot, u *echotron.Update) {}
func (s *Login) Handle(b *bot.Bot, u *echotron.Update) { b.SetState(&MainMenu{}, bot.NewMessage) }
func (s *Login) Handle(b *bot.Bot, u *echotron.Update) {}
func (s *Login) Exit() {}