KickerBot/db/structs.go

36 lines
974 B
Go
Raw Normal View History

package db
2023-02-14 00:50:21 +03:00
import (
"time"
"git.nefrace.ru/nefrace/tongo"
)
type Chat struct {
2023-02-14 00:50:21 +03:00
tongo.Item `bson:",inline"`
2023-02-14 01:21:44 +03:00
ChatId int64 `bson:"chat_id"`
2023-02-14 00:50:21 +03:00
Title string
TopicId int64 `bson:"topic_id"`
Greet string `bson:"greet"`
}
2023-02-14 00:50:21 +03:00
func (Chat) Coll() string { return "chats" }
type User struct {
2023-02-14 00:50:21 +03:00
tongo.Item `bson:",inline"`
UserId int64 `bson:"user_id"`
ChatId int64 `bson:"chat_id"`
Username string `bson:"username"`
FirstName string `bson:"first_name"`
LastName string `bson:"last_name"`
CorrectAnswer int8 `bson:"correct_answer"`
CaptchaMessage int `bson:"captcha_message"`
IsJoined bool `bson:"is_joined"`
2023-02-14 00:50:21 +03:00
DateJoined time.Time `bson:"date_joined"`
JoinedMessage int `bson:"joined_message"`
LastNotification time.Time `bson:"last_notification"`
2023-09-09 01:45:47 +03:00
Warnings int `bson:"warnings"`
}
2023-02-14 00:50:21 +03:00
func (User) Coll() string { return "users" }