Save chat context on database #1942
Answered
by
MKRhere
francestu96
asked this question in
Q&A
-
Beta Was this translation helpful? Give feedback.
Answered by
MKRhere
Feb 5, 2024
Replies: 1 comment 4 replies
-
You can safely store the contents of const update = ctx.update;
// store update object in DB
// later, retrieve it back
const update = await fetchUpdateFromDbSomehow();
const ctx = new Context(update); |
Beta Was this translation helpful? Give feedback.
4 replies
Answer selected by
francestu96
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can safely store the contents of
ctx.update
which will always be a valid JSON as received from Telegram. You can construct it back into a context by doingnew Context(update)
.