Compare commits

...

2 commits

Author SHA1 Message Date
69f45cd592
fixed hangman look 2025-03-28 21:21:31 +13:00
ea1c8c56e3
fixed fishconfig reverting captcha every time 2025-03-28 21:20:20 +13:00
2 changed files with 39 additions and 26 deletions
src/EllieBot/Modules/Games

View file

@ -19,6 +19,8 @@ public sealed class FishConfigService : ConfigServiceBase<FishConfig>
} }
private void Migrate() private void Migrate()
{
if (data.Version < 2)
{ {
ModifyConfig(c => ModifyConfig(c =>
{ {
@ -27,3 +29,4 @@ public sealed class FishConfigService : ConfigServiceBase<FishConfig>
}); });
} }
} }
}

View file

@ -10,18 +10,28 @@ public partial class Games
[Cmd] [Cmd]
[RequireContext(ContextType.Guild)] [RequireContext(ContextType.Guild)]
public async Task Hangmanlist() public async Task Hangmanlist()
=> await Response().Confirm(GetText(strs.hangman_types(prefix)), _service.GetHangmanTypes().Join('\n')).SendAsync(); => await Response().Confirm(GetText(strs.hangman_types(prefix)), _service.GetHangmanTypes().Join('\n'))
.SendAsync();
private static string Draw(HangmanGame.State state) private static string Draw(HangmanGame.State state)
=> $""" {
. var head = state.Errors >= 1 ? "O" : " ";
................ var torso = state.Errors >= 2 ? "|" : " ";
................ var leftArm = state.Errors >= 3 ? "/" : " ";
.{(state.Errors > 0 ? ".............😲" : "")} var rightArm = state.Errors >= 4 ? "\\" : " ";
.{(state.Errors > 1 ? "............./" : "")} {(state.Errors > 2 ? "|" : "")} {(state.Errors > 3 ? "\\" : "")} var leftLeg = state.Errors >= 5 ? "/" : " ";
.{(state.Errors > 4 ? "............../" : "")} {(state.Errors > 5 ? "\\" : "")} var rightLeg = state.Errors >= 6 ? "\\" : " ";
/-\
return $"""
```
{head}
{leftArm} {torso} {rightArm}
{leftLeg} {rightLeg}
```
"""; """;
}
public static EmbedBuilder GetEmbed(IMessageSenderService sender, HangmanGame.State state) public static EmbedBuilder GetEmbed(IMessageSenderService sender, HangmanGame.State state)
{ {