diff --git a/__pycache__/bot.cpython-310.pyc b/__pycache__/bot.cpython-310.pyc index 3577a0d..7e1a5c4 100644 Binary files a/__pycache__/bot.cpython-310.pyc and b/__pycache__/bot.cpython-310.pyc differ diff --git a/__pycache__/sqdb.cpython-310.pyc b/__pycache__/sqdb.cpython-310.pyc new file mode 100644 index 0000000..8c27449 Binary files /dev/null and b/__pycache__/sqdb.cpython-310.pyc differ diff --git a/bot.py b/bot.py index c74443b..fe1b295 100644 --- a/bot.py +++ b/bot.py @@ -2,6 +2,7 @@ from cgitb import text import datetime import logging from random import randint +from sqdb import tert from aiogram import Bot, Dispatcher, executor, types from aiogram.types import ReplyKeyboardRemove, ReplyKeyboardMarkup, KeyboardButton @@ -47,10 +48,9 @@ async def dick(message: types.Message): @dp.message_handler(commands=["id"]) async def ident(message: types.Message): - id1 = message.from_user.id - fullname1 = message.from_user.full_name - - await bot.send_message(message.chat.id, f'{id1} + {fullname1}') + lisq = user(user_id = message.from_user.id, user_fullname = message.from_user.full_name) + tert.adding() + await bot.send_message(message.chat.id, f'{message.from_user.id} + {message.from_user.full_name}') diff --git a/dick3.db b/dick3.db index 37d4e8c..70fd548 100644 Binary files a/dick3.db and b/dick3.db differ diff --git a/sqdb.py b/sqdb.py index c1dbfa6..41c899d 100644 --- a/sqdb.py +++ b/sqdb.py @@ -2,6 +2,7 @@ from sqlalchemy import create_engine, MetaData, Table, Integer, String, \ Column, DateTime, ForeignKey, Numeric from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import sessionmaker +import bot engine = create_engine('sqlite:///dick3.db') Session = sessionmaker(bind=engine) @@ -21,17 +22,23 @@ class user(Base): user_fullname = Column(String) +#list = user(user_id = message.from_user.id, user_fullname = message.from_user.full_name) -c2 = user(user_id = 1234, user_fullname = 'sfsfsfsfs') -session.add(c2) -session.commit() +class tert: + def adding(): + + session.add(lisq) + session.commit() + + +#tert.adding() # добавляет запись и коммитит + #Base.metadata.create_all(engine) - - - +listq2 = bot.ident.lisq() +print(listq2) \ No newline at end of file