gorepost/bot/msgping.go

24 lines
452 B
Go
Raw Normal View History

2015-11-12 09:07:53 +00:00
// Copyright 2015 Robert S. Gerus. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
package bot
import (
2015-11-09 07:00:13 +00:00
"strings"
"github.com/arachnist/gorepost/irc"
)
func ping(output func(irc.Message), msg irc.Message) {
2015-11-09 07:00:13 +00:00
if strings.Split(msg.Trailing, " ")[0] != ":ping" {
return
}
output(reply(msg, "pingity pong"))
}
func init() {
2015-11-11 20:38:33 +00:00
addCallback("PRIVMSG", "msgping", ping)
}