B
B
Baga2021-05-25 19:16:27
Python
Baga, 2021-05-25 19:16:27

How can I make one piece of the script run with the on argument?

The code:

def 
mode:
    return arg.split()[1]


@bot.message_handler(commands=['antim'])
def mat(message):
    mod=mode(message.text)
    if mod == 'on':
        names = ['mats']
        for name in names:
            if name in message.text.lower():
                bot.reply_to(message, ' Не матерись!')
    elif mod == 'off':
        None


It is necessary that when antim on is launched, the anti-mat script is launched, and when antim off is introduced, it is off

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question