Have Chip get the channel

This commit is contained in:
Joseph Ferano 2022-05-19 00:23:44 +07:00
parent 3c242cbb51
commit 202905d9f9

View File

@ -353,7 +353,6 @@ let showWalletStatus (ctx : IDiscordContext) =
let sendSubmitEmbed (ctx : IDiscordContext) = let sendSubmitEmbed (ctx : IDiscordContext) =
async { async {
try try
let channel = ctx.GetGuild().GetChannel(GuildEnvironment.channelSubmitWallet)
let rewardMsg = $""" let rewardMsg = $"""
To confirm your **Whitelist** please submit it below: To confirm your **Whitelist** please submit it below:
@ -373,18 +372,14 @@ To confirm your **Whitelist** please submit it below:
let btn = DiscordButtonComponent(ButtonStyle.Success, "WalletStatus", "Check Status") :> DiscordComponent let btn = DiscordButtonComponent(ButtonStyle.Success, "WalletStatus", "Check Status") :> DiscordComponent
builder.AddComponents [| btn |] |> ignore builder.AddComponents [| btn |] |> ignore
printfn "1"
let! msgs = channel.GetMessagesAsync() |> Async.AwaitTask
printfn "2"
let recruitBot = GuildEnvironment.botClientRecruit.Value let recruitBot = GuildEnvironment.botClientRecruit.Value
let! channel = recruitBot.GetChannelAsync(GuildEnvironment.channelSubmitWallet) |> Async.AwaitTask
let! msgs = channel.GetMessagesAsync() |> Async.AwaitTask
match msgs |> Seq.tryHead with match msgs |> Seq.tryHead with
| Some msg -> | Some msg ->
if msg.Author.Id = recruitBot.CurrentUser.Id then if msg.Author.Id = recruitBot.CurrentUser.Id then
printfn "3"
do! msg.ModifyAsync(builder) |> Async.AwaitTask |> Async.Ignore do! msg.ModifyAsync(builder) |> Async.AwaitTask |> Async.Ignore
printfn "4"
| None -> | None ->
printfn "2a"
do! recruitBot.SendMessageAsync(channel, builder) do! recruitBot.SendMessageAsync(channel, builder)
|> Async.AwaitTask |> Async.AwaitTask
|> Async.Ignore |> Async.Ignore