mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-11 01:38:27 -04:00
- Reworked embed builder
- Use IEmbedBuilderService to create embed builders - Wrapped embed builder and using IEmbedBuilder
This commit is contained in:
@@ -80,7 +80,7 @@ namespace NadekoBot.Modules.Games
|
||||
|
||||
private Task Game_OnStarted(AcrophobiaGame game)
|
||||
{
|
||||
var embed = new EmbedBuilder().WithOkColor()
|
||||
var embed = _eb.Create().WithOkColor()
|
||||
.WithTitle(GetText("acrophobia"))
|
||||
.WithDescription(GetText("acro_started", Format.Bold(string.Join(".", game.StartingLetters))))
|
||||
.WithFooter(GetText("acro_started_footer", game.Opts.SubmissionTime));
|
||||
@@ -90,7 +90,7 @@ namespace NadekoBot.Modules.Games
|
||||
|
||||
private Task Game_OnUserVoted(string user)
|
||||
{
|
||||
return ctx.Channel.SendConfirmAsync(
|
||||
return SendConfirmAsync(
|
||||
GetText("acrophobia"),
|
||||
GetText("acro_vote_cast", Format.Bold(user)));
|
||||
}
|
||||
@@ -99,12 +99,12 @@ namespace NadekoBot.Modules.Games
|
||||
{
|
||||
if (submissions.Length == 0)
|
||||
{
|
||||
await ctx.Channel.SendErrorAsync(GetText("acrophobia"), GetText("acro_ended_no_sub")).ConfigureAwait(false);
|
||||
await SendErrorAsync(GetText("acrophobia"), GetText("acro_ended_no_sub")).ConfigureAwait(false);
|
||||
return;
|
||||
}
|
||||
if (submissions.Length == 1)
|
||||
{
|
||||
await ctx.Channel.EmbedAsync(new EmbedBuilder().WithOkColor()
|
||||
await ctx.Channel.EmbedAsync(_eb.Create().WithOkColor()
|
||||
.WithDescription(
|
||||
GetText("acro_winner_only",
|
||||
Format.Bold(submissions.First().Key.UserName)))
|
||||
@@ -115,7 +115,7 @@ namespace NadekoBot.Modules.Games
|
||||
|
||||
|
||||
var i = 0;
|
||||
var embed = new EmbedBuilder()
|
||||
var embed = _eb.Create()
|
||||
.WithOkColor()
|
||||
.WithTitle(GetText("acrophobia") + " - " + GetText("submissions_closed"))
|
||||
.WithDescription(GetText("acro_nym_was", Format.Bold(string.Join(".", game.StartingLetters)) + "\n" +
|
||||
@@ -131,12 +131,12 @@ $@"--
|
||||
{
|
||||
if (!votes.Any() || votes.All(x => x.Value == 0))
|
||||
{
|
||||
await ctx.Channel.SendErrorAsync(GetText("acrophobia"), GetText("acro_no_votes_cast")).ConfigureAwait(false);
|
||||
await SendErrorAsync(GetText("acrophobia"), GetText("acro_no_votes_cast")).ConfigureAwait(false);
|
||||
return;
|
||||
}
|
||||
var table = votes.OrderByDescending(v => v.Value);
|
||||
var winner = table.First();
|
||||
var embed = new EmbedBuilder().WithOkColor()
|
||||
var embed = _eb.Create().WithOkColor()
|
||||
.WithTitle(GetText("acrophobia"))
|
||||
.WithDescription(GetText("acro_winner", Format.Bold(winner.Key.UserName),
|
||||
Format.Bold(winner.Value.ToString())))
|
||||
|
Reference in New Issue
Block a user