fix: move user table definition into db file

This commit is contained in:
Akulij 2025-03-25 11:54:44 +08:00
parent 7bba99c007
commit 973a85061c
2 changed files with 8 additions and 8 deletions

View File

@ -7,6 +7,14 @@ import (
"gorm.io/gorm"
)
func (u User) IsAdmin() bool {
return u.RoleBitmask&1 == 1
}
func (u User) IsEffectiveAdmin() bool {
return u.RoleBitmask&0b10 == 0b10
}
type BotContent struct {
gorm.Model
Literal string

View File

@ -24,14 +24,6 @@ type User struct {
RoleBitmask uint
}
func (u User) IsAdmin() bool {
return u.RoleBitmask&1 == 1
}
func (u User) IsEffectiveAdmin() bool {
return u.RoleBitmask&0b10 == 0b10
}
type BotController struct {
cfg config.Config
bot *tgbotapi.BotAPI