no db pool

This commit is contained in:
2024-12-07 15:10:07 -05:00
parent 241709b3a0
commit 3bc51c858f
7 changed files with 31 additions and 23 deletions

View File

@@ -8,7 +8,10 @@ pub async fn wager(
amount: i32) -> Result<(), Error>
{
let data = ctx.data();
let mut wealth = super::get_balance(ctx.author().id, &data).await?;
let mut db = data.database.lock().await;
let db = db.as_mut();
let mut wealth = super::get_balance(ctx.author().id, db).await?;
if wealth < amount {
ctx.reply(format!("You do not have enough tokens (**{}**) to wager this amount.",
@@ -26,7 +29,7 @@ pub async fn wager(
amount, wealth)).await?;
}
super::change_balance(ctx.author().id, wealth, &data).await?;
super::change_balance(ctx.author().id, wealth, db).await?;
Ok(())
}