fix board size, some fixes to auto cashout from cursor (#75)

* cursor fixes

cursor fixes

* Improve cashout condition validation

Refactor cashout condition to check for success and non-empty value.

* cursor

cursor

* Update BotServices.cs

* Update board size limit from 10 to 9

Update board size limit from 10 to 9
81 characters instead of 100
12 bytes per character per powershell, 
down from 1200 bytes to 972

* Implement message deletion for active games

Added logic to delete messages associated with active games.
This commit is contained in:
alogindtractor
2026-02-09 07:00:45 -08:00
committed by GitHub
parent b6df015277
commit 21c8803eb9
3 changed files with 10 additions and 5 deletions

View File

@@ -80,7 +80,8 @@ public class MinesCommand : ICommand
return;
}
bool cashout = false;
if (arguments.TryGetValue("cashout", out var cashOut)||message.Message.Contains("cashout")) cashout = true;
if (arguments.TryGetValue("cashout", out var cashOut) && cashOut.Success && !string.IsNullOrWhiteSpace(cashOut.Value))
cashout = true;
if (!Regex.IsMatch(message.Message, @"\d") && cashout) //if the message has no ints its a cashout attempt
{
@@ -173,9 +174,9 @@ public class MinesCommand : ICommand
return;
}
int boardSize = Convert.ToInt32(size.Value);
if (boardSize < 2 || boardSize > 10)
if (boardSize < 2 || boardSize > 9)
{
await botInstance.SendChatMessageAsync($"{user.FormatUsername()}, board size must be between 2 and 10.",true, autoDeleteAfter: cleanupDelay);
await botInstance.SendChatMessageAsync($"{user.FormatUsername()}, board size must be between 2 and 9.",true, autoDeleteAfter: cleanupDelay);
return;
}
int minesCount = Convert.ToInt32(mines.Value);