aichaos / rivescript-go

A RiveScript interpreter for Go. RiveScript is a scripting language for chatterbots.
https://www.rivescript.com/
MIT License
60 stars 16 forks source link

no way to see actual input? #11

Closed stevesmoot closed 7 years ago

stevesmoot commented 7 years ago

There doesn't seem to be any way to get at the un-simplified input e.g., input of Jenny's place -> Jennys place in a function would like to be able to see Jenny's place not Jennys place Did I miss it somehow? also fine to get the whole input not just the if that's available

kirsle commented 7 years ago

Some people have worked around this problem by utilizing the SetUservar() function from their app's code, e.g.

bot.SetUservar(username, "origMsg", message)
reply := bot.Reply(username, message)

And then you can use rs.GetUservar(username, "origMsg") to retrieve it.

Let me know if this doesn't work; it should work but I don't think anyone's done it on the Go version yet.

stevesmoot commented 7 years ago

Clever.

Yes it works in go. For clarity (& future users) the use is

msg, err := rs.GetUservar(rs.CurrentUser(), "origMsg")

b/c you dont have username in the callback.

thanks!

-s

On Thu, Nov 3, 2016 at 3:49 PM, Noah Petherbridge notifications@github.com wrote:

Some people have worked around this problem by utilizing the SetUservar() function from their app's code, e.g.

bot.SetUservar(username, "origMsg", message)reply := bot.Reply(username, message)

And then you can use rs.GetUservar(username, "origMsg") to retrieve it.

Let me know if this doesn't work; it should work but I don't think anyone's done it on the Go version yet.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/aichaos/rivescript-go/issues/11#issuecomment-258297414, or mute the thread https://github.com/notifications/unsubscribe-auth/AOJwWLXvZ0JsCv1uPBOBCp8gcwf2acbUks5q6mUKgaJpZM4Ko8o- .