2016-01-20 06:40:13 +00:00
|
|
|
// vi:ts=4:sts=4:sw=4:noet:tw=72
|
|
|
|
|
2016-02-15 23:17:42 +00:00
|
|
|
package modules
|
2016-01-20 06:40:13 +00:00
|
|
|
|
|
|
|
import (
|
2016-01-21 06:45:56 +00:00
|
|
|
"strings"
|
2016-01-20 06:40:13 +00:00
|
|
|
|
|
|
|
"github.com/sorcix/irc"
|
|
|
|
)
|
|
|
|
|
2016-02-15 23:17:42 +00:00
|
|
|
var ()
|
2016-01-20 06:40:13 +00:00
|
|
|
|
2016-02-15 23:17:42 +00:00
|
|
|
func init() {
|
2016-03-19 22:49:41 +00:00
|
|
|
MsgFuncs["announcements"] = anncouncementsHandleMessage
|
2016-01-20 06:40:13 +00:00
|
|
|
}
|
|
|
|
|
2016-02-15 23:17:42 +00:00
|
|
|
func anncouncementsHandleMessage(m *irc.Message) {
|
2016-01-21 06:45:56 +00:00
|
|
|
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:
|
|
|
|
}
|
2016-01-20 06:40:13 +00:00
|
|
|
}
|