Add emojis for testing

This commit is contained in:
Joseph Ferano 2022-04-08 09:02:01 +07:00
parent 893fe1133d
commit f8778caca7
2 changed files with 43 additions and 47 deletions

View File

@ -111,7 +111,7 @@ slotsBot.ConnectAsync() |> Async.AwaitTask |> Async.RunSynchronously
//if guild <> 922419263275425832uL then //if guild <> 922419263275425832uL then
// Trainer.sendInitialEmbed hackerBattleBot // Trainer.sendInitialEmbed hackerBattleBot
// InviteTracker.sendInitialEmbed inviterBot // InviteTracker.sendInitialEmbed inviterBot
SlotMachine.sendInitialEmbed slotsBot //SlotMachine.sendInitialEmbed slotsBot
let rec loop areBotsRunning = let rec loop areBotsRunning =
async { async {

View File

@ -23,17 +23,30 @@ let slots =
// "https://s7.gifyu.com/images/ramen.png" // "https://s7.gifyu.com/images/ramen.png"
// "https://s7.gifyu.com/images/rat.png" // "https://s7.gifyu.com/images/rat.png"
//|] //|]
// [|
// "https://s7.gifyu.com/images/A-bottle-of-pills0a3006d0170e08df.png"
// "https://s7.gifyu.com/images/an-eyec362d8152ae2382b.png"
// "https://s7.gifyu.com/images/anon-face-mask6c7624821c89fc08.png"
// "https://s7.gifyu.com/images/a-piece-of-sushi77071d30f60a89c6.png"
// "https://s7.gifyu.com/images/Circuit-board89056017b80f1d13.png"
// "https://s7.gifyu.com/images/OBEYf2a8234109836c03.png"
// "https://s7.gifyu.com/images/old-tv-screendc6bc9d4b6c1fd65.png"
// "https://s7.gifyu.com/images/pizza030ffc00ff50da0e.png"
// "https://s7.gifyu.com/images/ramen08336d448018c98f.png"
// "https://s7.gifyu.com/images/rat14f65f54f0d75036.png"
//|]
[| [|
"https://s7.gifyu.com/images/A-bottle-of-pills0a3006d0170e08df.png" "<:sushi:>"
"https://s7.gifyu.com/images/an-eyec362d8152ae2382b.png" "<:pizza:>"
"https://s7.gifyu.com/images/anon-face-mask6c7624821c89fc08.png" "<:ramen:>"
"https://s7.gifyu.com/images/a-piece-of-sushi77071d30f60a89c6.png" "<:circuitboard:>"
"https://s7.gifyu.com/images/Circuit-board89056017b80f1d13.png" "<:obey:>"
"https://s7.gifyu.com/images/OBEYf2a8234109836c03.png" "<:pills:>"
"https://s7.gifyu.com/images/old-tv-screendc6bc9d4b6c1fd65.png" "<:oldtv:>"
"https://s7.gifyu.com/images/pizza030ffc00ff50da0e.png" "<:rat:>"
"https://s7.gifyu.com/images/ramen08336d448018c98f.png" "<:aneye:>"
"https://s7.gifyu.com/images/rat14f65f54f0d75036.png" "<:anon:>"
|] |]
let slotsLocal = let slotsLocal =
[| [|
@ -68,12 +81,12 @@ let spin (ctx : IDiscordContext) =
then do! DbService.updatePlayerCurrency twoOfAKindPrize player |> Async.Ignore then do! DbService.updatePlayerCurrency twoOfAKindPrize player |> Async.Ignore
else do! DbService.updatePlayerCurrency -PlayPrice player |> Async.Ignore else do! DbService.updatePlayerCurrency -PlayPrice player |> Async.Ignore
let embed1 = DiscordEmbedBuilder() // let embed1 = DiscordEmbedBuilder()
embed1.ImageUrl <- slots.[results.[0]] // embed1.ImageUrl <- slots.[results.[0]]
let embed2 = DiscordEmbedBuilder() // let embed2 = DiscordEmbedBuilder()
embed2.ImageUrl <- slots.[results.[1]] // embed2.ImageUrl <- slots.[results.[1]]
let embed3 = DiscordEmbedBuilder() // let embed3 = DiscordEmbedBuilder()
embed3.ImageUrl <- slots.[results.[2]] // embed3.ImageUrl <- slots.[results.[2]]
let embed4 = DiscordEmbedBuilder() let embed4 = DiscordEmbedBuilder()
embed4.Title <- "Slot Machine" embed4.Title <- "Slot Machine"
embed4.Description <- "You hit the jackpot!" embed4.Description <- "You hit the jackpot!"
@ -88,44 +101,27 @@ let spin (ctx : IDiscordContext) =
builder.Content <- "Spinning!" builder.Content <- "Spinning!"
builder.IsEphemeral <- true builder.IsEphemeral <- true
let emojis = ctx.GetGuild().Emojis |> Seq.map (fun kvp -> kvp.Value) |> Seq.toArray
let! followUp = iCtx.CreateFollowupMessageAsync(builder) |> Async.AwaitTask let! followUp = iCtx.CreateFollowupMessageAsync(builder) |> Async.AwaitTask
do! Async.Sleep 1500 do! Async.Sleep 1500
use f1 = new FileStream(slotsLocal.[0], FileMode.Open) let! _ = iCtx.EditFollowupMessageAsync(followUp.Id, DiscordWebhookBuilder().WithContent(Formatter.Emoji(emojis.[results.[0]]))) |> Async.AwaitTask
let! _ = iCtx.EditFollowupMessageAsync(followUp.Id, DiscordWebhookBuilder().AddFile(f1)) |> Async.AwaitTask
do! Async.Sleep 1500 do! Async.Sleep 1500
use f2 = new FileStream(slotsLocal.[1], FileMode.Open) let! _ = iCtx.EditFollowupMessageAsync(followUp.Id, DiscordWebhookBuilder().WithContent($"{Formatter.Emoji(emojis.[results.[0]])}{Formatter.Emoji(emojis.[results.[1]])}")) |> Async.AwaitTask
let! _ = iCtx.EditFollowupMessageAsync(followUp.Id, DiscordWebhookBuilder().AddFile(f2)) |> Async.AwaitTask
do! Async.Sleep 1500 do! Async.Sleep 1500
use f3 = new FileStream(slotsLocal.[2], FileMode.Open) let! asdf = iCtx.EditFollowupMessageAsync(followUp.Id, DiscordWebhookBuilder()
let! _ = iCtx.EditFollowupMessageAsync(followUp.Id, DiscordWebhookBuilder().AddFile(f3)) |> Async.AwaitTask .WithContent($"{Formatter.Emoji(emojis.[results.[0]])}{Formatter.Emoji(emojis.[results.[1]])}{Formatter.Emoji(emojis.[results.[2]])}")
.AddEmbed(embed4)
) |> Async.AwaitTask
do! Async.Sleep 1500 do! Async.Sleep 1500
let! _ = iCtx.EditFollowupMessageAsync(followUp.Id, DiscordWebhookBuilder().AddEmbed(embed1)) |> Async.AwaitTask let builder = DiscordFollowupMessageBuilder()
do! Async.Sleep 1500 builder.AddEmbeds([ embed4.Build() ]) |> ignore
let! _ = iCtx.EditFollowupMessageAsync(followUp.Id, DiscordWebhookBuilder().AddEmbeds([embed1.Build() ; embed2.Build()])) |> Async.AwaitTask builder.IsEphemeral <- true
do! Async.Sleep 1500 // let! _ = iCtx.CreateFollowupMessageAsync(builder) |> Async.AwaitTask
let! _ = iCtx.EditFollowupMessageAsync(followUp.Id, DiscordWebhookBuilder().AddEmbeds([embed1.Build() ; embed2.Build() ; embed3.Build() ])) |> Async.AwaitTask
do! Async.Sleep 1500
let! _ = iCtx.EditFollowupMessageAsync(followUp.Id, DiscordWebhookBuilder().AddEmbeds([embed1.Build() ; embed2.Build() ; embed3.Build() ; embed4.Build() ])) |> Async.AwaitTask
return () return ()
// do! Async.Sleep sleepTime
// let builder = DiscordFollowupMessageBuilder()
// let embed = DiscordEmbedBuilder()
// embed.ImageUrl <- slots.[results.[0]]
// builder.AddEmbed(embed.Build()) |> ignore
//
// do! Async.Sleep sleepTime
// let builder = DiscordFollowupMessageBuilder()
// embed.ImageUrl <- slots.[results.[1]]
// builder.AddEmbed(embed.Build()) |> ignore
//
// do! Async.Sleep sleepTime
// let builder = DiscordFollowupMessageBuilder()
// embed.ImageUrl <- slots.[results.[2]]
// builder.AddEmbed(embed.Build()) |> ignore
//
// if winConditions then // if winConditions then
// do! Async.Sleep sleepTime // do! Async.Sleep sleepTime
// let builder = DiscordFollowupMessageBuilder() // let builder = DiscordFollowupMessageBuilder()