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