правки

This commit is contained in:
Artem Tsyrulnikov
2026-02-01 14:36:09 +03:00
parent b212b6c22f
commit a92f33c22f
10 changed files with 235 additions and 43 deletions

View File

@@ -320,6 +320,7 @@ func (b *Bot) Update(u *echotron.Update) {
"❌ Ошибка авторизации",
echotron.InlineKeyboardMarkup{InlineKeyboard: [][]echotron.InlineKeyboardButton{{{Text: "↻ Обновить", CallbackData: "refresh"}}}},
)
b.cleanupCallbackUI(u)
return
}
@@ -332,14 +333,7 @@ func (b *Bot) Update(u *echotron.Update) {
strings.HasPrefix(u.Message.Text, "/start project_"))
if b.CurrentState == nil && !isStartCommand {
_, err := b.SendMessage(
"⚠️ Бот был перезапущен. Извиняемся за неудобства :(\n\nВас отправили в главное меню",
b.ChatID,
&echotron.MessageOptions{ParseMode: echotron.HTML},
)
if err != nil {
log.Error().Err(err).Msg("SendMessage failed while sending restart notice")
}
b.Session.WasRestarted = true
b.SetState(b.commandRouter("/start"), EditMessage)
return
}
@@ -348,14 +342,7 @@ func (b *Bot) Update(u *echotron.Update) {
// 1. Команды (приоритетный маршрут)
if u.Message != nil {
switch {
case u.Message.Text == "/start":
b.SetState(b.commandRouter("/start"), NewMessage)
return
case u.Message.Text == "/start login":
b.SetState(b.commandRouter("/start login"), NewMessage)
return
case strings.HasPrefix(u.Message.Text, "/start project_"):
if strings.HasPrefix(u.Message.Text, "/") {
b.SetState(b.commandRouter(u.Message.Text), NewMessage)
return
}