add: Added user param to .bank balance command, but only Bot Owner can use it

This commit is contained in:
Kwoth
2024-07-11 18:46:09 +00:00
parent 9d2268a925
commit a50a7b3b0e
3 changed files with 24 additions and 0 deletions

View File

@@ -73,6 +73,27 @@ public partial class Gambling
await Response().Error(strs.cant_dm).SendAsync();
}
}
[Cmd]
[OwnerOnly]
public async Task BankBalance([Leftover] IUser user)
{
var bal = await _bank.GetBalanceAsync(user.Id);
var eb = _sender.CreateEmbed()
.WithOkColor()
.WithDescription(GetText(strs.bank_balance_other(user.ToString(), N(bal))));
try
{
await Response().User(ctx.User).Embed(eb).SendAsync();
await ctx.OkAsync();
}
catch
{
await Response().Error(strs.cant_dm).SendAsync();
}
}
private async Task BankTakeInternalAsync(long amount, ulong userId)
{

View File

@@ -4265,8 +4265,10 @@ bankbalance:
Shows how much currency is in your bank account.
This differs from your cash amount, as the cash amount is publicly available, but only you have access to your bank balance.
However, you have to withdraw it first in order to use it.
Bot Owner can also check another user's bank balance.
ex:
- ''
- '@User'
params:
- {}
banktake:

View File

@@ -1040,6 +1040,7 @@
"medusa_already_loaded": "Medusa {0} is already loaded",
"medusa_invalid_not_found": "Medusa with that name wasn't found or the file was invalid",
"bank_balance": "You have {0} in your bank account.",
"bank_balance_other": "User {0} has {1} in the bank.",
"bank_deposited": "You deposited {0} to your bank account.",
"bank_withdrew": "You withdrew {0} from your bank account.",
"bank_withdraw_insuff": "You don't have sufficient {0} in your bank account.",