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"
|
"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 {
|
type BotContent struct {
|
||||||
gorm.Model
|
gorm.Model
|
||||||
Literal string
|
Literal string
|
||||||
|
|||||||
@ -24,14 +24,6 @@ type User struct {
|
|||||||
RoleBitmask uint
|
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 {
|
type BotController struct {
|
||||||
cfg config.Config
|
cfg config.Config
|
||||||
bot *tgbotapi.BotAPI
|
bot *tgbotapi.BotAPI
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user