Answer the question
In order to leave comments, you need to log in
Pythone error attached description?
please advise. than the error(
wrote the code but the links are not clear
/Users/tamerlan/PycharmProjects/bot/venv/bin/python /Users/tamerlan/PycharmProjects/bot/app.py
Traceback (most recent call last):
File "/Users/tamerlan/ PycharmProjects/bot/app.py", line 15, in
from handlers import dp
File "/Users/tamerlan/PycharmProjects/bot/handlers/__init__.py", line 1, in
from handlers.users import dp
File "/Users/ tamerlan/PycharmProjects/bot/handlers/users/__init__.py", line 1, in
from .start import dp
File "/Users/tamerlan/PycharmProjects/bot/handlers/users/start.py", line 2, in
from loader import dp
File "/Users/tamerlan/PycharmProjects/bot/loader.py", line 5, in
bot = BOT(token=config.BOT_TOKEN,
NameError: name 'BOT' is not defined. Did you mean: 'bot'?
code itself to start pai
from aiogram import types
from loader import dp
@dp.message_handlers(text='/start')
async def command_start(message: types.Message):
await message.answer(f'Hello {message.from_user.full_name}! \n'
f'Your ID: {message.from_user.id}')
Answer the question
In order to leave comments, you need to log in
Python - case sensitive -sensitive and when declaring instances, the class name must be written in the same case in which the class name was written, which is what the error says.
bot = BOT(token=config.BOT_TOKEN, # NameError: name 'BOT' is not defined. Did you mean: 'bot'?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question