E
E
enabl32018-02-28 11:34:12
Python
enabl3, 2018-02-28 11:34:12

How to protect telegram bot?

Hello.
Is there any protection for the bot itself, so that it would not be spammed with messages?
For example, restrict access to the bot for a while, etc.?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Oleg, 2018-02-28
@402d

we look at the necessary functionality in the lib,
if not, we write it ourselves.
operate on the tid of the sender of the message.
we keep a quota in the database by type and time interval
(date-time type rounded to the nearest minute or hour)
or just a date-quota type for a day.
check. when exceeded, we quickly return an empty response.
we count the call to the quota,
for example, through insert on duplicate key update
, and the normal execution of the bot is further

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question