mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-11-03 16:24:27 -05:00
.betstats now looks uwu
This commit is contained in:
@@ -76,11 +76,15 @@ public partial class Gambling : GamblingModule<GamblingService>
|
||||
var eb = _eb.Create(ctx)
|
||||
.WithOkColor();
|
||||
|
||||
var str = "**Feature | Bet | Paid Out | Payout %** \n";
|
||||
var str = "` Feature `|` Bet `|`Paid Out`|` RoI `\n";
|
||||
str += "――――――――――――――――――――\n";
|
||||
foreach (var stat in stats)
|
||||
{
|
||||
var perc = (stat.PaidOut / stat.Bet).ToString("P2", Culture);
|
||||
str += $"`{stat.Feature}` | {N(stat.Bet)} | {N(stat.PaidOut)} | {perc}\n";
|
||||
str += $"`{stat.Feature.PadBoth(9)}`" +
|
||||
$"|`{stat.Bet.ToString("N0").PadLeft(8, ' ')}`" +
|
||||
$"|`{stat.PaidOut.ToString("N0").PadLeft(8, ' ')}`" +
|
||||
$"|`{perc.PadLeft(6, ' ')}`\n";
|
||||
}
|
||||
|
||||
var bet = stats.Sum(x => x.Bet);
|
||||
@@ -90,8 +94,11 @@ public partial class Gambling : GamblingModule<GamblingService>
|
||||
bet = 1;
|
||||
|
||||
var tPerc = (paidOut / bet).ToString("P2", Culture);
|
||||
str += "--------------------------------------------\n";
|
||||
str += $"**TOTAL** | {N(bet)} | {N(paidOut)} | {tPerc}";
|
||||
str += "――――――――――――――――――――\n";
|
||||
str += $"` {("TOTAL").PadBoth(7)}` " +
|
||||
$"|**{N(bet).PadLeft(8, ' ')}**" +
|
||||
$"|**{N(paidOut).PadLeft(8, ' ')}**" +
|
||||
$"|`{tPerc.PadLeft(6, ' ')}`";
|
||||
|
||||
eb.WithDescription(str);
|
||||
|
||||
@@ -832,7 +839,7 @@ public partial class Gambling : GamblingModule<GamblingService>
|
||||
}
|
||||
else if (result.Result == RpsResultType.Win)
|
||||
{
|
||||
if((long)result.Won > 0)
|
||||
if ((long)result.Won > 0)
|
||||
embed.AddField(GetText(strs.won), N(amount.Value));
|
||||
|
||||
msg = GetText(strs.rps_win(ctx.User.Mention,
|
||||
@@ -990,5 +997,4 @@ public partial class Gambling : GamblingModule<GamblingService>
|
||||
sb.ToString(),
|
||||
footer: $"Total Bet: {tests} | Payout: {payout:F0} | {payout * 1.0M / tests * 100}%");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -24,7 +24,7 @@ public static class StringExtensions
|
||||
{
|
||||
var spaces = length - str.Length;
|
||||
var padLeft = (spaces / 2) + str.Length;
|
||||
return str.PadLeft(padLeft, '_').PadRight(length, '_');
|
||||
return str.PadLeft(padLeft, ' ').PadRight(length, ' ');
|
||||
}
|
||||
|
||||
public static T? MapJson<T>(this string str)
|
||||
|
||||
Reference in New Issue
Block a user