parser fix

This commit is contained in:
cx uname 2012-11-12 18:52:58 +04:00
parent 86a61cf2bf
commit d6915f2cbb
1 changed files with 1 additions and 1 deletions

View File

@ -139,7 +139,7 @@ func MessageHandler(Conn *xmpp.Conn, Msg *xmpp.ClientMessage) {
Conn.Send(room, "groupchat", strings.TrimRight(string(out), " \n")) Conn.Send(room, "groupchat", strings.TrimRight(string(out), " \n"))
case f("^"+name, &Msg.Body): //chat case f("^"+name, &Msg.Body): //chat
Strip(&Msg.Body, &Msg.From) Strip(&Msg.Body, &Msg.From)
r, _ := regexp.Compile("^\\./chat/" + name + ":") r, _ := regexp.Compile("^\\./chat/" + name + "[:,]")
command := r.ReplaceAllString(GetCommand("!"+Msg.Body, Msg.From, "./chat/"), "./chat/answer") command := r.ReplaceAllString(GetCommand("!"+Msg.Body, Msg.From, "./chat/"), "./chat/answer")
out, err := exec.Command("bash", "-c", command).CombinedOutput() out, err := exec.Command("bash", "-c", command).CombinedOutput()
if err != nil { if err != nil {