Answer the question
In order to leave comments, you need to log in
When I write code, an invalid syntax error occurs, what should I do?
It throws an error
Here is the code:
import telebot
import config
bot = telebot.TeleBot(config.TOKEN)
@bot.message_handler(commands=["start"])
def welcome(message):
sti = open("static/welcome.webp", "rb")
bot.send_sticker(message.chat.id, sti)
bot.send_message(message.chat.id , "Добро пожаловать, {0.first_name}!\nЯ - </b>{1.first_name}, бот созданный чтобы быть подопытным кроликом.".format(message.from_user, bot.get_me())
parse_mode="html")
@bot.message_handler(content_types=["text"])
def lalala(message):
bot.send_message(message.chat.id, message.text)
#RUN
bot.polling(none_stop=True)
c:\Python>python bot.py
File "bot.py", line 12
parse_mode="html")
^
SyntaxError: invalid syntax
Answer the question
In order to leave comments, you need to log in
Lost a comma!
import telebot
import config
bot = telebot.TeleBot(config.TOKEN)
@bot.message_handler(commands=["start"])
def welcome(message):
sti = open("static/welcome.webp", "rb")
bot.send_sticker(message.chat.id, sti)
bot.send_message(message.chat.id , "Добро пожаловать, {0.first_name}!\nЯ - {1.first_name}, бот созданный чтобы быть подопытным кроликом.".format(message.from_user, bot.get_me()),
parse_mode="html")
@bot.message_handler(content_types=["text"])
def lalala(message):
bot.send_message(message.chat.id, message.text)
#RUN
bot.polling(none_stop=True)
1. The code must be wrapped in a tag on the toaster.
2. The code is invalid - that's why the error.
It is written in black and white that the programmer is disabled.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question