Closed ProgrammingLife closed 2 years ago
The runner docs are older than the final session design so they're outdated. Thanks for pointing this out!
You're right that this is how to fix the problem.
You can initialise the session data using the initial
option on the same level as getSessionKey
.
bot.use(session({ getSessionKey, initial: () => ({ chatId: 0, messages: 1, edits: 0 }) }) )
@KnorpelSenf, thanks, man. I got it!
Reopening until the README is updated :)
@ProgrammingLife can you review #4 and confirm that the new example code is correct?
Here's the rendered version I'd like to merge: https://github.com/grammyjs/runner/blob/bc5f5e70ab1515d20231941534b8d60cb0a22f7e/README.md
I've tried to compile example from the main page of this git, test.ts:
It returns me some error message:
I think it can be used smth like this:
but I don't know how to initialize session object (SessionData) in this case.