when creating my own telegram bot I encountered an error
File "c:UsersКириллDesktoppython_bot — копияmain_part.py", line 7
bot.polling(none_stop=True, interval=0)
^
SyntaxError: invalid syntax
part with code:
bot = TeleBot('ToKeN')
@bot.message_handler(content_types=['text'])
bot.polling(none_stop=True, interval=0)
2
Answers
Perhaps the @ in
@bot.message_handler(content_types=['text'])
is causing the error.Remove the @ and try again.
after @… you should enter a method like this: