Update voice channel with jackpot. Show jackpot prize in HoP
This commit is contained in:
parent
d5fc7ae229
commit
fcd1f63154
@ -312,7 +312,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
|
||||
@ -372,7 +372,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"
|
||||
@ -381,6 +381,11 @@ let sendEmbed channel (message : DiscordMessage option) = async {
|
||||
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 $"{ex.Message}"
|
||||
|
||||
builder.AddEmbed(embed) |> ignore
|
||||
|
||||
let button1 = DiscordButtonComponent(ButtonStyle.Success, $"spin-1x", $"🎰 Bet {PlayPricex1} $GBT") :> DiscordComponent
|
||||
@ -393,28 +398,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! 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
|
||||
|
@ -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"
|
||||
|
Loading…
x
Reference in New Issue
Block a user