X
X
XWR2021-08-06 01:18:13
Python
XWR, 2021-08-06 01:18:13

In which line of code should lower be added?

Hello, I want the bot to accept a command in any case
. Where should I add lower()?

Here is the code:

if msg.text.startswith('Инфа'):
        
        splitted = user_message.split(' ')
        
        for i in range(len(splitted)):
            if splitted[i] == 'я':
                splitted[i] = 'ты'
                
        res_text = " ".join(splitted)
        
        rand = random.randint(1, 100)
        
        await msg.reply(f"{res_text} {rand}%")


Help me please (

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
o5a, 2021-08-06
@XWR

if msg.text.lower().startswith('инфа'):

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question