Try catch around initial message
This commit is contained in:
parent
eb4e42ad11
commit
31864ed025
@ -28,19 +28,22 @@ let TrainerEvents = [|
|
||||
|
||||
let sendInitialEmbed (client : DiscordClient) =
|
||||
async {
|
||||
let! channel = client.GetChannelAsync(GuildEnvironment.channelTraining) |> Async.AwaitTask
|
||||
let builder = DiscordMessageBuilder()
|
||||
let embed = DiscordEmbedBuilder()
|
||||
embed.ImageUrl <- "https://s10.gifyu.com/images/MasterTraining_Degenz.gif"
|
||||
builder.AddEmbed embed |> ignore
|
||||
builder.Content <- "Welcome Degen… To the Hacker Training Program.\n"
|
||||
+ "Here you will learn how to defend yourself, and hack other Degenz to take their 💰$GBT.\n"
|
||||
+ "Are you ready?"
|
||||
let button = DiscordButtonComponent(ButtonStyle.Success, $"Trainer-1", $"LFG") :> DiscordComponent
|
||||
builder.AddComponents [| button |] |> ignore
|
||||
do! channel.SendMessageAsync(builder)
|
||||
|> Async.AwaitTask
|
||||
|> Async.Ignore
|
||||
try
|
||||
let! channel = client.GetChannelAsync(GuildEnvironment.channelTraining) |> Async.AwaitTask
|
||||
let builder = DiscordMessageBuilder()
|
||||
let embed = DiscordEmbedBuilder()
|
||||
embed.ImageUrl <- "https://s10.gifyu.com/images/MasterTraining_Degenz.gif"
|
||||
builder.AddEmbed embed |> ignore
|
||||
builder.Content <- "Welcome Degen… To the Hacker Training Program.\n"
|
||||
+ "Here you will learn how to defend yourself, and hack other Degenz to take their 💰$GBT.\n"
|
||||
+ "Are you ready?"
|
||||
let button = DiscordButtonComponent(ButtonStyle.Success, $"Trainer-1", $"LFG") :> DiscordComponent
|
||||
builder.AddComponents [| button |] |> ignore
|
||||
do! channel.SendMessageAsync(builder)
|
||||
|> Async.AwaitTask
|
||||
|> Async.Ignore
|
||||
with e ->
|
||||
printfn $"Error trying to get channel {GuildEnvironment.channelTraining}\n\n{e.Message}"
|
||||
} |> Async.RunSynchronously
|
||||
|
||||
let handleTrainerStep1 (ctx : IDiscordContext) =
|
||||
|
Loading…
x
Reference in New Issue
Block a user