Rework of module system.

This commit is contained in:
Andreas Neue
2016-02-16 00:17:42 +01:00
parent 69e8ef85b1
commit ae56ff904c
12 changed files with 219 additions and 199 deletions
+33
View File
@@ -0,0 +1,33 @@
// vi:ts=4:sts=4:sw=4:noet:tw=72
package modules
import (
"log"
"strings"
"github.com/sorcix/irc"
)
var ()
func init() {
msgHandlers["announcements"] = anncouncementsHandleMessage
log.Println("Initializing announcements module")
}
func anncouncementsHandleMessage(m *irc.Message) {
tok := strings.Split(m.Trailing, " ")
if len(tok) < 1 {
return
}
switch tok[0] {
case "!annadd":
/* add announcement */
case "!anndel":
/* delete announcement */
case "!annlist":
/* list announcement */
default:
}
}