D
D
Danil_Marchenko2021-10-21 13:47:43
Python
Danil_Marchenko, 2021-10-21 13:47:43

I want to create a telegram bot, I wrote the simplest code, the bot does not respond, what should I do?

import telebot
import configure

client = telebot.TeleBot(configure.config['configure'])

@client.message_handler(content_types = ['text'])
def get_text(message):
if message.text.lover() == 'Hello ':
client.send_message(message.chat.id, 'Hello friend')

client.polling(none_stop = True, interval=0)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
WolfInChains, 2021-10-21
@Danil_Marchenko

1) lower(), not lover()
2) If you have already brought it 'Привет'to lower case, then compare with lower case -'привет'
if message.text.lower() == 'привет':

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question