add new column chat id

This commit is contained in:
Pavel_Duron 2022-12-01 19:12:16 +10:00
parent 445d624732
commit aed4df32f9

10
bot.py
View File

@ -20,6 +20,9 @@ logging.basicConfig(level=logging.DEBUG)
bot = Bot(token=API_TOKEN, parse_mode="HTML")
dp = Dispatcher(bot)
@dp.message_handler(commands=["chat"])
async def send_chat(message: types.Message):
await message.answer(f'{message.chat.id}')
@dp.message_handler(commands=["time"])
@ -75,7 +78,7 @@ async def ident(message: types.Message):
if abs(diff) <= 0:
await bot.send_message(message.chat.id, f'@{message.from_user.username},🚫 вы уже крутили пипису, ее размер <b>{b.dick_size}</b> см! ')
await bot.send_message(message.chat.id, f'@{message.from_user.url},🚫 вы уже крутили пипису, ее размер <b>{b.dick_size}</b> см! ')
session.close_all()
print(diff)
print(type(diff))
@ -89,7 +92,8 @@ async def ident(message: types.Message):
session.close_all()
else:
int_table = user(user_id = message.from_user.id, user_fullname = message.from_user.full_name, dick_size = numb, datetimes = datetime.datetime.now())
int_table = user(user_id = message.from_user.id, user_fullname = message.from_user.full_name, dick_size = numb, datetimes = datetime.datetime.now(),\
chat_id = message.chat.id)
session.add(int_table)
session.commit()
await bot.send_message(message.chat.id, f'@{message.from_user.username}, ваш писюн {size_change}\n\
@ -117,7 +121,7 @@ async def send_time(message: types.Message):
session = Session()
Base = declarative_base()
top = session.query(user.user_fullname, user.dick_size).order_by(user.dick_size.desc()).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 = ': '
await bot.send_message(message.chat.id, f'🏆<u>Топ 10 бубылд</u>🏆\n\n\