diff --git a/Bot/Games/SlotMachine.fs b/Bot/Games/SlotMachine.fs index 37ea635..c7ed238 100644 --- a/Bot/Games/SlotMachine.fs +++ b/Bot/Games/SlotMachine.fs @@ -318,7 +318,7 @@ let spin multiplier (ctx : IDiscordContext) = match result with | "WON" -> s1 + $" **WON** {prizeAmount} $GBT playing slots!" | "LOST" -> s1 + $" **LOST** playing slots" - | "JACKPOT" -> s1 + $" 🎉🎉🎉 **JUST HIT THE JACKPOT** and **WON**!!! 🎉🎉🎉" + | "JACKPOT" -> s1 + $" 🎉🎉🎉 **JUST HIT THE JACKPOT** and **WON** {prizeAmount}!!! 🎉🎉🎉" | _ -> "" let channel = ctx.GetGuild().GetChannel(GuildEnvironment.channelEventsHackerBattle) do! channel.SendMessageAsync(hopMsg) |> Async.AwaitTask |> Async.Ignore @@ -378,7 +378,7 @@ let handleMessageCreated (_ : DiscordClient) (event : MessageCreateEventArgs) = do! event.Message.DeleteAsync() } :> Task -let sendEmbed channel (message : DiscordMessage option) = async { +let sendEmbed (jackpotNumChannel : DiscordChannel) slotsChannel (message : DiscordMessage option) = async { let builder = DiscordMessageBuilder() let embed = DiscordEmbedBuilder() embed.Title <- "Degenz Slot Machine" @@ -386,6 +386,11 @@ let sendEmbed channel (message : DiscordMessage option) = async { embed.Description <- "Try Your Hand at a Game of SLOTS!\nEvery Spin Adds to The JACKPOT!\nGood luck Degenz ✊" let! jackpot = getJackpotAmount () embed.Title <- $"CURRENT JACKPOT: `{jackpot} 💰 $GBT`" + + // Update Jackpot channel +// try +// do! jackpotNumChannel.ModifyAsync(fun channelEditModel -> channelEditModel.Name <- $"Jackpot: {jackpot} 💰 $GBT") |> Async.AwaitTask +// with ex -> printfn $"Error changing name: {ex.Message}" builder.AddEmbed(embed) |> ignore @@ -399,28 +404,30 @@ let sendEmbed channel (message : DiscordMessage option) = async { let! _ = m.ModifyAsync(builder) |> Async.AwaitTask return Some m | Some bot , None -> - let! m = bot.SendMessageAsync(channel, builder) |> Async.AwaitTask + let! m = bot.SendMessageAsync(slotsChannel, builder) |> Async.AwaitTask do! m.PinAsync() |> Async.AwaitTask return Some m | _ -> return None } -let sendEmbedWithLoop (channel : DiscordChannel) = +let sendEmbedWithLoop (jackpotNumChannel : DiscordChannel) (slotsChannel : DiscordChannel) = async { - let! pins = channel.GetPinnedMessagesAsync() |> Async.AwaitTask + let! pins = slotsChannel.GetPinnedMessagesAsync() |> Async.AwaitTask let! message = match pins |> Seq.toList with - | [] -> sendEmbed channel None + | [] -> sendEmbed jackpotNumChannel slotsChannel None | msg::_ -> async.Return (Some msg) while true do - do! Async.Sleep 10000 - do! sendEmbed channel (message) |> Async.Ignore + do! Async.Sleep 305000 + do! sendEmbed jackpotNumChannel slotsChannel message |> Async.Ignore } |> Async.Start let sendInitialEmbedFromLaunch (client : DiscordClient) = - let channel = client.Guilds.[GuildEnvironment.guildId].GetChannel(GuildEnvironment.channelSlots) - sendEmbedWithLoop channel + let jackpotNumChannel = client.Guilds.[GuildEnvironment.guildId].GetChannel(GuildEnvironment.channelJackpotNum) + let slotsChannel = client.Guilds.[GuildEnvironment.guildId].GetChannel(GuildEnvironment.channelSlots) + sendEmbedWithLoop jackpotNumChannel slotsChannel let sendInitialEmbedFromSlashCommand (ctx : IDiscordContext) = - let channel = ctx.GetGuild().GetChannel(GuildEnvironment.channelSlots) - sendEmbedWithLoop channel + let jackpotNumChannel = ctx.GetGuild().GetChannel(GuildEnvironment.channelJackpotNum) + let slotsChannel = ctx.GetGuild().GetChannel(GuildEnvironment.channelSlots) + sendEmbedWithLoop jackpotNumChannel slotsChannel diff --git a/Bot/GuildEnvironment.fs b/Bot/GuildEnvironment.fs index 952b12a..73a20e0 100644 --- a/Bot/GuildEnvironment.fs +++ b/Bot/GuildEnvironment.fs @@ -34,6 +34,7 @@ let channelWhitelist = getId "CHANNEL_WHITELIST" //let channelTosserTed = getId "CHANNEL_TOSSERTED" let channelShelters = getId "CHANNEL_SHELTERS" let channelSlots = getId "CHANNEL_SLOTS" +let channelJackpotNum = getId "CHANNEL_JACKPOTNUM" let channelBackAlley = getId "CHANNEL_BACKALLEY" let channelMarket = getId "CHANNEL_MARKET" let channelAccessoryShop = getId "CHANNEL_ACCESSORIES"