Created
November 23, 2020 04:53
-
-
Save rwisner/0960d67331898adbb45d38efc88ca387 to your computer and use it in GitHub Desktop.
Store and increment a session variable
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.handle('loop_handle', (conv) => { | |
var response = ""; | |
var loopCounter = conv.user.params.counter; | |
if (loopCounter > 0) { | |
loopCounter += 1; | |
} else { | |
loopCounter = 1; | |
} | |
conv.user.params.counter = loopCounter; | |
response += "Loop counter equals " + loopCounter + ". "; | |
conv.add(response); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment