forked from Pavel_Durov/python_bot
impot sqdb succses
This commit is contained in:
parent
73bf3af7a4
commit
cc6627f664
14
bot.py
14
bot.py
@ -66,10 +66,6 @@ async def ident(message: types.Message):
|
||||
|
||||
|
||||
# работа с таблицей
|
||||
engine = create_engine('postgresql+psycopg2://postgres:postgres@postgres.vdk2ch.ru:5432/jack_bot', echo=True)
|
||||
Session = sessionmaker(bind=engine)
|
||||
session = Session()
|
||||
Base = declarative_base()
|
||||
if session.query(user).filter(user.user_id == message.from_user.id).first():
|
||||
b = session.query(user).filter(user.user_id == message.from_user.id).first()
|
||||
now_time = datetime.datetime.now()
|
||||
@ -115,11 +111,7 @@ chat_id = message.chat.id)
|
||||
#####______________________ПИПИСА БОТ БУДЕТ ЗДЕСЬ__________________________________
|
||||
|
||||
@dp.message_handler(commands=["topdick"])
|
||||
async def send_time(message: types.Message):
|
||||
# engine = create_engine('postgresql+psycopg2://postgres:postgres@postgres.vdk2ch.ru:5432/jack_bot', echo=True)
|
||||
# Session = sessionmaker(bind=engine)
|
||||
# session = Session()
|
||||
|
||||
async def send_topchat(message: types.Message):
|
||||
top = session.query(user.user_fullname, user.dick_size).order_by(user.dick_size.desc()).filter(user.chat_id == user.chat_id).limit(10).all()
|
||||
delimiter = ': '
|
||||
|
||||
@ -139,10 +131,6 @@ async def send_time(message: types.Message):
|
||||
|
||||
@dp.message_handler(commands=["globaldick"])
|
||||
async def send_time(message: types.Message):
|
||||
engine = create_engine('postgresql+psycopg2://postgres:postgres@postgres.vdk2ch.ru:5432/jack_bot', echo=True)
|
||||
Session = sessionmaker(bind=engine)
|
||||
session = Session()
|
||||
Base = declarative_base()
|
||||
|
||||
top_chat = session.query(user.user_fullname, user.dick_size).order_by(user.dick_size.desc()).limit(10).all()
|
||||
delimiter = ': '
|
||||
|
Loading…
Reference in New Issue
Block a user