Update bonjour and cycki plugins.

configurable-file-paths
Robert Gerus 2015-11-29 17:46:29 +01:00
parent 7dee9b445f
commit a4eda1468d
2 changed files with 4 additions and 17 deletions

View File

@ -10,11 +10,10 @@ import (
"strings"
"time"
cfg "github.com/arachnist/gorepost/config"
"github.com/arachnist/gorepost/irc"
)
func bonjour(output chan irc.Message, msg irc.Message) {
func bonjour(output func(irc.Message), msg irc.Message) {
var rmsg string
if strings.Split(msg.Trailing, " ")[0] != ":bonjour" {
@ -28,19 +27,7 @@ func bonjour(output chan irc.Message, msg irc.Message) {
rmsg = "bonjour (nsfw): " + img
}
if msg.Params[0] == cfg.LookupString(msg.Context, "Nick") {
output <- irc.Message{
Command: "PRIVMSG",
Params: []string{msg.Prefix.Name},
Trailing: rmsg,
}
} else {
output <- irc.Message{
Command: "PRIVMSG",
Params: msg.Params,
Trailing: rmsg,
}
}
output(reply(msg, rmsg))
}
func init() {

View File

@ -14,7 +14,7 @@ import (
var stripCycki *regexp.Regexp
func cycki(output chan irc.Message, msg irc.Message) {
func cycki(output func(irc.Message), msg irc.Message) {
var rmsg string
if strings.Split(msg.Trailing, " ")[0] != ":cycki" {
@ -28,7 +28,7 @@ func cycki(output chan irc.Message, msg irc.Message) {
rmsg = "cycki (nsfw): " + string(stripCycki.ReplaceAll([]byte(img), []byte("")))
}
output <- reply(msg, rmsg)
output(reply(msg, rmsg))
}
func init() {