редактирование сообщения авторизации

This commit is contained in:
Artem Tsyrulnikov
2026-01-19 19:16:13 +03:00
parent a90c8b7df6
commit 2a4e694ca4
10 changed files with 150 additions and 8 deletions

View File

@@ -32,7 +32,7 @@ func (s *Login) Enter(b *bot.Bot, mode bot.RenderMode) {
kb := Keyboard(Row(URLButton("Войти на сайт", loginURL)))
_, err = b.SendMessage(fmt.Sprintf(msgHelloLogin, usernameDisplay), b.ChatID, &echotron.MessageOptions{
res, err := b.SendMessage(fmt.Sprintf(msgHelloLogin, usernameDisplay), b.ChatID, &echotron.MessageOptions{
ReplyMarkup: kb,
ParseMode: echotron.HTML,
})
@@ -41,6 +41,12 @@ func (s *Login) Enter(b *bot.Bot, mode bot.RenderMode) {
return
}
if res.Result != nil {
if err := b.Backend.AttachLoginTokenMessage(context.Background(), token, res.Result.ID); err != nil {
log.Err(err).Msg("AttachLoginTokenMessage error")
}
}
b.SetState(&MainMenu{}, bot.NewMessage)
}
func (s *Login) HandleCallback(b *bot.Bot, u *echotron.Update) {}