Added a martingale step
This commit is contained in:
@@ -390,3 +390,15 @@ async def update_user_timer(tg_id, minutes: int):
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
logging.error(f"Ошибка обновления таймера пользователя {tg_id}: {e}")
|
logging.error(f"Ошибка обновления таймера пользователя {tg_id}: {e}")
|
||||||
|
|
||||||
|
|
||||||
|
async def get_martingale_step(tg_id):
|
||||||
|
async with async_session() as session:
|
||||||
|
result = await session.execute(select(UMS).where(UMS.tg_id == tg_id))
|
||||||
|
user_settings = result.scalars().first()
|
||||||
|
return user_settings.martingale_step
|
||||||
|
|
||||||
|
async def update_martingale_step(tg_id, step):
|
||||||
|
async with async_session() as session:
|
||||||
|
await session.execute(update(UMS).where(UMS.tg_id == tg_id).values(martingale_step = step))
|
||||||
|
|
||||||
|
await session.commit()
|
Reference in New Issue
Block a user