forked from an/flokati
36 lines
504 B
Go
36 lines
504 B
Go
// vi:ts=4:sts=4:sw=4:noet:tw=72
|
|
|
|
package announcements
|
|
|
|
import (
|
|
"log"
|
|
"strings"
|
|
|
|
"github.com/sorcix/irc"
|
|
)
|
|
|
|
var (
|
|
sayCh chan string
|
|
)
|
|
|
|
func Init(ch chan string) {
|
|
log.Println("Initializing announcements module")
|
|
sayCh = ch
|
|
}
|
|
|
|
func HandleMessage(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:
|
|
}
|
|
}
|