From 7ae5034afc5527c9174ae43bf4c0fd4cd9bece1e Mon Sep 17 00:00:00 2001 From: far-galaxy Date: Mon, 7 Aug 2023 16:20:39 +0400 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=BE:=20=D0=BE=D1=88=D0=B8=D0=B1=D0=BA=D0=B0=20?= =?UTF-8?q?=D1=81=D0=BE=20=D0=B2=D1=80=D0=B5=D0=BC=D0=B5=D0=BD=D0=B5=D0=BC?= =?UTF-8?q?=20=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD=D0=BE:=20=D1=82?= =?UTF-8?q?=D0=B5=D1=81=D1=82=D1=8B=20TG=20=D0=BD=D0=B0=20=D0=B2=D0=BD?= =?UTF-8?q?=D1=83=D1=82=D1=80=D0=B5=D0=BD=D0=BD=D0=B8=D1=85=20=D1=80=D0=B0?= =?UTF-8?q?=D1=81=D0=BF=D0=B8=D1=81=D0=B0=D0=BD=D0=B8=D1=8F=D1=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/tg/bot.go | 2 +- modules/tg/handlers.go | 4 ++-- modules/tg/tg_test.go | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/tg/bot.go b/modules/tg/bot.go index 5dfbad3..d3056bd 100644 --- a/modules/tg/bot.go +++ b/modules/tg/bot.go @@ -130,7 +130,7 @@ func (bot *Bot) HandleUpdate(update tgbotapi.Update, now ...time.Time) (tgbotapi err = bot.Start(user) case database.Ready: if len(now) == 0 { - now[0] = msg.Time() + now = append(now, msg.Time()) } return bot.Find(now[0], user, msg.Text) default: diff --git a/modules/tg/handlers.go b/modules/tg/handlers.go index 4f14546..d57f2d8 100644 --- a/modules/tg/handlers.go +++ b/modules/tg/handlers.go @@ -167,7 +167,7 @@ func (bot *Bot) GetShedule(user *database.TgUser, query *tgbotapi.CallbackQuery, SheduleId: groupId, } if len(now) == 0 { - now[0] = time.Now() + now = append(now, time.Now()) } _, err = bot.GetSummary(now[0], user, []database.ShedulesInUser{shedule}, false, *query.Message) } @@ -192,7 +192,7 @@ func (bot *Bot) HandleSummary(user *database.TgUser, query *tgbotapi.CallbackQue }*/ } else { if len(now) == 0 { - now[0] = time.Now() + now = append(now, time.Now()) } switch data[1] { case "day": diff --git a/modules/tg/tg_test.go b/modules/tg/tg_test.go index 946a9b0..052dddb 100644 --- a/modules/tg/tg_test.go +++ b/modules/tg/tg_test.go @@ -95,9 +95,9 @@ func TestInitUser(t *testing.T) { var dialog = []string{ "/start", "1000", - "Батурин", + "Павлов", "100", - "Балякин", + "Иванов", "aaa", "aaa", }