We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
val script = """ + simple1 - <call>test "<bot VAR1>"</call> + complex - {@ something <call>test "<bot VAR1>"</call>} + interpret - {@ build <call>test interpret</call>} + setvar * - <bot VAR1=<star>>Var updated + getvar - Var1 is '<bot VAR1>' + something * - SomethingRef=<star> + build * - <bot VAR1=<star>> > object test javascript return "Test:" + args[0] < object > object interpret javascript return "<bot VAR1=interpret>" < object """.trimIndent() val user = "user" val re = RiveScript(Config.newBuilder() .strict(true) .utf8(true) .build()).apply { stream(script) sortReplies() setSubroutine("test", { re, args -> "Test:" + args[0] }) setSubroutine("interpret", { re, args -> "<bot VAR1=interpret>" }) } assertEquals("Var updated", re.reply(user, "setvar 123")) assertEquals("Var1 is '123'", re.reply(user, "getvar")) assertEquals("Test:123", re.reply(user, "simple1")) assertEquals("SomethingRef=Test:123", re.reply(user, "complex"))//failing, is '{__call__test "123"</call>}' assertEquals("", re.reply(user, "interpret"))//failing, is 'test interpret</call>}' assertEquals("Var1 is 'Test:interpret'", re.reply(user, "getvar"))//failing
javascript result (from https://www.rivescript.com/try)
User: setvar 123 Bot: Var updated User: getvar Bot: Var1 is '123' User: simple1 Bot: Test:123 User: complex Bot: SomethingRef=Test:123 User: interpret Bot: User: getvar Bot: Var1 is 'Test:interpret'
The text was updated successfully, but these errors were encountered:
No branches or pull requests
javascript result (from https://www.rivescript.com/try)
The text was updated successfully, but these errors were encountered: