Не понимаю что не так.... | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Не понимаю что не так....

Пишу код для бота в Telegram, но выдает ошибку говоря что "непонятные отступы". Помогите if message.text == "Привет":

3rd Dec 2023, 7:01 PM
Jaik
4 Answers
+ 4
Jaik , Can you share your code?? so ..we could figure out where it is causing issues...
3rd Dec 2023, 7:24 PM
Riya
Riya - avatar
+ 1
https://code.sololearn.com/c2Uy2e5QHYGI/?ref=app https://code.sololearn.com/cmmTiDi8mr03/?ref=app https://code.sololearn.com/cT5BRIbkia21/?ref=app https://code.sololearn.com/c8Tyi716A9Q7/?ref=app Looks like you're facing an issue with indentation, try pasting all of the code on sololearn and posting the link here maybe? Would like to request you to remove profanity if any while posting code! (Can't read russian, using google translate)
3rd Dec 2023, 9:40 PM
Mohammed shoaib
+ 1
The translation says indentation error in line if message.text == "Привет": However, I saw @bot.message_handler(content_types=['text','document','audio']) above the line. Is it a decorator? If it is, shouldn’t it be place before function declaration?
4th Dec 2023, 12:59 PM
Wong Hei Ming
Wong Hei Ming - avatar
0
import telebot; bot = telebot.TeleBot('%AAH3NTK182UxSLLAwHJvFYVYCt9dZOJDbeU%'); @bot.message_handler(content_types=['text']) def get_text_messages(message): @bot.message_handler(content_types=['text','document','audio']) if message.text == "Привет": bot.send_message(message.from_user.id,"Привет хуило чем могу тебе помочь?") elif message.text == "/help": bot.send_message(message.from_user.id,"Напиши привет") else: bot.send_message(messege.from_user.id,"Ты че еблан? Не понимаешь если, напиши /help") bot.polling(none_stop=True, interval=0)
3rd Dec 2023, 7:25 PM
Jaik