Y
Y
Yung_Cod3r2020-02-15 18:26:07
PHP
Yung_Cod3r, 2020-02-15 18:26:07

How to Implement User Mut?

My bot moderates the conversation, and when the command! Mut *time* should muddle the user for the period specified in the command, I know how to implement the mut itself, but I can’t guess how to implement it for a certain period, and is it possible without using the database?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
H
HemulGM, 2020-02-15
@Yung_Cod3r

Depends on how you generally make a bot. Do you have conversation user entities? If there is, then we just add another variable with the date of removal of the mut and a flag (optional). If there is no entity, then just create a dictionary (user id, time per mut). After each message, we check the date if the user is in the dictionary. There are hundreds of ways to do it.

A
Anton Shamanov, 2020-02-15
@SilenceOfWinter

https://habr.com/en/post/335106/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question