From a7fe2c795d6884b8720f3fc6c42746f14a693062 Mon Sep 17 00:00:00 2001 From: Joseph Ferano Date: Mon, 21 Mar 2022 13:23:33 +0700 Subject: [PATCH] Show different message when users are 0 --- Bot/InviteTracker.fs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Bot/InviteTracker.fs b/Bot/InviteTracker.fs index 1aea807..aabe0da 100644 --- a/Bot/InviteTracker.fs +++ b/Bot/InviteTracker.fs @@ -179,9 +179,14 @@ let getInvitedUsersForId (ctx : IDiscordContext) = task { count <- count + 1 sb.AppendLine($"{count}.) <@{user}>") |> ignore let msg = + let str = + if users.Length > 0 then + $"**Total Recruited:**`{users.Length} Degenz`\n\n**Total Earned:** `{users.Length * InviteRewardAmount} 💰$GBT `\n\n**Last 10 users recruited:**\n{sb}" + else + $"You haven't recruited anyone yet, use the `/recruit` command to get the recruitment link" DiscordInteractionResponseBuilder() .AsEphemeral(true) - .WithContent($"**Total Recruited:**`{users.Length} Degenz`\n\n**Total Earned:** `{users.Length * InviteRewardAmount} 💰$GBT `\n\n**Last 10 users recruited:**\n{sb}") + .WithContent(str) do! ctx.Respond(InteractionResponseType.ChannelMessageWithSource, msg) }