add command to claim daily tokens
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
pub mod balance;
|
||||
pub mod give;
|
||||
pub mod wager;
|
||||
pub mod daily;
|
||||
|
||||
use crate::common::Error;
|
||||
use poise::serenity_prelude::UserId;
|
||||
@@ -28,4 +29,10 @@ pub async fn change_balance(id: UserId, balance: i32, db: &mut PgConnection) ->
|
||||
.execute(db).await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub async fn add_balance(id: UserId, amount: i32, db: &mut PgConnection) -> Result<(), Error> {
|
||||
let balance = get_balance(id, db).await?;
|
||||
change_balance(id, balance + amount, db).await?;
|
||||
Ok(())
|
||||
}
|
||||
Reference in New Issue
Block a user