How to limit messages per user in 24 hours. Telegram bot -> ChatGPT

Hi,
i made simple chat bot in Telegram with answers from ChatGPT.
I’m wondering what is the best practices to limit messages per day for a user?

Welcome to the Make community!

You’ll need to store somewhere, the number of scenario activations per day based on the Telegram user ID.

You can do this by using the Data Store.

The data store will need the key (Telegram user ID), and a numeric count, and the date last updated.

Whenever the user makes a request, you need to search for the key, and increment the count, or reset the count to 1, if it is the first message in the day.

samliewrequest private consultation

Join the Make Fans Discord server to chat with other makers!

1 Like

Thank you, very much! I’ll try it.

I simply don’t understand how to make numeric counter and reset. I made something like that. Tried to watch different videos and read docs. Just don’t understand how i should do it.


counter.

You’ll need a Get/Search Records module where the Set Variable module is at.

This is because to update the store you need to know what the existing counter value is at.

samliewrequest private consultation

Join the Make Fans Discord server to chat with other makers!