This commit is contained in:
Pavel_Duron 2022-11-09 23:02:17 +10:00
parent ceb43511ef
commit 2bf7a26b69
2 changed files with 4 additions and 6 deletions

7
bot.py
View File

@ -48,11 +48,10 @@ async def dick(message: types.Message):
@dp.message_handler(commands=["id"]) @dp.message_handler(commands=["id"])
async def ident(message: types.Message): async def ident(message: types.Message):
lisq = user(user_id = message.from_user.id, user_fullname = message.from_user.full_name)
await tert.adding()
await bot.send_message(message.chat.id, f'{message.from_user.id} + {message.from_user.full_name}')
await bot.send_message(message.chat.id, f'{message.from_user.id} + {message.from_user.full_name}')
lisq = user(user_id = message.from_user.id, user_fullname = message.from_user.full_name)
tert.adding()

View File

@ -2,7 +2,6 @@ from sqlalchemy import create_engine, MetaData, Table, Integer, String, \
Column, DateTime, ForeignKey, Numeric Column, DateTime, ForeignKey, Numeric
from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker from sqlalchemy.orm import sessionmaker
engine = create_engine('sqlite:///dick3.db') engine = create_engine('sqlite:///dick3.db')
Session = sessionmaker(bind=engine) Session = sessionmaker(bind=engine)
session = Session() session = Session()
@ -25,7 +24,7 @@ class user(Base):
class tert: class tert:
async def adding(): def adding():
session.add(lisq) session.add(lisq)
session.commit() session.commit()