M
M
MalikDeveloper20772020-05-17 02:17:43
Python
MalikDeveloper2077, 2020-05-17 02:17:43

How to protect python telegram bot from spam?

I have a telegram bot on pyTelegramBot.
I need that if 1 person writes more than 7 times in 10 seconds, for example, then he should be blacklisted.
How can this be implemented. I thought in the dictionary to keep the chat id and the number of messages, but how to clear it later and in general there is probably a better solution.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
alfss, 2020-05-17
@MalikDeveloper2077

redis

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question