2017-10-07 02:23:25 +04:00
|
|
|
|
// i2_bot – Instinct PokememBro Bot
|
|
|
|
|
// Copyright (c) 2017 Vladimir "fat0troll" Hodakov
|
|
|
|
|
|
|
|
|
|
package talkers
|
|
|
|
|
|
|
|
|
|
import (
|
2018-01-21 23:28:53 +04:00
|
|
|
|
"git.wtfteam.pro/fat0troll/i2_bot/lib/appcontext"
|
|
|
|
|
"git.wtfteam.pro/fat0troll/i2_bot/lib/talkers/talkersinterface"
|
2017-10-07 02:23:25 +04:00
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
var (
|
2017-10-18 07:03:34 +04:00
|
|
|
|
c *appcontext.Context
|
2017-10-07 02:23:25 +04:00
|
|
|
|
)
|
|
|
|
|
|
2017-10-18 09:39:50 +04:00
|
|
|
|
// Talkers is a function-handling struct for talkers
|
2017-10-18 07:03:34 +04:00
|
|
|
|
type Talkers struct{}
|
2017-10-07 02:23:25 +04:00
|
|
|
|
|
2017-10-18 09:39:50 +04:00
|
|
|
|
// New is a appcontext initialization function
|
2017-10-07 02:23:25 +04:00
|
|
|
|
func New(ac *appcontext.Context) {
|
2017-10-18 07:03:34 +04:00
|
|
|
|
c = ac
|
|
|
|
|
m := &Talkers{}
|
|
|
|
|
c.RegisterTalkersInterface(talkersinterface.TalkersInterface(m))
|
2017-10-07 02:23:25 +04:00
|
|
|
|
}
|
|
|
|
|
|
2017-10-18 09:39:50 +04:00
|
|
|
|
// Init is an initialization function for talkers
|
2017-10-07 02:23:25 +04:00
|
|
|
|
func (t *Talkers) Init() {
|
2017-11-21 06:06:32 +04:00
|
|
|
|
c.Log.Info("Initializing common Responders...")
|
2017-12-28 05:57:51 +04:00
|
|
|
|
|
|
|
|
|
c.Cron.AddFunc("0 0 0 1 1 *", t.NewYearMessage2018)
|
2017-10-07 02:23:25 +04:00
|
|
|
|
}
|