B
B
Berloga2016-07-29 13:04:34
Python
Berloga, 2016-07-29 13:04:34

How to properly implement state storage?

I am writing a bot for a telegram chat messenger.
Technologies: python (django, telepot), heroku The
bot will have quite extensive functionality, and it seems to me that it is convenient to assign some kind of state to each user and change it according to the next user message or other event.
The question is, what is the best way to store this state? Stack? Or did I go completely wrong and should I reconsider the architecture?
UPD: an example of states as I see them:
https://pp.vk.me/c630820/v630820245/1fd3a/qkR8IsUd...

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Cheremisin, 2016-07-29
@Berloga

If the nesting is large, then the stack. If it’s small, then it’s probably better not to bother with the stack, but to do something like a context.

A
Andrey K, 2016-07-29
@mututunus

The usual mechanism of sessions, as on sites.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question