fix: move user table definition into db file
This commit is contained in:
parent
7bba99c007
commit
973a85061c
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user