Closed amirhoseinsalimi closed 5 years ago
Hi,
I tried to reproduce, but it worked well, just as expected.
May you please give info about Telegraf
and telegraf-session-local
versions you're using?
Also, it would be great if you send me a link to repository or attach zipped sources of you bot. (with package.json
but without node_modules
)
Sorry for my late reply and thank you for your attention.
After 3 days it's turned out that moving the session-related statements to the upper scope (outside if... else
) solves the problem! Also, a funny mistake I had made was to miss parenthesis to invoke the constructor of date -> new Date
(line 49). Now the code looks like this and works as it should does:
Nice to hear that you solved the problem 👍
Now closing this "issue", but feel free to re/open if you have any questions or facing bugs in telegraf-session-local
Hello,
I want to save user's information as he/she starts using my bot but I figured out setting sessions on
bot.start()
doesn't work or at least I'm doing something wrong. Manipulating sessions on other event handlers (.hears()
,on('audio')
, etc.) works well though. Here's the code:Where did I go wrong? Is this a Telegram bot API limitation?