mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-11 17:58:26 -04:00
Finished new response system
This commit is contained in:
@@ -67,7 +67,7 @@ public partial class Games
|
||||
|
||||
private Task Game_OnStarted(AcrophobiaGame game)
|
||||
{
|
||||
var embed = new EmbedBuilder()
|
||||
var embed = _sender.CreateEmbed()
|
||||
.WithOkColor()
|
||||
.WithTitle(GetText(strs.acrophobia))
|
||||
.WithDescription(
|
||||
@@ -92,7 +92,7 @@ public partial class Games
|
||||
|
||||
if (submissions.Length == 1)
|
||||
{
|
||||
await Response().Embed(new EmbedBuilder()
|
||||
await Response().Embed(_sender.CreateEmbed()
|
||||
.WithOkColor()
|
||||
.WithDescription(GetText(
|
||||
strs.acro_winner_only(
|
||||
@@ -103,7 +103,7 @@ public partial class Games
|
||||
|
||||
|
||||
var i = 0;
|
||||
var embed = new EmbedBuilder()
|
||||
var embed = _sender.CreateEmbed()
|
||||
.WithOkColor()
|
||||
.WithTitle(GetText(strs.acrophobia) + " - " + GetText(strs.submissions_closed))
|
||||
.WithDescription(GetText(strs.acro_nym_was(
|
||||
@@ -127,7 +127,7 @@ public partial class Games
|
||||
|
||||
var table = votes.OrderByDescending(v => v.Value);
|
||||
var winner = table.First();
|
||||
var embed = new EmbedBuilder()
|
||||
var embed = _sender.CreateEmbed()
|
||||
.WithOkColor()
|
||||
.WithTitle(GetText(strs.acrophobia))
|
||||
.WithDescription(GetText(strs.acro_winner(Format.Bold(winner.Key.UserName),
|
||||
|
@@ -38,7 +38,7 @@ public partial class Games : NadekoModule<GamesService>
|
||||
return;
|
||||
|
||||
var res = _service.GetEightballResponse(ctx.User.Id, question);
|
||||
await Response().Embed(new EmbedBuilder()
|
||||
await Response().Embed(_sender.CreateEmbed()
|
||||
.WithOkColor()
|
||||
.WithDescription(ctx.User.ToString())
|
||||
.AddField("❓ " + GetText(strs.question), question)
|
||||
|
@@ -23,11 +23,11 @@ public partial class Games
|
||||
/-\
|
||||
""";
|
||||
|
||||
public static EmbedBuilder GetEmbed(HangmanGame.State state)
|
||||
public static EmbedBuilder GetEmbed(IMessageSenderService sender, HangmanGame.State state)
|
||||
{
|
||||
if (state.Phase == HangmanGame.Phase.Running)
|
||||
{
|
||||
return new EmbedBuilder()
|
||||
return sender.CreateEmbed()
|
||||
.WithOkColor()
|
||||
.AddField("Hangman", Draw(state))
|
||||
.AddField("Guess", Format.Code(state.Word))
|
||||
@@ -36,14 +36,14 @@ public partial class Games
|
||||
|
||||
if (state.Phase == HangmanGame.Phase.Ended && state.Failed)
|
||||
{
|
||||
return new EmbedBuilder()
|
||||
return sender.CreateEmbed()
|
||||
.WithErrorColor()
|
||||
.AddField("Hangman", Draw(state))
|
||||
.AddField("Guess", Format.Code(state.Word))
|
||||
.WithFooter(state.MissedLetters.Join(' '));
|
||||
}
|
||||
|
||||
return new EmbedBuilder()
|
||||
return sender.CreateEmbed()
|
||||
.WithOkColor()
|
||||
.AddField("Hangman", Draw(state))
|
||||
.AddField("Guess", Format.Code(state.Word))
|
||||
@@ -60,7 +60,7 @@ public partial class Games
|
||||
return;
|
||||
}
|
||||
|
||||
var eb = GetEmbed(hangman);
|
||||
var eb = GetEmbed(_sender, hangman);
|
||||
eb.WithDescription(GetText(strs.hangman_game_started));
|
||||
await Response().Embed(eb).SendAsync();
|
||||
}
|
||||
|
@@ -116,7 +116,7 @@ public sealed class HangmanService : IHangmanService, IExecNoCommand
|
||||
string content,
|
||||
HangmanGame.State state)
|
||||
{
|
||||
var embed = Games.HangmanCommands.GetEmbed(state);
|
||||
var embed = Games.HangmanCommands.GetEmbed(_sender, state);
|
||||
if (state.GuessResult == HangmanGame.GuessResult.Guess)
|
||||
embed.WithDescription($"{user} guessed the letter {content}!").WithOkColor();
|
||||
else if (state.GuessResult == HangmanGame.GuessResult.Incorrect && state.Failed)
|
||||
|
@@ -94,7 +94,7 @@ public partial class Games
|
||||
if (removed is null)
|
||||
return;
|
||||
|
||||
var embed = new EmbedBuilder()
|
||||
var embed = _sender.CreateEmbed()
|
||||
.WithTitle($"Removed typing article #{index + 1}")
|
||||
.WithDescription(removed.Text.TrimTo(50))
|
||||
.WithOkColor();
|
||||
|
@@ -82,7 +82,6 @@ public class TypingGame
|
||||
|
||||
do
|
||||
{
|
||||
// todo fix all modifies
|
||||
await Task.Delay(2000);
|
||||
time -= 2;
|
||||
try { await msg.ModifyAsync(m => m.Content = $"Starting new typing contest in **{time}**.."); }
|
||||
@@ -145,7 +144,7 @@ public class TypingGame
|
||||
var wpm = CurrentSentence.Length / WORD_VALUE / elapsed.TotalSeconds * 60;
|
||||
_finishedUserIds.Add(msg.Author.Id);
|
||||
|
||||
var embed = new EmbedBuilder()
|
||||
var embed = _sender.CreateEmbed()
|
||||
.WithOkColor()
|
||||
.WithTitle($"{msg.Author} finished the race!")
|
||||
.AddField("Place", $"#{_finishedUserIds.Count}", true)
|
||||
|
@@ -73,7 +73,7 @@ public class TicTacToe
|
||||
|
||||
public EmbedBuilder GetEmbed(string title = null)
|
||||
{
|
||||
var embed = new EmbedBuilder()
|
||||
var embed = _sender.CreateEmbed()
|
||||
.WithOkColor()
|
||||
.WithDescription(Environment.NewLine + GetState())
|
||||
.WithAuthor(GetText(strs.vs(_users[0], _users[1])));
|
||||
|
@@ -160,7 +160,7 @@ public partial class Games
|
||||
{
|
||||
try
|
||||
{
|
||||
questionEmbed = new EmbedBuilder()
|
||||
questionEmbed = _sender.CreateEmbed()
|
||||
.WithOkColor()
|
||||
.WithTitle(GetText(strs.trivia_game))
|
||||
.AddField(GetText(strs.category), question.Category)
|
||||
@@ -189,7 +189,7 @@ public partial class Games
|
||||
{
|
||||
try
|
||||
{
|
||||
var embed = new EmbedBuilder()
|
||||
var embed = _sender.CreateEmbed()
|
||||
.WithErrorColor()
|
||||
.WithTitle(GetText(strs.trivia_game))
|
||||
.WithDescription(GetText(strs.trivia_times_up(Format.Bold(question.Answer))));
|
||||
@@ -221,7 +221,7 @@ public partial class Games
|
||||
{
|
||||
try
|
||||
{
|
||||
await Response().Embed(new EmbedBuilder()
|
||||
await Response().Embed(_sender.CreateEmbed()
|
||||
.WithOkColor()
|
||||
.WithAuthor(GetText(strs.trivia_ended))
|
||||
.WithTitle(GetText(strs.leaderboard))
|
||||
@@ -247,7 +247,7 @@ public partial class Games
|
||||
{
|
||||
try
|
||||
{
|
||||
var embed = new EmbedBuilder()
|
||||
var embed = _sender.CreateEmbed()
|
||||
.WithOkColor()
|
||||
.WithTitle(GetText(strs.trivia_game))
|
||||
.WithDescription(GetText(strs.trivia_win(user.Name,
|
||||
|
Reference in New Issue
Block a user