Skip to content
New issue

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

Replies not being discarded #389

Open
dufia opened this issue Nov 4, 2017 · 1 comment
Open

Replies not being discarded #389

dufia opened this issue Nov 4, 2017 · 1 comment

Comments

@dufia
Copy link

dufia commented Nov 4, 2017

+ Hi *
- Hey!
- Hi, good to see you!
- Hey, welcome back!
- Hello to you too!

In this simple example if you type "Hi" again and again you can get the same replay even three times in a row. This isn't working as expected I presume.

I am testing on a the latest master (1.1.3) mongo 3.4.10, node v6.8.1

@LucienBrule
Copy link

I don't believe it's super clear in the documentation yet, but on further inspection, any gambits (reply pairings of +-) at the root level in superscript are kept (with {keep}) implicitly and are placed in the random topic. To discard the a response one needs to create a topic (without {keep}) then place the gambit inside (with {ordered}). Here's an example I got to work just now:

> topic greeting (Hello, name)
  + {ordered} Hello
  - Howdy!
  - Bounjour.
  - Allo
  - Hola
  - Suh
  - We've said hello already
< topic

> topic random
  + Hello
  - Switching to greeting topic {topic=greeting} ^respond("greeting")
< topic

So here you'll get "Switching to random topic Howdy!" from random.Hello, followed by all of the responses in Greeting.Hello on subsequent "Hello"s submitted from a client.

I hope that helps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants