Answer the question
In order to leave comments, you need to log in
How can I set up daily limits for telegram bot users?
I want to set up daily limits for using the telegram bot. How it goes in my head. We take a simple, serverless key-value database, for example, https://github.com/boltdb/bolt . Unfortunately, I do not know how it will show itself in terms of performance. Since the database bolt is essentially a file that is locked when writing. Asynchronously it will not turn out to have access. If 15 people fall on the bot at the same time, then the speed will drop noticeably.
To solve my problem, I want to record for each user the number of requests that will be available to him. Well, once a day, update the number of requests for everyone. I just don't know how to do it with the last one. Just in the code to run a separate gorutin for this or somehow in a smart way.
Answer the question
In order to leave comments, you need to log in
https://github.com/boltdb/bolt . Unfortunately, I do not know how it will show itself in terms of performance.
Since the database bolt is essentially files that are locked when writing
If 15 people fall on the bot at the same time, then the speed will drop noticeably.
To solve my problem, I want to record for each user the number of requests that will be available to him. Well, once a day, update the number of requests for everyone.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question