Answer the question
In order to leave comments, you need to log in
How to give a bot a mute to a user if he swears?
there is a list of words.
How to force the bot to issue a Mute to the user if the words it types in the chat match the words in the list.
@bot.message_handler(content_types=["text"])
def handle_text(message):
for x in blacklist:
if x in message.text:
bot.delete_message(message.chat.id, message.message_id)
time.sleep(1 )
bot.send_message(message.chat.id, 'Mute for 15 minutes!')
actually the question is, how to add?
without using a database.
Answer the question
In order to leave comments, you need to log in
without using a database.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question