fix
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Pavel_Duron 2022-12-06 22:27:12 +10:00
parent 82d5aa14ee
commit 4749ee885d

View File

@ -22,14 +22,15 @@ async def up_dick(message: types.Message):
# работа с таблицей
b = session.query(user).filter(user.user_id == message.from_user.id).first()
if b:
session.close()
last_time = b.datetimes
now_time = datetime.datetime.now()
diff = now_time.day - last_time.day
if abs(diff) <= 0:
await bot.send_message(message.chat.id, f'@{message.from_user.username},🚫 вы уже крутили пипису, ее размер <b>{b.dick_size}</b> см! ')
session.close()
print(diff)
print(type(diff))
else:
@ -37,9 +38,10 @@ async def up_dick(message: types.Message):
a.dick_size = (a.dick_size + numb)
a.datetimes = datetime.datetime.now()
session.commit() #обновляет запись
session.close()
await bot.send_message(message.chat.id, f'@{message.from_user.username}, ваш писюн {size_change}\n\
Теперь он равен <b>{a.dick_size}</b> см! ')
session.close()
@ -49,23 +51,23 @@ async def up_dick(message: types.Message):
chat_id = message.chat.id)
session.add(int_table)
session.commit()
session.close()
await bot.send_message(message.chat.id, f'@{message.from_user.username}, ваш писюн {size_change}\n\
Теперь он равен <b>{int_table.dick_size}</b> см!')
session.close()
@dp.message_handler(commands=["topdick"])
async def send_topchat(message: types.Message):
changechat_id = session.query(user).filter(user.user_id == message.from_user.id).first()
session.close()
chats = message.chat.id
if changechat_id.chat_id != chats:
changechat_id.chat_id = chats
session.commit()
session.close()
top = session.query(user.user_fullname, user.dick_size).order_by(user.dick_size.desc()).filter(user.chat_id == chats).limit(10).all()
session.close()
top = session.query(user.user_fullname, user.dick_size).order_by(user.dick_size.desc()).filter(user.chat_id == chats).limit(10).all()
delimiter = ': '
# проверка на длину списка, если меньше limit, то:
@ -85,11 +87,11 @@ async def send_topchat(message: types.Message):
🌶 {delimiter.join(map(str, top[7]))}\n\
👌 {delimiter.join(map(str, top[8]))}\n\
💩 {delimiter.join(map(str, top[9]))}\n')
session.close()
# если все нормально и участников минимум 10
else:
session.close()
await bot.send_message(message.chat.id, f'🏆Топ 10 бубылд чата🏆\n\n\
🚀 {delimiter.join(map(str, top[0]))}\n\
💫 {delimiter.join(map(str, top[1]))}\n\
@ -101,7 +103,7 @@ async def send_topchat(message: types.Message):
🌶 {delimiter.join(map(str, top[7]))}\n\
👌 {delimiter.join(map(str, top[8]))}\n\
💩 {delimiter.join(map(str, top[9]))}\n')
session.close()