forked from Pavel_Durov/python_bot
add new column chat id
This commit is contained in:
parent
445d624732
commit
aed4df32f9
10
bot.py
10
bot.py
@ -20,6 +20,9 @@ logging.basicConfig(level=logging.DEBUG)
|
|||||||
bot = Bot(token=API_TOKEN, parse_mode="HTML")
|
bot = Bot(token=API_TOKEN, parse_mode="HTML")
|
||||||
dp = Dispatcher(bot)
|
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"])
|
@dp.message_handler(commands=["time"])
|
||||||
@ -75,7 +78,7 @@ async def ident(message: types.Message):
|
|||||||
|
|
||||||
|
|
||||||
if abs(diff) <= 0:
|
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()
|
session.close_all()
|
||||||
print(diff)
|
print(diff)
|
||||||
print(type(diff))
|
print(type(diff))
|
||||||
@ -89,7 +92,8 @@ async def ident(message: types.Message):
|
|||||||
session.close_all()
|
session.close_all()
|
||||||
|
|
||||||
else:
|
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.add(int_table)
|
||||||
session.commit()
|
session.commit()
|
||||||
await bot.send_message(message.chat.id, f'@{message.from_user.username}, ваш писюн {size_change}\n\
|
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()
|
session = Session()
|
||||||
Base = declarative_base()
|
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 = ': '
|
delimiter = ': '
|
||||||
|
|
||||||
await bot.send_message(message.chat.id, f'🏆<u>Топ 10 бубылд</u>🏆\n\n\
|
await bot.send_message(message.chat.id, f'🏆<u>Топ 10 бубылд</u>🏆\n\n\
|
||||||
|
Loading…
Reference in New Issue
Block a user