I want to make a telegram bot that can handle multiple chats from multiple users without being mixed up when each message is stored in the database. Unfortunately, I don't know how to do it. Please help me.
Asked
Active
Viewed 324 times
0
-
Does this answer your question? [How do I avoid using global variables when writing a Telegram bot](https://stackoverflow.com/questions/72146233/how-do-i-avoid-using-global-variables-when-writing-a-telegram-bot) – CallMeStag May 08 '22 at 18:20
1 Answers
0
If you wanna store the user data, use user_id as the primary key. And use the User object to retrieve all other data
update.message.from_user.id
And store data in an Exel sheet instead of Mysql databases. It's sometimes hard to host a telegram bot with a MySQL database. The hosting cost will be so expensive.

Паван Викаситха
- 139
- 1
- 6