fix: mode user table definition to db file

This commit is contained in:
Akulij 2025-03-25 11:58:02 +08:00
parent 3a449c4d0d
commit 97a25308d8
2 changed files with 8 additions and 8 deletions

View File

@ -7,6 +7,14 @@ import (
"gorm.io/gorm"
)
type User struct {
gorm.Model
ID int64
State string
MsgCounter uint
RoleBitmask uint
}
func (u User) IsAdmin() bool {
return u.RoleBitmask&1 == 1
}

View File

@ -16,14 +16,6 @@ import (
"gorm.io/gorm"
)
type User struct {
gorm.Model
ID int64
State string
MsgCounter uint
RoleBitmask uint
}
type BotController struct {
cfg config.Config
bot *tgbotapi.BotAPI