Closed justmavi closed 10 months ago
You should tell it what to default to:
bot.use(session({ store: redisStore(opts), defaultSession: () => ({}) }));
Thank you for your answer. I'll try it a little later. But if the problem is here, then it's better to update the documentation and specify it.
That works. Thank you )
Desciption
Instead of creating a new key (as
telegraf-session-redis
does),@telegraf/session/redis
does nothing. When a new user clicks on the Start button, it's clear that his key doesn't currently exist in the storage, and I get an exception when trying to accessctx.session
. But when I create a key manually in Redis, everything works fine. But I can't create a key manually for each new user :(Is this an issue or am I doing something wrong?
Code
Current behavior
"TypeError: Cannot read properties of undefined (reading 'key')"
Expected behavior
User's session