Trim plugins output again
This commit is contained in:
parent
908a87953d
commit
25ae83b538
8
main.go
8
main.go
|
@ -155,7 +155,7 @@ func SelfHandler(Conn *xmpp.Conn, Msg *xmpp.ClientMessage) {
|
||||||
Conn.Send(Msg.From, "chat", err.Error())
|
Conn.Send(Msg.From, "chat", err.Error())
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
Conn.Send(Msg.From, "chat", string(out))
|
Conn.Send(Msg.From, "chat", strings.TrimRight(string(out), " \t\n"))
|
||||||
}
|
}
|
||||||
|
|
||||||
var call = regexp.MustCompile("^" + name + "[:,]")
|
var call = regexp.MustCompile("^" + name + "[:,]")
|
||||||
|
@ -192,9 +192,9 @@ func MessageHandler(Conn *xmpp.Conn, Msg *xmpp.ClientMessage) {
|
||||||
outerr, _ := ioutil.ReadAll(stderr)
|
outerr, _ := ioutil.ReadAll(stderr)
|
||||||
cmd.Wait()
|
cmd.Wait()
|
||||||
if len(outerr) != 0 && in(admin, Msg.From) {
|
if len(outerr) != 0 && in(admin, Msg.From) {
|
||||||
Conn.Send(Msg.From, "chat", string(outerr))
|
Conn.Send(Msg.From, "chat", strings.TrimRight(string(outerr), " \t\n"))
|
||||||
}
|
}
|
||||||
Conn.Send(room, "groupchat", string(out))
|
Conn.Send(room, "groupchat", strings.TrimRight(string(out), " \t\n"))
|
||||||
|
|
||||||
case call.MatchString(Msg.Body): //chat
|
case call.MatchString(Msg.Body): //chat
|
||||||
command, err := GetCommand(call.ReplaceAllString(Msg.Body, "!answer"), Msg.From, "./chat/")
|
command, err := GetCommand(call.ReplaceAllString(Msg.Body, "!answer"), Msg.From, "./chat/")
|
||||||
|
@ -210,7 +210,7 @@ func MessageHandler(Conn *xmpp.Conn, Msg *xmpp.ClientMessage) {
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
Conn.Send(room, "groupchat", string(out))
|
Conn.Send(room, "groupchat", strings.TrimRight(string(out), " \t\n"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue