B
B
Bogdan12122021-06-18 17:36:46
Python
Bogdan1212, 2021-06-18 17:36:46

Python bot not working, what should I do?

the python bot does not work and gives the following error
bot = telebot.TeleBot(config.TOKEN)
AttributeError: module 'config' has no attribute 'TOKEN'

the code itself:
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)

if __name__ == '__main__':
bot.polling(none_stop=True)

Answer the question

In order to leave comments, you need to log in

4 answer(s)
D
Dmitry Shitskov, 2021-06-18
@Bogdan1212

Add TOKEN to config module

K
keeplod, 2021-06-18
@keeplod

Replace "TOKEN" with your bot's token

N
Nikolai Ugolnikov, 2021-06-18
@Ugolnikovvv

No token

H
HemulGM, 2021-06-18
@HemulGM

Probably the token is not specified

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question