Update for new chyat

This commit is contained in:
barelyprofessional
2026-02-28 15:34:36 -06:00
parent 8a827a17de
commit c8016b4fc6
23 changed files with 178 additions and 104 deletions

View File

@@ -153,7 +153,7 @@ public class KasinoEventStart : ICommand
var msg = $":!: :!: A Keno Kasino event has started! :!: :!:[br]{targetEvent.EventText}[br]{guide}";
var msgIds = await botInstance.SendChatMessagesAsync(msg.FancySplitMessage(partSeparator: "[br]"), true);
var i = 0;
while (msgIds[0].ChatMessageId != null)
while (msgIds[0].ChatMessageUuid != null)
{
i++;
await Task.Delay(TimeSpan.FromMilliseconds(100), ctx);

View File

@@ -227,7 +227,7 @@ public class KenoCommand : ICommand
_kenoTable = await botInstance.SendChatMessageAsync(displayMessage, true);
var i = 0;
while (_kenoTable.ChatMessageId == null)
while (_kenoTable.ChatMessageUuid == null)
{
i++;
if (_kenoTable.Status is SentMessageTrackerStatus.NotSending or SentMessageTrackerStatus.Lost) return;
@@ -235,7 +235,7 @@ public class KenoCommand : ICommand
await Task.Delay(100);
}
if (_kenoTable.ChatMessageId == null)
if (_kenoTable.ChatMessageUuid == null)
{
throw new Exception($"_kenoTable chat message ID never got populated. Tracker status is: {_kenoTable?.Status}");
}
@@ -269,7 +269,7 @@ public class KenoCommand : ICommand
}
displayMessage += "[br]";
}
await botInstance.KfClient.EditMessageAsync(_kenoTable.ChatMessageId!.Value, displayMessage);
await botInstance.KfClient.EditMessageAsync(_kenoTable.ChatMessageUuid, displayMessage);
await Task.Delay(frameDelay);
if (displayMessage.Length <= 79 && displayMessage.Contains(BlankSpaceDisplay) &&
(displayMessage.Contains(CasinoNumberDisplay) || displayMessage.Contains(MatchRevealDisplay) ||

View File

@@ -145,7 +145,7 @@ public class LambchopCommand : ICommand
var lambChopDisplayMessage =
await botInstance.SendChatMessageAsync(ConvertLambchopFieldToString(tiles, hazards, true), true,
autoDeleteAfter: cleanupDelay);
while (lambChopDisplayMessage.ChatMessageId == null)
while (lambChopDisplayMessage.ChatMessageUuid == null)
{
await Task.Delay(50, ctx); // wait until first message is fully sent
if (lambChopDisplayMessage.Status is SentMessageTrackerStatus.Lost or SentMessageTrackerStatus.NotSending)
@@ -307,7 +307,7 @@ public class LambchopCommand : ICommand
async Task UpdateGameAsync(string? updateText = null)
{
updateText ??= ConvertLambchopFieldToString(tiles, hazards, false);
await botInstance.KfClient.EditMessageAsync(lambChopDisplayMessage.ChatMessageId!.Value, updateText);
await botInstance.KfClient.EditMessageAsync(lambChopDisplayMessage.ChatMessageUuid, updateText);
await Task.Delay(TimeSpan.FromMilliseconds(FRAME_DELAY), ctx);
}
}

View File

@@ -269,11 +269,11 @@ public class MinesCommand : ICommand
var lastmsg = KasinoMines.ActiveGames[gambler.Id].LastMessageId;
SentMessageTrackerModel msg;
if (lastmsg == 0)
if (lastmsg == null)
{
msg = (await botInstance.SendChatMessageAsync($"{KasinoMines.ActiveGames[gambler.Id].ToString()}", true));
await botInstance.WaitForChatMessageAsync(msg, ct: ctx);
if (msg.ChatMessageId == null) throw new InvalidOperationException("Timed out waiting for the message");
if (msg.ChatMessageUuid == null) throw new InvalidOperationException("Timed out waiting for the message");
}
else
{

View File

@@ -119,7 +119,7 @@ public class Planes : ICommand
var planesDisplay = GetPreGameBoard(-3, planesBoard2, plane, CarrierCount, noseUp);
var msgId = await botInstance.SendChatMessageAsync(planesDisplay, true);
var num = 0;
while (msgId.ChatMessageId == null)
while (msgId.ChatMessageUuid == null)
{
num++;
if (msgId.Status is SentMessageTrackerStatus.NotSending or SentMessageTrackerStatus.Lost) return;
@@ -148,7 +148,7 @@ public class Planes : ICommand
}
var winnings = plane.MultiTracker * wager;
planesDisplay += $"Winnings: {await winnings.FormatKasinoCurrencyAsync()}";
await botInstance.KfClient.EditMessageAsync(msgId.ChatMessageId!.Value, planesDisplay);
await botInstance.KfClient.EditMessageAsync(msgId.ChatMessageUuid, planesDisplay);
}
var neutral = false;
@@ -159,7 +159,7 @@ public class Planes : ICommand
{
counter = (fullCounter - 3) % 24;
planesDisplay = GetPreGameBoard(fullCounter, planesBoard2, plane, CarrierCount, noseUp);
await botInstance.KfClient.EditMessageAsync(msgId.ChatMessageId!.Value, planesDisplay);
await botInstance.KfClient.EditMessageAsync(msgId.ChatMessageUuid, planesDisplay);
await Task.Delay(TimeSpan.FromMilliseconds(frameLength), ctx);
fullCounter++;
}
@@ -236,7 +236,7 @@ public class Planes : ICommand
var winnings = plane.MultiTracker * wager;
planesDisplay += $"Winnings: {await winnings.FormatKasinoCurrencyAsync()}";
await botInstance.KfClient.EditMessageAsync(msgId.ChatMessageId!.Value, planesDisplay);
await botInstance.KfClient.EditMessageAsync(msgId.ChatMessageUuid, planesDisplay);
if (plane.Height > 5)
{
break;
@@ -264,7 +264,7 @@ public class Planes : ICommand
var win = plane.MultiTracker * wager;
newBalance = await Money.NewWagerAsync(gambler.Id, wager, win, WagerGame.Planes, ct: ctx);
planesDisplay = GetGameBoard(fullCounter, planesBoards, plane, CarrierCount, noseUp);
await botInstance.KfClient.EditMessageAsync(msgId.ChatMessageId!.Value, planesDisplay);
await botInstance.KfClient.EditMessageAsync(msgId.ChatMessageUuid, planesDisplay);
await botInstance.SendChatMessageAsync(
$"{user.FormatUsername()}, you [color={colors[BuiltIn.Keys.KiwiFarmsGreenColor].Value}]successfully landed with {await win.FormatKasinoCurrencyAsync()} from a total {plane.MultiTracker:N2}x multi![/color]. Your balance is now: {await newBalance.FormatKasinoCurrencyAsync()}",
true, autoDeleteAfter: cleanupDelay);
@@ -275,7 +275,7 @@ public class Planes : ICommand
newBalance = await Money.NewWagerAsync(gambler.Id, wager, -wager, WagerGame.Planes, ct: ctx);
planesDisplay = GetGameBoard(fullCounter, planesBoards, plane, CarrierCount, noseUp);
await Task.Delay(TimeSpan.FromMilliseconds(frameLength), ctx);
await botInstance.KfClient.EditMessageAsync(msgId.ChatMessageId!.Value, planesDisplay);
await botInstance.KfClient.EditMessageAsync(msgId.ChatMessageUuid, planesDisplay);
await botInstance.SendChatMessageAsync(
$"{user.FormatUsername()}, you [color={colors[BuiltIn.Keys.KiwiFarmsRedColor].Value}]crashed![/color] Your balance is now: {await newBalance.FormatKasinoCurrencyAsync()}",
true, autoDeleteAfter: cleanupDelay);

View File

@@ -173,7 +173,7 @@ public class PlinkoCommand : ICommand
//game starts here
int breakCounter = 0;
var plinkoMessageID = await botInstance.SendChatMessageAsync(PlinkoBoardDisplay(ballsInPlay), true, autoDeleteAfter: cleanupDelay);
while (plinkoMessageID.ChatMessageId == null && breakCounter < 1000) {
while (plinkoMessageID.ChatMessageUuid == null && breakCounter < 1000) {
await Task.Delay(100, ctx);
breakCounter++;
}
@@ -195,7 +195,7 @@ public class PlinkoCommand : ICommand
ballsNotInPlay.RemoveAt(0);
}
PlinkoMessage = PlinkoBoardDisplay(ballsInPlay) + "[br]" + lastPayoutMessage;
await botInstance.KfClient.EditMessageAsync(plinkoMessageID.ChatMessageId!.Value,PlinkoMessage);
await botInstance.KfClient.EditMessageAsync(plinkoMessageID.ChatMessageUuid!, PlinkoMessage);
if (ballsInPlay[0].POSITION.row == DIFFICULTY - 1) //once your ball has reached the bottom calculate the payout
{
currentPayout = wager * PlinkoPayoutBoard[ballsInPlay[0].POSITION.col];
@@ -219,7 +219,7 @@ public class PlinkoCommand : ICommand
await Task.Delay(300, ctx);
PlinkoMessage = PlinkoBoardDisplay(ballsInPlay) + "[br]" + lastPayoutMessage;
await botInstance.KfClient.EditMessageAsync(plinkoMessageID.ChatMessageId!.Value, PlinkoMessage);
await botInstance.KfClient.EditMessageAsync(plinkoMessageID.ChatMessageUuid!, PlinkoMessage);
await Task.Delay(300, ctx);
}

View File

@@ -128,10 +128,12 @@ public class RainCommand : ICommand
{
timer--;
await Task.Delay(1000, ctx);
await botInstance.KfClient.EditMessageAsync(msg.ChatMessageId!.Value,
await botInstance.KfClient.EditMessageAsync(msg.ChatMessageUuid!,
$"{user.FormatUsername()} is making it rain with {await decAmount.FormatKasinoCurrencyAsync()}! Type !rain in the next {timer} seconds to join.");
}
await botInstance.KfClient.DeleteMessageAsync(msg.ChatMessageId!.Value);
await Task.Delay(100, ctx);
await botInstance.KfClient.DeleteMessageAsync(msg.ChatMessageUuid!);
// At this point the timer should take care of things but truthfully it's a disaster and probably won't work
}
}

View File

@@ -262,7 +262,7 @@ public class RouletteCommand : ICommand
if (activeRound != null)
{
activeRound.CountdownMessageId = countdownMessage.ChatMessageId;
activeRound.CountdownMessageId = countdownMessage.ChatMessageUuid;
await SaveRound(activeRound);
}
@@ -291,7 +291,7 @@ public class RouletteCommand : ICommand
try
{
var updatedMessage = await FormatCountdownMessage(endTime);
await botInstance.KfClient.EditMessageAsync(countdownMessage.ChatMessageId!.Value, updatedMessage);
await botInstance.KfClient.EditMessageAsync(countdownMessage.ChatMessageUuid!, updatedMessage);
var timeSinceLastUpdate = DateTimeOffset.UtcNow - lastUpdate;
logger.Debug($"Countdown updated (elapsed: {timeSinceLastUpdate.TotalSeconds:F1}s, remaining: {remaining.TotalSeconds:F0}s)");
@@ -414,12 +414,12 @@ public class RouletteCommand : ICommand
logger.Info($"Animation uploaded: {animationUrl}");
// Update countdown message to show it's spinning
if (round.CountdownMessageId.HasValue)
if (round.CountdownMessageId != null)
{
var spinningMessage = $"🎰 [B]SPINNING THE WHEEL...[/B] 🎰[br][br]" +
"Watch the animation below!";
await botInstance.KfClient.EditMessageAsync(
round.CountdownMessageId.Value,
round.CountdownMessageId,
spinningMessage);
}
@@ -486,10 +486,10 @@ public class RouletteCommand : ICommand
$"All {round.Bets.Count} bet(s) have been refunded (total: {await totalRefunded.FormatKasinoCurrencyAsync()}).[br]" +
$"Please try again.";
if (round.CountdownMessageId.HasValue)
if (round.CountdownMessageId != null)
{
await botInstance.KfClient.EditMessageAsync(
round.CountdownMessageId.Value,
round.CountdownMessageId,
cancelMessage);
}
else
@@ -707,10 +707,10 @@ public class RouletteCommand : ICommand
$"Cancelled by {user.FormatUsername()}[br]" +
$"Refunded {round.Bets.Count} bet(s) totaling {await totalRefunded.FormatKasinoCurrencyAsync()}";
if (round.CountdownMessageId.HasValue)
if (round.CountdownMessageId != null)
{
await botInstance.KfClient.EditMessageAsync(
round.CountdownMessageId.Value,
round.CountdownMessageId,
cancelMessage);
}
else
@@ -884,7 +884,7 @@ public class RouletteCommand : ICommand
{
public required int RoundId { get; init; }
public required DateTimeOffset StartTime { get; init; }
public int? CountdownMessageId { get; set; }
public string? CountdownMessageId { get; set; }
public required List<RouletteBetInfo> Bets { get; init; }
}

View File

@@ -156,7 +156,7 @@ public class WheelCommand : ICommand
int delay = (int)(MIN_WHEELSPIN_DELAY + easeOut * (MAX_WHEELSPIN_DELAY - MIN_WHEELSPIN_DELAY));
await Task.Delay(delay, ctx);
wheel.RotateWheelOnce();
await botInstance.KfClient.EditMessageAsync(wheelDisplayMessage.ChatMessageId!.Value,
await botInstance.KfClient.EditMessageAsync(wheelDisplayMessage.ChatMessageUuid!,
wheel.ConvertWheelToOvalString());
}