KickerBot/db/structs.go

63 lines
1.6 KiB
Go
Raw Permalink 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" }
2023-09-13 22:33:53 +03:00
type AdminTopic struct {
tongo.Item `bson:",inline"`
ChatId int64 `bson:"chat_id"`
TopicId int64 `bson:"topic_id"`
}
func (AdminTopic) Coll() string { return "admin_topics" }
2023-12-07 22:02:36 +03:00
type LogChannel struct {
tongo.Item `bson:",inline"`
ChatId int64 `bson:"chat_id"`
}
func (LogChannel) Coll() string { return "log_channel" }
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" }
2023-09-13 22:33:53 +03:00
type Mute struct {
tongo.Item `bson:",inline"`
UserId int64 `bson:"user_id"`
ChatId int64 `bson:"chat_id"`
Message string `bson:"message"`
Date time.Time `bson:"date"`
Until time.Time `bson:"until"`
MessageLink string `bson:"link"` //https://t.me/c/1402723647/279354/363305
}
func (Mute) Coll() string { return "mutes" }