mirror of
https://code.dnix.de/da/flokatirc
synced 2026-07-27 08:59:44 +02:00
Rework of module system.
This commit is contained in:
@@ -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:
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user