Fix no players in leaderboards command
This commit is contained in:
parent
18cbf478c9
commit
5ccb4b730f
@ -152,11 +152,12 @@ let leaderboard (ctx : InteractionContext) =
|
||||
async {
|
||||
let builder = DiscordInteractionResponseBuilder()
|
||||
builder.IsEphemeral <- true
|
||||
builder.Content <-
|
||||
let content =
|
||||
players
|
||||
|> List.sortByDescending (fun p -> p.Bank)
|
||||
|> List.mapi (fun i p -> $"{i + 1}. {p.Bank} {p.Name}")
|
||||
|> String.concat "\n"
|
||||
builder.Content <- if not <| String.IsNullOrEmpty content then content else "There are no active hackers"
|
||||
do! ctx.CreateResponseAsync(InteractionResponseType.ChannelMessageWithSource, builder)
|
||||
|> Async.AwaitTask
|
||||
} |> Async.StartAsTask
|
||||
|
Loading…
x
Reference in New Issue
Block a user