Cleaned up embedbuilder calls to use parameters instead of footer builder

This commit is contained in:
Kwoth
2021-07-07 22:52:47 +02:00
parent ac9f84715b
commit cbecd823c1
26 changed files with 199 additions and 153 deletions

View File

@@ -83,7 +83,7 @@ namespace NadekoBot.Modules.Games
var embed = new EmbedBuilder().WithOkColor()
.WithTitle(GetText("acrophobia"))
.WithDescription(GetText("acro_started", Format.Bold(string.Join(".", game.StartingLetters))))
.WithFooter(efb => efb.WithText(GetText("acro_started_footer", game.Opts.SubmissionTime)));
.WithFooter(GetText("acro_started_footer", game.Opts.SubmissionTime));
return ctx.Channel.EmbedAsync(embed);
}
@@ -108,7 +108,7 @@ namespace NadekoBot.Modules.Games
.WithDescription(
GetText("acro_winner_only",
Format.Bold(submissions.First().Key.UserName)))
.WithFooter(efb => efb.WithText(submissions.First().Key.Input)))
.WithFooter(submissions.First().Key.Input))
.ConfigureAwait(false);
return;
}
@@ -122,7 +122,7 @@ namespace NadekoBot.Modules.Games
$@"--
{submissions.Aggregate("", (agg, cur) => agg + $"`{++i}.` **{cur.Key.Input}**\n")}
--"))
.WithFooter(efb => efb.WithText(GetText("acro_vote")));
.WithFooter(GetText("acro_vote"));
await ctx.Channel.EmbedAsync(embed).ConfigureAwait(false);
}
@@ -140,7 +140,7 @@ $@"--
.WithTitle(GetText("acrophobia"))
.WithDescription(GetText("acro_winner", Format.Bold(winner.Key.UserName),
Format.Bold(winner.Value.ToString())))
.WithFooter(efb => efb.WithText(winner.Key.Input));
.WithFooter(winner.Key.Input);
await ctx.Channel.EmbedAsync(embed).ConfigureAwait(false);
}

View File

@@ -104,12 +104,12 @@ namespace NadekoBot.Modules.Games.Common
if (_winner is null)
{
if (_phase == Phase.Ended)
embed.WithFooter(efb => efb.WithText(GetText("ttt_no_moves")));
embed.WithFooter(GetText("ttt_no_moves"));
else
embed.WithFooter(efb => efb.WithText(GetText("ttt_users_move", _users[_curUserIndex])));
embed.WithFooter(GetText("ttt_users_move", _users[_curUserIndex]));
}
else
embed.WithFooter(efb => efb.WithText(GetText("ttt_has_won", _winner)));
embed.WithFooter(GetText("ttt_has_won", _winner));
return embed;
}

View File

@@ -125,7 +125,7 @@ namespace NadekoBot.Modules.Games.Common.Trivia
if (!_options.NoHint)
try
{
await questionMessage.ModifyAsync(m => m.Embed = questionEmbed.WithFooter(efb => efb.WithText(CurrentQuestion.GetHint())).Build())
await questionMessage.ModifyAsync(m => m.Embed = questionEmbed.WithFooter(CurrentQuestion.GetHint()).Build())
.ConfigureAwait(false);
}
catch (HttpException ex) when (ex.HttpCode == System.Net.HttpStatusCode.NotFound || ex.HttpCode == System.Net.HttpStatusCode.Forbidden)

View File

@@ -50,7 +50,7 @@ namespace NadekoBot.Modules.Games
var res = _service.GetEightballResponse(ctx.User.Id, question);
await ctx.Channel.EmbedAsync(new EmbedBuilder().WithColor(Bot.OkColor)
.WithDescription(ctx.User.ToString())
.AddField(efb => efb.WithName("❓ " + GetText("question")).WithValue(question).WithIsInline(false))
.AddField("❓ " + GetText("question"), question, false)
.AddField("🎱 " + GetText("8ball"), res, false));
}
@@ -80,9 +80,9 @@ namespace NadekoBot.Modules.Games
text: Format.Bold($"{ctx.User.Mention} Girl Rating For {usr}"),
embed: new EmbedBuilder()
.WithOkColor()
.AddField(efb => efb.WithName("Hot").WithValue(gr.Hot.ToString("F2")).WithIsInline(true))
.AddField(efb => efb.WithName("Crazy").WithValue(gr.Crazy.ToString("F2")).WithIsInline(true))
.AddField(efb => efb.WithName("Advice").WithValue(gr.Advice).WithIsInline(false))
.AddField("Hot", gr.Hot.ToString("F2"), true)
.AddField("Crazy", gr.Crazy.ToString("F2"), true)
.AddField("Advice", gr.Advice, false)
.Build()).ConfigureAwait(false);
}
}

View File

@@ -90,7 +90,7 @@ namespace NadekoBot.Modules.Games
var loseEmbed = new EmbedBuilder().WithTitle($"Hangman Game ({game.TermType}) - Ended")
.WithDescription(Format.Bold("You lose."))
.AddField(efb => efb.WithName("It was").WithValue(game.Term.GetWord()))
.WithFooter(efb => efb.WithText(string.Join(" ", game.PreviousGuesses)))
.WithFooter(string.Join(" ", game.PreviousGuesses))
.WithErrorColor();
if (Uri.IsWellFormedUriString(game.Term.ImageUrl, UriKind.Absolute))
@@ -102,7 +102,7 @@ namespace NadekoBot.Modules.Games
var winEmbed = new EmbedBuilder().WithTitle($"Hangman Game ({game.TermType}) - Ended")
.WithDescription(Format.Bold($"{winner} Won."))
.AddField(efb => efb.WithName("It was").WithValue(game.Term.GetWord()))
.WithFooter(efb => efb.WithText(string.Join(" ", game.PreviousGuesses)))
.WithFooter(string.Join(" ", game.PreviousGuesses))
.WithOkColor();
if (Uri.IsWellFormedUriString(game.Term.ImageUrl, UriKind.Absolute))

View File

@@ -116,7 +116,7 @@ namespace NadekoBot.Modules.Games
}
return eb.WithDescription(sb.ToString())
.WithFooter(efb => efb.WithText(GetText("x_votes_cast", totalVotesCast)))
.WithFooter(GetText("x_votes_cast", totalVotesCast))
.WithOkColor();
}
}