Fixed $roll X response, $waifuinfo now shows up to 40 random wives, not all

This commit is contained in:
Kwoth 2017-02-21 03:04:22 +01:00
parent ed656f503b
commit cfc00b5df6
4 changed files with 19 additions and 5 deletions

View File

@ -124,9 +124,9 @@ namespace NadekoBot.Modules.Gambling
bitmap.Save(ms); bitmap.Save(ms);
ms.Position = 0; ms.Position = 0;
await Context.Channel.SendFileAsync(ms, "dice.png", await Context.Channel.SendFileAsync(ms, "dice.png",
Context.User.Mention + Context.User.Mention + " " +
GetText("dice_rolled_num", Format.Bold(values.Count.ToString())) + GetText("dice_rolled_num", Format.Bold(values.Count.ToString())) +
" " + GetText("Total: {1} Average: {2}", " " + GetText("total_average",
Format.Bold(values.Sum().ToString()), Format.Bold(values.Sum().ToString()),
Format.Bold((values.Sum() / (1.0f * values.Count)).ToString("N2")))).ConfigureAwait(false); Format.Bold((values.Sum() / (1.0f * values.Count)).ToString("N2")))).ConfigureAwait(false);
} }

View File

@ -423,6 +423,8 @@ namespace NadekoBot.Modules.Gambling
var claimInfo = GetClaimTitle(target.Id); var claimInfo = GetClaimTitle(target.Id);
var affInfo = GetAffinityTitle(target.Id); var affInfo = GetAffinityTitle(target.Id);
var rng = new NadekoRandom();
var nobody = GetText("nobody"); var nobody = GetText("nobody");
var embed = new EmbedBuilder() var embed = new EmbedBuilder()
.WithOkColor() .WithOkColor()
@ -432,7 +434,7 @@ namespace NadekoBot.Modules.Gambling
.AddField(efb => efb.WithName(GetText("likes")).WithValue(w.Affinity?.ToString() ?? nobody).WithIsInline(true)) .AddField(efb => efb.WithName(GetText("likes")).WithValue(w.Affinity?.ToString() ?? nobody).WithIsInline(true))
.AddField(efb => efb.WithName(GetText("changes_of_heart")).WithValue($"{affInfo.Count} - \"the {affInfo.Title}\"").WithIsInline(true)) .AddField(efb => efb.WithName(GetText("changes_of_heart")).WithValue($"{affInfo.Count} - \"the {affInfo.Title}\"").WithIsInline(true))
.AddField(efb => efb.WithName(GetText("divorces")).WithValue(divorces.ToString()).WithIsInline(true)) .AddField(efb => efb.WithName(GetText("divorces")).WithValue(divorces.ToString()).WithIsInline(true))
.AddField(efb => efb.WithName($"Waifus ({claims.Count})").WithValue(claims.Count == 0 ? nobody : string.Join("\n", claims.Select(x => x.Waifu))).WithIsInline(true)); .AddField(efb => efb.WithName($"Waifus ({claims.Count})").WithValue(claims.Count == 0 ? nobody : string.Join("\n", claims.OrderBy(x => rng.Next()).Take(40).Select(x => x.Waifu))).WithIsInline(true));
await Context.Channel.EmbedAsync(embed).ConfigureAwait(false); await Context.Channel.EmbedAsync(embed).ConfigureAwait(false);
} }

View File

@ -2244,7 +2244,7 @@ namespace NadekoBot.Resources {
} }
/// <summary> /// <summary>
/// Looks up a localized string similar to Dice rolled: {1}. /// Looks up a localized string similar to Dice rolled: {0}.
/// </summary> /// </summary>
public static string gambling_dice_rolled_num { public static string gambling_dice_rolled_num {
get { get {
@ -2577,6 +2577,15 @@ namespace NadekoBot.Resources {
} }
} }
/// <summary>
/// Looks up a localized string similar to Total: {0} Average: {1}.
/// </summary>
public static string gambling_total_average {
get {
return ResourceManager.GetString("gambling_total_average", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to your affinity is already set to that waifu or you&apos;re trying to remove your affinity while not having one.. /// Looks up a localized string similar to your affinity is already set to that waifu or you&apos;re trying to remove your affinity while not having one..
/// </summary> /// </summary>

View File

@ -1081,7 +1081,7 @@ Don't forget to leave your discord name or id in the message.
<comment>Someone rolled 35</comment> <comment>Someone rolled 35</comment>
</data> </data>
<data name="gambling_dice_rolled_num" xml:space="preserve"> <data name="gambling_dice_rolled_num" xml:space="preserve">
<value>Dice rolled: {1}</value> <value>Dice rolled: {0}</value>
<comment>Dice Rolled: 5</comment> <comment>Dice Rolled: 5</comment>
</data> </data>
<data name="gambling_race_failed_starting" xml:space="preserve"> <data name="gambling_race_failed_starting" xml:space="preserve">
@ -1218,4 +1218,7 @@ Don't forget to leave your discord name or id in the message.
<data name="games_submissions_closed" xml:space="preserve"> <data name="games_submissions_closed" xml:space="preserve">
<value>Submissions Closed</value> <value>Submissions Closed</value>
</data> </data>
<data name="gambling_total_average" xml:space="preserve">
<value>Total: {0} Average: {1}</value>
</data>
</root> </root>