R
R
RA4INA2021-06-29 14:48:36
Bots
RA4INA, 2021-06-29 14:48:36

How do I temporarily block users of my bot?

There is a telegram bot, I have no idea how to make the bot stop responding to specific people, or issue a message about a temporary block. On the Internet I did not find any information about this at all, I will be very grateful to anyone who can help.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
MiAbo, 2021-06-29
@RA4INA

As you were already told above, you need a table that will contain the id of blocked users, and with it the time for which you are going to restrict him from using your bot.
Every time a blocked user writes to your bot, check if the user's blocking time has passed and if so, remove him from this table and process his request.
But this is most likely not the best way, but as an option.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question