Enable implements plugin.Plugin
()
| 25 | |
| 26 | // Enable implements plugin.Plugin |
| 27 | func (c *Plugin) Enable() error { |
| 28 | c.enabled = true |
| 29 | c.cronHandler = cron.New() |
| 30 | c.cronHandler.AddFunc("0 0 * * *", func() { |
| 31 | c.msgHandler.SendMessage(plugin.Message{ |
| 32 | Title: "Tick Tock!", |
| 33 | Message: time.Now().Format("It is 15:04:05 now."), |
| 34 | }) |
| 35 | }) |
| 36 | c.cronHandler.Start() |
| 37 | return nil |
| 38 | } |
| 39 | |
| 40 | // Disable implements plugin.Plugin |
| 41 | func (c *Plugin) Disable() error { |
nothing calls this directly
no test coverage detected