R
R
Rusiantvso2020-08-04 14:00:41
Python
Rusiantvso, 2020-08-04 14:00:41

What should I do if the bot ignores a message that starts with @ & symbols?

If in text.lower() == the first letter is capitalized or some character like @ % &, the bot ignores your request.

if text.lower() == '@id24159122': 
            try:
                vk.messages.send(
                    chat_id=event.chat_id,
                    message='Сообщение', #ответ бота
                    random_id=get_random_id(),
                )
            except Exception as e:
                print ("Ошибка")

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Andrey, 2020-08-04
@Rusiantvso

In text.lower() another text

S
soremix, 2020-08-04
@SoreMix

Print the text of the message, something tells me that @id24159122 is never there

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question