Skip to content

Save chat context on database #1942

Answered by MKRhere
francestu96 asked this question in Q&A
Discussion options

You must be logged in to vote

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 doing new Context(update).

const update = ctx.update;
// store update object in DB

// later, retrieve it back
const update = await fetchUpdateFromDbSomehow();
const ctx = new Context(update);

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@francestu96
Comment options

@watate
Comment options

@MKRhere
Comment options

@watate
Comment options

Answer selected by francestu96
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants