Answer the question
In order to leave comments, you need to log in
Error in programming telegram bot?
import telebot
import config
bot = telebot.TeleBot(config.TOKEN)
@bot.message_handler(content_types=['text'])
def lalala(message):
bot.send_message(message.chat.id, message.text)
# RUN
bot.polling(none_stop=True)
Traceback (most recent call last):
File "C:\Users\Артем\Desktop\testbot.py", line 4, in <module>
bot = telebot.TeleBot(config.TOKEN)
AttributeError: module 'config' has no attribute 'TOKEN'
Answer the question
In order to leave comments, you need to log in
Remove this:
import config
And replace config.TOKEN with your own token.
Better yet, read a book.
PS:
1) This question is simple;
2) This question has nothing to do with bots or telegrams.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question