Answer the question
In order to leave comments, you need to log in
Created a Telegram bot, but it doesn't work; an error pops up, what should I do?
I created a bot for telegram, everything was fine. Then I write python bot.py on the windose command line
(to check if there are any errors in the code) and then this pops up.
Traceback (most recent call last):
File "bot.py", line 2, in
import config
ModuleNotFoundError: No module named 'config'
That's why the telegram bot doesn't work for me.
WHAT TO DO?
If so here is my code:
import telebot
import configure
bot = telebot.TeleBot(configure.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
I created a bot for telegram, everything was fine.Just don't tell stories. You did not create a bot, you copied it from the Internet, and then with errors. Yes, and another error was given from another code.
TOKEN = 'тут_ваш_токен'
bot = telebot.TeleBot(configure.config.TOKEN)
replaced by bot = telebot.TeleBot(config.TOKEN)
Replace configure.config.TOKEN with the line: "here is your token 1234566"
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question