Answer the question
In order to leave comments, you need to log in
How to properly design a database for a Telegram bot?
I am writing a bot for telegram.
There is a user table and a chat table.
The bot sends a message to the chat, namely a list of entries and a link to each + inline "previous" and "next" buttons. Those. kind of pagination.
Accordingly, the task has become to remember and write down the necessary information in the callback of these buttons.
For example /posts_1_9999999
, where /posts
is the name of the team, 1
is the page number of the displayed posts from the paginator, 9999999
is the id of the message.
Only 2 options come to mind:
1. A table with messages that have a callback (id, state, parameters ...)
2. A field in the chat table, in which json will be constantly written and updated, containing all messages that have a callback, and the required settings.
Are there other options for solving this problem?
Answer the question
In order to leave comments, you need to log in
For example /posts_1_9999999, where
/posts is the command name,
1 is the page number of the displayed posts from the paginator,
9999999 is the message id.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question