$lb redesign
This commit is contained in:
@ -248,22 +248,33 @@ namespace NadekoBot.Modules.Gambling
|
||||
[NadekoCommand, Usage, Description, Aliases]
|
||||
public async Task Leaderboard()
|
||||
{
|
||||
IEnumerable<Currency> richest = new List<Currency>();
|
||||
var richest = new List<Currency>();
|
||||
using (var uow = DbHandler.UnitOfWork())
|
||||
{
|
||||
richest = uow.Currency.GetTopRichest(10);
|
||||
richest = uow.Currency.GetTopRichest(9).ToList();
|
||||
}
|
||||
if (!richest.Any())
|
||||
return;
|
||||
await Context.Channel.SendMessageAsync(
|
||||
richest.Aggregate(new StringBuilder(
|
||||
$@"```xl
|
||||
┏━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━┓
|
||||
┃ Id ┃ $$$ ┃
|
||||
"),
|
||||
(cur, cs) => cur.AppendLine($@"┣━━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━┫
|
||||
┃{(Context.Guild.GetUserAsync(cs.UserId).GetAwaiter().GetResult()?.Username?.TrimTo(18, true) ?? cs.UserId.ToString()),-20} ┃ {cs.Amount,6} ┃")
|
||||
).ToString() + "┗━━━━━━━━━━━━━━━━━━━━━┻━━━━━━━━┛```").ConfigureAwait(false);
|
||||
|
||||
|
||||
var embed = new EmbedBuilder()
|
||||
.WithOkColor()
|
||||
.WithTitle(NadekoBot.BotConfig.CurrencySign + " Leaderboard");
|
||||
|
||||
for (var i = 0; i < richest.Count; i++)
|
||||
{
|
||||
var x = richest[i];
|
||||
var usr = await Context.Guild.GetUserAsync(x.UserId).ConfigureAwait(false);
|
||||
var usrStr = "";
|
||||
if (usr == null)
|
||||
usrStr = x.UserId.ToString();
|
||||
else
|
||||
usrStr = usr.Username?.TrimTo(20, true);
|
||||
|
||||
embed.AddField(efb => efb.WithName("#" + (i + 1) + " " + usrStr).WithValue(x.Amount.ToString() + " " + NadekoBot.BotConfig.CurrencySign).WithIsInline(true));
|
||||
}
|
||||
|
||||
await Context.Channel.EmbedAsync(embed).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -879,7 +879,7 @@ namespace NadekoBot.Resources {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Bet to guess will the result be heads or tails. Guessing awards you 1.8x the currency you've bet..
|
||||
/// Looks up a localized string similar to Bet to guess will the result be heads or tails. Guessing awards you 1.95x the currency you've bet (rounded up). Multiplier can be changed by the bot owner..
|
||||
/// </summary>
|
||||
public static string betflip_desc {
|
||||
get {
|
||||
|
@ -1183,7 +1183,7 @@
|
||||
<value>betflip bf</value>
|
||||
</data>
|
||||
<data name="betflip_desc" xml:space="preserve">
|
||||
<value>Bet to guess will the result be heads or tails. Guessing awards you 1.8x the currency you've bet.</value>
|
||||
<value>Bet to guess will the result be heads or tails. Guessing awards you 1.95x the currency you've bet (rounded up). Multiplier can be changed by the bot owner.</value>
|
||||
</data>
|
||||
<data name="betflip_usage" xml:space="preserve">
|
||||
<value>`{0}bf 5 heads` or `{0}bf 3 t`</value>
|
||||
|
Reference in New Issue
Block a user