Migration to Tongo, new logic for user storage #3
|
@ -27,16 +27,17 @@ func userJoined(b *bot, update *echotron.Update) error {
|
|||
message := update.Message
|
||||
store := tongo.NewStore[db.User](Client)
|
||||
user := db.User{
|
||||
Item: tongo.NewID(),
|
||||
UserId: message.From.ID,
|
||||
Username: message.From.Username,
|
||||
FirstName: message.From.FirstName,
|
||||
LastName: message.From.LastName,
|
||||
IsBanned: false,
|
||||
ChatId: message.Chat.ID,
|
||||
JoinedMessage: message.ID,
|
||||
CorrectAnswer: int8(captcha.CorrectAnswer),
|
||||
DateJoined: time.Now(),
|
||||
Item: tongo.NewID(),
|
||||
UserId: message.From.ID,
|
||||
Username: message.From.Username,
|
||||
FirstName: message.From.FirstName,
|
||||
LastName: message.From.LastName,
|
||||
IsBanned: false,
|
||||
ChatId: message.Chat.ID,
|
||||
JoinedMessage: message.ID,
|
||||
CorrectAnswer: int8(captcha.CorrectAnswer),
|
||||
DateJoined: time.Now(),
|
||||
LastNotification: time.Now(),
|
||||
}
|
||||
// user.CorrectAnswer = int8(captcha.CorrectAnswer)
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)
|
||||
|
|
Loading…
Reference in New Issue