mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-13 18:58:27 -04:00
- Reworked embed builder
- Use IEmbedBuilderService to create embed builders - Wrapped embed builder and using IEmbedBuilder
This commit is contained in:
@@ -41,7 +41,7 @@ namespace NadekoBot.Modules.Games
|
||||
if (_service.StartPoll(poll))
|
||||
{
|
||||
await ctx.Channel
|
||||
.EmbedAsync(new EmbedBuilder()
|
||||
.EmbedAsync(_eb.Create()
|
||||
.WithOkColor()
|
||||
.WithTitle(GetText("poll_created", ctx.User.ToString()))
|
||||
.WithDescription(
|
||||
@@ -83,14 +83,14 @@ namespace NadekoBot.Modules.Games
|
||||
.ConfigureAwait(false);
|
||||
}
|
||||
|
||||
public EmbedBuilder GetStats(Poll poll, string title)
|
||||
public IEmbedBuilder GetStats(Poll poll, string title)
|
||||
{
|
||||
var results = poll.Votes.GroupBy(kvp => kvp.VoteIndex)
|
||||
.ToDictionary(x => x.Key, x => x.Sum(kvp => 1));
|
||||
|
||||
var totalVotesCast = results.Sum(x => x.Value);
|
||||
|
||||
var eb = new EmbedBuilder().WithTitle(title);
|
||||
var eb = _eb.Create().WithTitle(title);
|
||||
|
||||
var sb = new StringBuilder()
|
||||
.AppendLine(Format.Bold(poll.Question))
|
||||
|
Reference in New Issue
Block a user