Added wait for message to be received

This commit is contained in:
barelyprofessional
2026-02-05 23:43:24 -06:00
parent bf9d3268cd
commit 28cc6a2651

View File

@@ -37,7 +37,7 @@ public class MinesCommand : ICommand
public RateLimitOptionsModel? RateLimitOptions => new RateLimitOptionsModel public RateLimitOptionsModel? RateLimitOptions => new RateLimitOptionsModel
{ {
MaxInvocations = 1, MaxInvocations = 1,
Window = TimeSpan.FromSeconds(10) Window = TimeSpan.FromSeconds(40)
}; };
private KasinoMines? KasinoMines; private KasinoMines? KasinoMines;
@@ -143,7 +143,8 @@ public class MinesCommand : ICommand
await KasinoMines.CreateGame(gambler, wager, boardSize, minesCount); await KasinoMines.CreateGame(gambler, wager, boardSize, minesCount);
var msg = await botInstance.SendChatMessageAsync( var msg = await botInstance.SendChatMessageAsync(
$"{KasinoMines.ActiveGames[gambler.Id].ToString()}", true); $"{KasinoMines.ActiveGames[gambler.Id].ToString()}", true);
var msgSuccess = await botInstance.WaitForChatMessageAsync(msg, ct: ctx);
if (!msgSuccess) throw new InvalidOperationException("Timed out waiting for the message");
if (pick == 0) //if using coordinates if (pick == 0) //if using coordinates
{ {
var game = KasinoMines.ActiveGames[gambler.Id]; var game = KasinoMines.ActiveGames[gambler.Id];