-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
[help] How to use mustache variables as an array, dynamically? #1094
Comments
There is not currently a way to dynamically generate attachments based on variables. This is definitely something we're interested in adding, but I haven't decided on how it should work yet. Any thoughts? |
Before I knew what Mustache Script was, and/or when I need global variables, I'm usually pulling from a database (via API) of messages tied to a common topic, flow, conversation, or what we call "interactions", and build an array of those messages with keys as message IDs as @benbrown taught me. Those are of course navigated between using changeTopic or whatever but that's neither here nor there. However, the places where we need additional variables, within the "output messages array", we simply do a find and replace where we use something like a WordPress shortcode notation, ie. See, the problem I have, is: if build a wealth of Conversations (Topics, Flows, |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I store inline messages and structured messages in separate files from business logic.
Out of message files, when I set a variable like this:
bot.js:
and then make a reference in this file inline_messages.js:
and use it on any conversation, it works nicely.
This is my variable: foobar
How can I use this as an array to build a structured message dynamically (eg.: Facebook Generic Template)? There is a way to do it using Mustache lib or Botkit?
Please, take a look:
bot.js:
structured_messages.js:
The text was updated successfully, but these errors were encountered: