Fixed a bug in cmdcd not modifying the database. Added total stats to .betstats

This commit is contained in:
Kwoth
2022-10-07 11:01:26 +02:00
parent e6b7c31a72
commit eedf6998b6
2 changed files with 34 additions and 1 deletions

View File

@@ -83,6 +83,16 @@ public partial class Gambling : GamblingModule<GamblingService>
str += $"`{stat.Feature}` | {N(stat.Bet)} | {N(stat.PaidOut)} | {perc}\n";
}
var bet = stats.Sum(x => x.Bet);
var paidOut = stats.Sum(x => x.PaidOut);
if (bet == 0)
bet = 1;
var tPerc = (paidOut / bet).ToString("P2", Culture);
str += "--------------------------------------------\n";
str += $"**TOTAL** | {N(bet)} | {N(paidOut)} | {tPerc}";
eb.WithDescription(str);
await ctx.Channel.EmbedAsync(eb);