16 lines
514 B
Forth
16 lines
514 B
Forth
module Degenz.Game
|
|
|
|
open System.Threading.Tasks
|
|
open DSharpPlus.SlashCommands
|
|
open Degenz.DbService
|
|
|
|
let executePlayerAction (ctx : InteractionContext) (dispatch : PlayerData -> Async<unit>) =
|
|
async {
|
|
let! playerResult = tryFindPlayer ctx.Member.Id
|
|
match playerResult with
|
|
| Some player -> do! dispatch player
|
|
| None -> do! Messaging.sendSimpleResponse ctx "You are currently not a hacker, first use the /redpill command to become one"
|
|
} |> Async.StartAsTask
|
|
:> Task
|
|
|