Answer the question
In order to leave comments, you need to log in
I'm trying to create a bot in Python, it gives invalid sintax, what's wrong?
Source:
import telebot;
bot = telebot.TeleBot('%my token%');
@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(message.from_user.id, "Я тебя не понимаю. Напиши /help.")
bot.polling(none_stop=True, interval=0)
C:\Users\User\PycharmProjects\pythonProject5\venv\Scripts\python.exe C:/Users/User/PycharmProjects/pythonProject5/BOT.py
File "C:\Users\User\PycharmProjects\pythonProject5\BOT.py", line 7
if message.text == "Привет":
^
SyntaxError: invalid syntax
Process finished with exit code 1
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question