0
Не понимаю что не так....
Пишу код для бота в Telegram, но выдает ошибку говоря что "непонятные отступы". Помогите if message.text == "Привет":
4 odpowiedzi
+ 4
Jaik ,
Can you share your code?? so ..we could figure out where it is causing issues...
+ 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)
+ 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?
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)