1
0
Fork 0
forked from External/ergo

Refactor nickserv.go to better support NS HELP and translations

This commit is contained in:
Daniel Oaks 2018-04-01 11:22:06 +10:00
parent a39c46d470
commit 7b8c4e7e91
3 changed files with 351 additions and 218 deletions

View file

@ -175,6 +175,14 @@ func NewServer(config *Config, logger *logger.Manager) (*Server, error) {
return nil, err
}
// confirm help entries for NickServ exist.
// this forces people to write help entries for every single NS command.
for commandName, commandInfo := range nickservCommands {
if commandInfo.help == "" || commandInfo.helpShort == "" {
return nil, fmt.Errorf("Help entry does not exist for NickServ command %s", commandName)
}
}
// Attempt to clean up when receiving these signals.
signal.Notify(server.signals, ServerExitSignals...)
signal.Notify(server.rehashSignal, syscall.SIGHUP)