mirror of
https://github.com/barelyprofessional/KfChatDotNet.git
synced 2026-05-02 04:22:04 -04:00
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:
@@ -101,9 +101,10 @@ public class KasinoMines
|
||||
for (int r = 0; r < Size; r++)
|
||||
{
|
||||
await Task.Delay(100);
|
||||
revealedSpace = false;
|
||||
|
||||
for (int c = 0; c < Size; c++)
|
||||
{
|
||||
revealedSpace = false;
|
||||
foreach (var bet in BetsPlaced)
|
||||
{
|
||||
if (bet.r == r && bet.c == c) revealedSpace = true;
|
||||
@@ -150,6 +151,7 @@ public class KasinoMines
|
||||
|
||||
await Task.Delay(TimeSpan.FromSeconds(10));
|
||||
await _kfChatBot.KfClient.DeleteMessageAsync(msg.ChatMessageId!.Value);
|
||||
LastMessageId = 0;
|
||||
|
||||
(int vertical, int horizontal) DistanceFromMine((int r, int c) coord)
|
||||
{
|
||||
@@ -291,6 +293,8 @@ public class KasinoMines
|
||||
public async Task RemoveGame(int gamblerId)
|
||||
{
|
||||
await GetSavedGames(gamblerId);
|
||||
//attempt to delete the message if its there
|
||||
if (ActiveGames[gamblerId].LastMessageId != 0) _kfChatBot.KfClient.DeleteMessage(ActiveGames[gamblerId].LastMessageId);
|
||||
ActiveGames?.Remove(gamblerId);
|
||||
await SaveActiveGames(gamblerId);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user