.lcr all now shows ids and text of the reaction

This commit is contained in:
Kwoth 2016-12-26 06:16:34 +01:00
parent 8421ba8247
commit 342f3e1579

View File

@ -172,7 +172,7 @@ namespace NadekoBot.Modules.CustomReactions
{ {
var txtStream = await customReactions.GroupBy(cr => cr.Trigger) var txtStream = await customReactions.GroupBy(cr => cr.Trigger)
.OrderBy(cr => cr.Key) .OrderBy(cr => cr.Key)
.Select(cr => new { Trigger = cr.Key, Responses = cr.Select(y => y.Response).ToList() }) .Select(cr => new { Trigger = cr.Key, Responses = cr.Select(y => new { id = y.Response, text = y.Response }).ToList() })
.ToJson() .ToJson()
.ToStream() .ToStream()
.ConfigureAwait(false); .ConfigureAwait(false);
@ -293,7 +293,7 @@ namespace NadekoBot.Modules.CustomReactions
{ {
await imsg.Channel.SendErrorAsync("No stats for that trigger found, no action taken.").ConfigureAwait(false); await imsg.Channel.SendErrorAsync("No stats for that trigger found, no action taken.").ConfigureAwait(false);
} }
} }
} }
[NadekoCommand, Usage, Description, Aliases] [NadekoCommand, Usage, Description, Aliases]
@ -302,7 +302,7 @@ namespace NadekoBot.Modules.CustomReactions
if (page < 1) if (page < 1)
return; return;
await imsg.Channel.EmbedAsync(ReactionStats.OrderByDescending(x => x.Value) await imsg.Channel.EmbedAsync(ReactionStats.OrderByDescending(x => x.Value)
.Skip((page - 1)*9) .Skip((page - 1) * 9)
.Take(9) .Take(9)
.Aggregate(new EmbedBuilder().WithOkColor().WithTitle($"Custom Reaction stats page #{page}"), .Aggregate(new EmbedBuilder().WithOkColor().WithTitle($"Custom Reaction stats page #{page}"),
(agg, cur) => agg.AddField(efb => efb.WithName(cur.Key).WithValue(cur.Value.ToString()).WithIsInline(true))) (agg, cur) => agg.AddField(efb => efb.WithName(cur.Key).WithValue(cur.Value.ToString()).WithIsInline(true)))
@ -310,4 +310,4 @@ namespace NadekoBot.Modules.CustomReactions
.ConfigureAwait(false); .ConfigureAwait(false);
} }
} }
} }