Is anyone building a telegram chatbot? I just bui...
# 🌎general
b
Is anyone building a telegram chatbot? I just built a chatbot on telegram, where at the beginning of the conversation some information are asked and stored in variables. The chatbot remember those variables for a couple of hours, but afterwards it tends to forget them. Does anyone have a solution for this?
e
Hey @better-eye-20248, what is they information you are prompting? If its data that doesn't change like user names, you can save them in User Variables, so they remain the same forever or until you change them
To add a user variable, go to the chatbot settings, and add a variable here
You can then write values to it using
ùser.variableName = ...
and read it with
user.variableName
To assign the value the user just typed in, create a Execute Code card after the Capture, with the code:
user.variableName = event.preview
It's recommended to do some checking though, to see if the value is valid!
And this works the same way for any messenger!
b
Great value in this message, thanks a lot Guil! I’ll try to do it right away, hopefully it will fix it!
This one looks like working, thanks.
e
Good to know @better-eye-20248! 🚀