mirror of
https://github.com/lyx0/nourybot.git
synced 2024-11-13 19:49:55 +01:00
add command model
This commit is contained in:
parent
a6c164f8e0
commit
76e7a4f755
|
@ -27,11 +27,17 @@ type Models struct {
|
||||||
SetLevel(login string, level int) error
|
SetLevel(login string, level int) error
|
||||||
Delete(login string) error
|
Delete(login string) error
|
||||||
}
|
}
|
||||||
|
Commands interface {
|
||||||
|
Get(name string) (*Command, error)
|
||||||
|
Insert(name, text string) error
|
||||||
|
Delete(name string) error
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewModels(db *sql.DB) Models {
|
func NewModels(db *sql.DB) Models {
|
||||||
return Models{
|
return Models{
|
||||||
Channels: ChannelModel{DB: db},
|
Channels: ChannelModel{DB: db},
|
||||||
Users: UserModel{DB: db},
|
Users: UserModel{DB: db},
|
||||||
|
Commands: CommandModel{DB: db},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue