Answer the question
In order to leave comments, you need to log in
I wanted to write a bot from YouTube, but it doesn’t work for me, it gives an error. How to fix it?
import telebot
import config
bot = telebot.Telebot(config.Token)
@bot.message_handlers(content_types=['text'])
def lalala(message):
bot.send_message(message.chat.id, message.text)
bot.polling (none_stop=True)
ERROR: 'list' object is not callable
Answer the question
In order to leave comments, you need to log in
Slightly corrected some errors in the form of quotes and method names.
What exactly is the bot supposed to do?
If you respond with the same message to the user, then here, try this option:
import telebot
bot = telebot.TeleBot("TOKEN" )
@bot.message_handler(content_types=['text'])
def send_echo(message):
bot.send_message(message.chat.id, message.text)
bot.polling(none_stop=True)
import telebot
import config
@bot.message_handler(content_types=['text'])
def lalala(message):
bot.send_message(message.from_user.id, message.text)
bot.polling(none_stop=True)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question