From 23d4e9893e10466f279a875828993cba7ec56cb9 Mon Sep 17 00:00:00 2001 From: nefrace Date: Tue, 14 Feb 2023 10:49:39 +0300 Subject: [PATCH] Fixed getting chat from checkCaptcha --- kicker/handlers.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/kicker/handlers.go b/kicker/handlers.go index 8de4654..663de8a 100644 --- a/kicker/handlers.go +++ b/kicker/handlers.go @@ -77,12 +77,13 @@ func checkCaptcha(b *bot, update *echotron.Update) error { message := update.Message sender := message.From store := tongo.NewStore[db.User](Client) - d := db.GetDatabase() + chatStore := tongo.NewStore[db.Chat](Client) + // d := db.GetDatabase() ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second) defer cancel() if user, err := store.GetOne(ctx, tongo.E("user_id", sender.ID), tongo.E("chat_id", message.Chat.ID)); err == nil { //d.GetUser(ctx, db.User{UserId: sender.ID, ChatId: message.Chat.ID}); err == nil { if message.Chat.IsForum { - chat, err := d.GetChat(ctx, message.Chat.ID) + chat, err := chatStore.GetOne(ctx, tongo.E("chat_id", message.Chat.ID)) if err != nil { return err }