2015-11-09 00:46:08 +00:00
|
|
|
package bot
|
|
|
|
|
|
|
|
import (
|
2015-11-09 07:00:13 +00:00
|
|
|
"strings"
|
|
|
|
|
2015-11-09 00:46:08 +00:00
|
|
|
"github.com/arachnist/gorepost/irc"
|
|
|
|
)
|
|
|
|
|
2015-11-09 23:13:30 +00:00
|
|
|
func ping(output chan irc.Message, msg irc.Message) {
|
2015-11-09 07:00:13 +00:00
|
|
|
if strings.Split(msg.Trailing, " ")[0] != ":ping" {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2015-11-09 00:46:08 +00:00
|
|
|
output <- irc.Message{
|
|
|
|
Command: "PRIVMSG",
|
|
|
|
Params: []string{msg.Prefix.Name},
|
|
|
|
Trailing: "pingity pong",
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func init() {
|
2015-11-11 20:38:33 +00:00
|
|
|
addCallback("PRIVMSG", "msgping", ping)
|
2015-11-09 00:46:08 +00:00
|
|
|
}
|