правки
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -18,7 +18,8 @@ type State interface {
|
||||
}
|
||||
|
||||
type Session struct {
|
||||
FirstName string
|
||||
JWT string
|
||||
WorkspaceID string
|
||||
FirstName string
|
||||
JWT string
|
||||
WorkspaceID string
|
||||
WasRestarted bool
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user