From 387fc239a6ff8073439436d2aafe42da7052cafb Mon Sep 17 00:00:00 2001 From: Joseph Ferano Date: Mon, 20 Jun 2022 23:28:07 +0700 Subject: [PATCH] Armory --- Bot/Games/Store.fs | 45 +++++++++++++++++++++++++++------------------ 1 file changed, 27 insertions(+), 18 deletions(-) diff --git a/Bot/Games/Store.fs b/Bot/Games/Store.fs index 0e360c6..91855d3 100644 --- a/Bot/Games/Store.fs +++ b/Bot/Games/Store.fs @@ -438,24 +438,33 @@ let handleJpegEvents _ (event : ComponentInteractionCreateEventArgs) = let handleStoreEvents _ (event : ComponentInteractionCreateEventArgs) = let ctx = DiscordEventContext event :> IDiscordContext - let id = ctx.GetInteractionId() - let itemId = id.Split("-").[1] - let storeId = id.Split("-").[2] - match id with - | id when id.StartsWith("Buy") -> handleBuyItem (fun _ -> Task.CompletedTask) ctx itemId - | id when id.StartsWith("Sell") -> handleSell ctx itemId - | id when id.StartsWith("ShowHacks") -> buy storeId (Some ItemType.Hack) ctx - | id when id.StartsWith("ShowShields") -> buy storeId (Some ItemType.Shield) ctx - | _ -> - task { - let builder = DiscordInteractionResponseBuilder() - builder.IsEphemeral <- true - builder.Content <- $"Incorrect Action identifier {id}" - do! ctx.Respond(InteractionResponseType.ChannelMessageWithSource, builder) |> Async.AwaitTask - } - |> Async.AwaitTask - |> Async.Start - Task.CompletedTask + task { + let builder = DiscordInteractionResponseBuilder() + builder.IsEphemeral <- true + builder.Content <- $"🚀 __Mint Date:__ June 20th 6:30 UTC " + do! ctx.Respond(InteractionResponseType.ChannelMessageWithSource, builder) |> Async.AwaitTask + } : Task + +//let handleStoreEvents _ (event : ComponentInteractionCreateEventArgs) = +// let ctx = DiscordEventContext event :> IDiscordContext +// let id = ctx.GetInteractionId() +// let itemId = id.Split("-").[1] +// let storeId = id.Split("-").[2] +// match id with +// | id when id.StartsWith("Buy") -> handleBuyItem (fun _ -> Task.CompletedTask) ctx itemId +// | id when id.StartsWith("Sell") -> handleSell ctx itemId +// | id when id.StartsWith("ShowHacks") -> buy storeId (Some ItemType.Hack) ctx +// | id when id.StartsWith("ShowShields") -> buy storeId (Some ItemType.Shield) ctx +// | _ -> +// task { +// let builder = DiscordInteractionResponseBuilder() +// builder.IsEphemeral <- true +// builder.Content <- $"Incorrect Action identifier {id}" +// do! ctx.Respond(InteractionResponseType.ChannelMessageWithSource, builder) |> Async.AwaitTask +// } +// |> Async.AwaitTask +// |> Async.Start +// Task.CompletedTask let sendBackalleyEmbed (ctx : IDiscordContext) = async {