mirror of
https://github.com/barelyprofessional/KfChatDotNet.git
synced 2026-05-02 04:22:04 -04:00
wait for chat message id plinko update (#28)
* Update cleanup delay settings for PlinkoCommand, use plinko delay instead of limbo Update cleanup delay settings for PlinkoCommand, use plinko delay instead of limbo * wait for chat message id update wait for chat message id update
This commit is contained in:
@@ -84,8 +84,16 @@ public class PlinkoCommand : ICommand
|
|||||||
ballsNotInPlay.Add(new PlinkoBall());
|
ballsNotInPlay.Add(new PlinkoBall());
|
||||||
}
|
}
|
||||||
//game starts here
|
//game starts here
|
||||||
|
int breakCounter = 0
|
||||||
var plinkoMessageID = await botInstance.SendChatMessageAsync(PlinkoBoardDisplay(ballsInPlay), true, autoDeleteAfter: cleanupDelay);
|
var plinkoMessageID = await botInstance.SendChatMessageAsync(PlinkoBoardDisplay(ballsInPlay), true, autoDeleteAfter: cleanupDelay);
|
||||||
int breakCounter = 0;
|
while (plinkoMessageID.ChatMessageId == null && breakCounter < 1000) {
|
||||||
|
await Task.Delay(100);
|
||||||
|
breakCounter++;
|
||||||
|
}
|
||||||
|
if (breakCounter >= 999){
|
||||||
|
throw new Exception("game broke while waiting for chat message id");
|
||||||
|
}
|
||||||
|
breakCounter = 0;
|
||||||
while (ballsNotInPlay.Count > 0 || ballsInPlay.Count > 0)
|
while (ballsNotInPlay.Count > 0 || ballsInPlay.Count > 0)
|
||||||
{
|
{
|
||||||
breakCounter++;
|
breakCounter++;
|
||||||
|
|||||||
Reference in New Issue
Block a user