C
C
coldmayg2021-10-11 02:42:16
Python
coldmayg, 2021-10-11 02:42:16

How to make the tg bot react only to a certain message?

I have a bot, which, in theory, should send pluses to the admin, which are sent by people in the chat, but it reacts to all messages, how to make the bot react only to pluses? '+'

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
jerwright, 2021-10-11
@coldmayg

@bot.message_handler(content_types=['text'])
def testing(message):
    if message.text == '+':
        #что-то делаем

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question