Archived
1

Work on squads, alerts on new user with empty or spy profile

Closes #1
Closes #2
This commit is contained in:
2017-11-13 22:51:50 +04:00
parent 76b6245b8e
commit 5c08899d25
23 changed files with 338 additions and 19 deletions

View File

@@ -16,6 +16,7 @@ import (
"lab.pztrn.name/fat0troll/i2_bot/lib/parsers/parsersinterface"
"lab.pztrn.name/fat0troll/i2_bot/lib/router/routerinterface"
"lab.pztrn.name/fat0troll/i2_bot/lib/talkers/talkersinterface"
"lab.pztrn.name/fat0troll/i2_bot/lib/welcomer/welcomerinterface"
)
// Context is an application context struct
@@ -28,6 +29,7 @@ type Context struct {
Db *sqlx.DB
Talkers talkersinterface.TalkersInterface
Getters gettersinterface.GettersInterface
Welcomer welcomerinterface.WelcomerInterface
}
// Init is a initialization function for context
@@ -65,6 +67,11 @@ func (c *Context) RegisterGettersInterface(gi gettersinterface.GettersInterface)
c.Getters = gi
}
// RegisterWelcomerInterface registering welcomer interface in application
func (c *Context) RegisterWelcomerInterface(wi welcomerinterface.WelcomerInterface) {
c.Welcomer = wi
}
// RunDatabaseMigrations applies migrations on bot's startup
func (c *Context) RunDatabaseMigrations() {
c.Migrations.SetDialect("mysql")