Docker-compose edited, users are saving to db

This commit is contained in:
2021-12-07 10:30:23 +03:00
parent 079b255d09
commit f62aa2093e
4 changed files with 15 additions and 9 deletions

View File

@ -21,6 +21,10 @@ func userJoined(c tb.Context) error {
ChatId: m.Chat.ID,
CorrectAnswer: 0,
}
d := db.GetDatabase()
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()
d.NewUser(ctx, user)
log.Print(user)
str := fmt.Sprintf("%v", user)
c.Bot().Send(&tb.User{ID: 60441930}, str)