Answer the question
In order to leave comments, you need to log in
Why is the aiogram bot not working? and config doesn't see the tokenbot attribute?
Here is my code
import config
import logging
from aiogram import Bot, Dispatcher, executor, types
# Задаем уровень логов
logging.basicConfig(level=logging.INFO)
# Инициализация бота
bot = Bot(token=config.tokenbot)
dp = Dispatcher(bot)
# Эхо
@dp.message_handler()
async def echo(message: types.Message):
await message.answer(message.text)
# запускаем лонг поллинг
if __name__ == '__main__':
executor.start_polling(dp, skip_updates=True)
Traceback (most recent call last):
File "D:\Python\bot.py", line 10, in <module>
bot = Bot(token=config.tokenbot)
AttributeError: module 'config' has no attribute 'tokenbot'
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question