mirror of
https://github.com/barelyprofessional/KfChatDotNet.git
synced 2026-05-02 04:22:04 -04:00
Added wait for message to be received
This commit is contained in:
@@ -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];
|
||||||
|
|||||||
Reference in New Issue
Block a user