You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
536 B
25 lines
536 B
package main |
|
|
|
import ( |
|
"log" |
|
|
|
"loreal.com/dit/module" |
|
"loreal.com/dit/utils" |
|
) |
|
|
|
func (a *App) initMessageHandlers() { |
|
a.MessageHandlers = map[string]func(*module.Message) bool{ |
|
"reload": a.reloadMessageHandler, |
|
} |
|
|
|
} |
|
|
|
//reloadMessageHandler - handle reload message |
|
func (a *App) reloadMessageHandler(msgPtr *module.Message) (handled bool) { |
|
//reload configuration |
|
utils.LoadOrCreateJSON("./config/config.json", &a.Config) |
|
a.Config.fixPrefix() |
|
a.StartScheduler() |
|
log.Println("[INFO] - Configuration reloaded!") |
|
return true |
|
}
|
|
|