mirror of
https://github.com/barelyprofessional/KfChatDotNet.git
synced 2026-05-02 04:22:04 -04:00
Added some money utility commands and currency format extension method
This commit is contained in:
@@ -121,9 +121,7 @@ internal class BotCommands
|
||||
return;
|
||||
}
|
||||
|
||||
var moneySettings =
|
||||
await SettingsProvider.GetMultipleValuesAsync([BuiltIn.Keys.MoneyEnabled, BuiltIn.Keys.MoneySymbolSuffix]);
|
||||
if (!moneySettings[BuiltIn.Keys.MoneyEnabled].ToBoolean()) return;
|
||||
if (!(await SettingsProvider.GetValueAsync(BuiltIn.Keys.MoneyEnabled)).ToBoolean()) return;
|
||||
var wagerCommand = HasAttribute<WagerCommand>(command);
|
||||
if (!wagerCommand) return;
|
||||
var gambler = await user.GetGamblerEntity(ct: _cancellationToken);
|
||||
@@ -136,7 +134,7 @@ internal class BotCommands
|
||||
var payout = await gambler.UpgradeVipLevel(newLevel, _cancellationToken);
|
||||
await _bot.SendChatMessageAsync(
|
||||
$"🤑🤑 {user.KfUsername} has leveled up to to {newLevel.VipLevel.Icon} {newLevel.VipLevel.Name} Tier {newLevel.Tier} " +
|
||||
$"and received a bonus of {payout:N2} {moneySettings[BuiltIn.Keys.MoneySymbolSuffix].Value}", true);
|
||||
$"and received a bonus of {await payout.FormatKasinoCurrencyAsync()}", true);
|
||||
}
|
||||
|
||||
private static bool HasAttribute<T>(ICommand command) where T : Attribute
|
||||
|
||||
Reference in New Issue
Block a user