From 981700e889125166c961684d6e6c29ffd77e1984 Mon Sep 17 00:00:00 2001 From: barelyprofessional <150058423+barelyprofessional@users.noreply.github.com> Date: Thu, 15 Jan 2026 23:56:29 -0600 Subject: [PATCH] Preloaded images with predictable URLs instead of continually reuploading the webps --- .../Commands/Kasino/CoinflipCommand.cs | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/KfChatDotNetBot/Commands/Kasino/CoinflipCommand.cs b/KfChatDotNetBot/Commands/Kasino/CoinflipCommand.cs index 1ba9a53..2ef95a0 100644 --- a/KfChatDotNetBot/Commands/Kasino/CoinflipCommand.cs +++ b/KfChatDotNetBot/Commands/Kasino/CoinflipCommand.cs @@ -100,7 +100,7 @@ public class CoinflipCommand : ICommand if (rolled > 0.5 + _houseEdge) { // won - var coinflipAnimation = await GetCoinFlipAnimationUrl(choiceStr); + var coinflipAnimation = GetCoinFlipAnimationUrl(choiceStr); await botInstance.SendChatMessageAsync($"[IMG]{coinflipAnimation}[/IMG]", true, autoDeleteAfter: cleanupDelay); await Task.Delay(1200, ctx); @@ -116,7 +116,7 @@ public class CoinflipCommand : ICommand { // lost bool isJacky = rolled > 0.5; // would've won without house edge - var coinflipAnimationURL = await GetCoinFlipAnimationUrl("heads" == choiceStr ? "tails" : "heads", isJacky); + var coinflipAnimationURL = GetCoinFlipAnimationUrl("heads" == choiceStr ? "tails" : "heads", isJacky); await botInstance.SendChatMessageAsync($"[IMG]{coinflipAnimationURL}[/IMG]", true, autoDeleteAfter: cleanupDelay); await Task.Delay(1200, ctx); @@ -129,20 +129,14 @@ public class CoinflipCommand : ICommand } } - private static async Task GetCoinFlipAnimationUrl(string choiceStr, bool isJacky = false) + private static string GetCoinFlipAnimationUrl(string choiceStr, bool isJacky = false) { - string animationPath; + var baseUrl = "https://i.ddos.lgbt/u"; if (isJacky) { - animationPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Assets", $"bossmancoin-{choiceStr}-jacky.webp"); + return $"{baseUrl}/bossmancoin-{choiceStr}-jacky.webp"; } - else - { - animationPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Assets", $"bossmancoin-{choiceStr}.webp"); - } - if (!File.Exists(animationPath)) throw new DirectoryNotFoundException($"Coinflip animation missing at {animationPath}"); - using var imageStream = File.OpenRead(animationPath); - return await Zipline.Upload(imageStream, new MediaTypeHeaderValue("image/webp"), "1h"); + return $"{baseUrl}/bossmancoin-{choiceStr}.webp"; } } \ No newline at end of file