import logging
from aiogram import Bot, Dispatcher, executor, types
from db import Database
logging.basicConfig(level=logging.INFO)
bot = Bot(token="5698939897:AAEVJqihOV-Eb6_gtPhdIb48scCmUdanAxA")
dp = Dispatcher(bot)
db = Database('database.db')
@dp.message_handler(commands=['start'])
async def start(message: types.Message):
if message.chat.type =='private':
if not db.user_exists(message.from_user.id):
db.add_user(message.from_user.id)
await bot.send_message(message.from_user.id, "Добро пожаловать")
if __name__ == "__main__":
executor.start_polling(db, skip_updates= True)
ошибка:Database' object has no attribute 'bot'
-
Вопрос задан
-
54 просмотра