САМ КОД
Главный файл
@dp.message_handler(commands=['start'])
async def start(message: types.Message):
if (not db.user_exists(message.from_user.id)):
db.add_user(message.from_user.id)
await bot.send_message(message.from_user.id, "Укажите ваш Ник")
else:
await bot.send_message(message.from_user.id, "Вы уже зарегистрированы", reply_markup=nav.mainMenu)
Инициализация БД
def user_exists(self, user_id):
with self.connection:
result = self.cursor.execute("SELECT * FROM 'users' WHERE 'user_id' = ?", (user_id)).fetchall()
return bool(len(result))
File "c:\Users\Ivan\Desktop\BotObu\PizzaB\venv\lib\site-packages\aiogram\dispatcher\handler.py", line 117, in notify
response = await handler_obj.handler(*args, **partial_data)
File "c:\Users\Ivan\Desktop\BotObu\PizzaB\main.py", line 18, in start
if (not db.user_exists(message.from_user.id)):
File "c:\Users\Ivan\Desktop\BotObu\PizzaB\db.py", line 15, in user_exists
result = self.cursor.execute("SELECT * FROM 'users' WHERE 'user_id' = ?", (user_id)).fetchall()
ValueError: parameters are of unsupported type
Спасибо